Skip to content

Commit df73738

Browse files
Merge pull request #4 from szepeviktor/fix
Improve stubs
2 parents 6a4a08e + 2da14ed commit df73738

4 files changed

Lines changed: 7 additions & 50 deletions

File tree

finder-constants.php

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,5 @@
11
<?php
22

3-
require_once 'vendor/autoload.php';
4-
53
return \StubsGenerator\Finder::create()
64
->in( array(
75
'source/vendor/freemius/wordpress-sdk/includes',

finder.php

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,37 +3,15 @@
33
return \StubsGenerator\Finder::create()
44
->in( array(
55
'source/vendor/freemius/wordpress-sdk/includes',
6-
'source/vendor/freemius/wordpress-sdk/templates'
76
) )
8-
->append(
9-
\StubsGenerator\Finder::create()
10-
->in(['source/vendor/freemius/wordpress-sdk'])
11-
->files()
12-
->depth('< 1')
13-
->path('config.php')
14-
)
15-
->append(
16-
\StubsGenerator\Finder::create()
17-
->in(['source/vendor/freemius/wordpress-sdk/includes/'])
18-
->files()
19-
->depth('< 1')
20-
->path('fs-essential-functions.php')
21-
)
22-
->append(
23-
\StubsGenerator\Finder::create()
24-
->in(['source/vendor/freemius/wordpress-sdk/includes/'])
25-
->files()
26-
->depth('< 1')
27-
->path('require.php')
28-
)
7+
->notPath('customizer')
8+
->notPath('debug')
299
->append(
3010
\StubsGenerator\Finder::create()
3111
->in(['source/vendor/freemius/wordpress-sdk'])
3212
->files()
3313
->depth('< 1')
3414
->path('start.php')
3515
)
36-
->notPath('customizer')
37-
->notPath('debug')
3816
->sortByName(true)
3917
;

freemius-stubs.php

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5097,9 +5097,9 @@ function should_use_external_pricing()
50975097
*
50985098
*
50995099
* @return array {
5100-
* @var bool $success
5101-
* @var string $error
5102-
* @var string $next_page
5100+
* @type bool $success
5101+
* @type string $error
5102+
* @type string $next_page
51035103
* }
51045104
*/
51055105
private function activate_license($license_key, $sites = array(), $is_marketing_allowed = \null, $blog_id = \null, $plugin_id = \null, $license_owner_id = \null, $is_extensions_tracking_allowed = \null, $is_diagnostic_tracking_allowed = \null)
@@ -15849,19 +15849,6 @@ private static function ThrowSquidAclException($pResult = '')
1584915849
}
1585015850
#endregion
1585115851
}
15852-
/**
15853-
* Initialize Freemius custom debug panels.
15854-
*
15855-
* @param array $panels Debug bar panels objects
15856-
*
15857-
* @return array Debug bar panels with your custom panels
15858-
*/
15859-
function fs_custom_panels_init($panels)
15860-
{
15861-
}
15862-
function fs_custom_status_init($statuses)
15863-
{
15864-
}
1586515852
/**
1586615853
* Get object's public variables.
1586715854
*

phpstan.neon

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,14 @@
11
parameters:
22
paths:
3-
- freemius-constants-stubs.php
43
- freemius-stubs.php
4+
scanFiles:
5+
- freemius-constants-stubs.php
56
bootstrapFiles:
67
- bootstrap.php
78
level: 5
8-
tipsOfTheDay: false
99
ignoreErrors:
10-
- '#is always (true|false).#'
1110
- '#but return statement is missing\.$#'
1211
- '#has an unused parameter#'
1312
- '#^(Property|Static property|Method|Static method) \S+ is unused\.$#'
1413
- '#is never read, only written\.$#'
1514
- '#has invalid (return )?type (WP_Error|WP_Customize_Manager|WP_Theme|WP_User|WP_Site|WP_Upgrader)#'
16-
- '#Parameter \d+ of \S+ is never used\.$#'
17-
- '#Variable \$\S+ might not be defined\.$#'
18-
- '#Function \S+ not found\.#'
19-
- '#tag @var above a method has no effect.#'
20-

0 commit comments

Comments
 (0)