-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
PHPStan: cleanup setup #4222
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
PHPStan: cleanup setup #4222
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,9 +9,16 @@ parameters: | |
| - recipe | ||
| - contrib | ||
|
|
||
| bootstrapFiles: | ||
| - tests/constants.php | ||
|
|
||
| dynamicConstantNames: | ||
| DEPLOYER_VERSION: string | ||
| DEPLOYER_BIN: string | ||
| MASTER_ENDPOINT: string | ||
| MASTER_TOKEN: string | ||
|
|
||
| ignoreErrors: | ||
| - "#^Constant DEPLOYER_VERSION not found\\.$#" | ||
| - "#^Constant DEPLOYER_BIN not found\\.$#" | ||
| - "#^Constant MASTER_ENDPOINT not found\\.$#" | ||
| - "#^Constant MASTER_TOKEN not found\\.$#" | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
|
||
| - "#CpanelPhp#" | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,9 @@ | |
| use function Deployer\Support\is_closure; | ||
| use function Deployer\Support\normalize_line_endings; | ||
|
|
||
| /** | ||
| * @implements \ArrayAccess<string, mixed> | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. reflects the signature of |
||
| */ | ||
| class Configuration implements \ArrayAccess | ||
| { | ||
| private ?Configuration $parent; | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| <?php | ||
|
|
||
| define('DEPLOYER_BIN', __DIR__ . '/../bin/dep'); | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. extracting constant definitions in a separate file, so PHPStan can discover them |
||
| define('DEPLOYER_VERSION', 'dev-master'); | ||
| define('__FIXTURES__', __DIR__ . '/fixtures'); | ||
| define('__REPOSITORY__', __DIR__ . '/fixtures/repository'); | ||
| define('__TEMP_DIR__', sys_get_temp_dir() . '/deployer'); | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make PHPStan aware which types we expect the constants to have. those will be validated against when code uses
define()orconst.see