Skip to content

Commit 34b84df

Browse files
authored
Merge branch '2.1.x' into patch-1
2 parents 383fab2 + b3ae3d2 commit 34b84df

File tree

132 files changed

+4338
-456
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+4338
-456
lines changed

.github/workflows/e2e-tests.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,9 @@ jobs:
282282
cd e2e/ignore-error-extension
283283
composer install
284284
../../bin/phpstan
285+
- script: |
286+
cd e2e/bug-10483
287+
../../bin/phpstan
285288
286289
steps:
287290
- name: "Checkout"
@@ -392,6 +395,9 @@ jobs:
392395
cd e2e/composer-version-config
393396
composer install
394397
../../bin/phpstan analyze test.php --level=0
398+
- script: |
399+
cd e2e/bug13425
400+
timeout 15 ../bashunit -a exit_code "1" "../../bin/phpstan analyze src/ plugins/"
395401
396402
steps:
397403
- name: "Checkout"

bin/phpstan

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,13 @@ use Symfony\Component\Console\Helper\ProgressBar;
2929
}
3030
$devOrPharLoader->unregister();
3131

32+
// fix missing key for vendor/hoa/protocol/Wrapper.php
33+
$existingComposerAutoloadFiles = $GLOBALS['__composer_autoload_files'] ?? [];
34+
$GLOBALS['__composer_autoload_files'] = array_merge(
35+
$existingComposerAutoloadFiles,
36+
array_fill_keys(['3e76f7f02b41af8cea96018933f6b7e3'], true),
37+
);
38+
3239
$autoloaderInWorkingDirectory = $vendorDirectory . '/autoload.php';
3340
$composerAutoloaderProjectPaths = [];
3441

build/ignore-by-php-version.neon.php

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,11 @@
3838
} else {
3939
$includes[] = __DIR__ . '/new-phpunit.neon';
4040
}
41+
42+
if (PHP_VERSION_ID < 80300) {
43+
$includes[] = __DIR__ . '/str-increment.neon';
44+
}
45+
4146
$config = [];
4247
$config['includes'] = $includes;
4348

build/str-increment.neon

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
parameters:
2+
ignoreErrors:
3+
-
4+
message: '#^Used function str_increment not found\.#'

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"ondrejmirtes/composer-attribute-collector": "^1.1.1",
2929
"ondrejmirtes/php-merge": "^4.1",
3030
"phpstan/php-8-stubs": "0.4.24",
31-
"phpstan/phpdoc-parser": "2.2.0",
31+
"phpstan/phpdoc-parser": "2.3.0",
3232
"psr/http-message": "^1.1",
3333
"react/async": "^3",
3434
"react/child-process": "^0.7",

composer.lock

Lines changed: 7 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

conf/bleedingEdge.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,4 @@ parameters:
88
reportPreciseLineForUnusedFunctionParameter: true
99
internalTag: true
1010
newStaticInAbstractClassStaticMethod: true
11+
checkExtensionsForComparisonOperators: true

conf/config.neon

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ parameters:
3131
reportPreciseLineForUnusedFunctionParameter: false
3232
internalTag: false
3333
newStaticInAbstractClassStaticMethod: false
34+
checkExtensionsForComparisonOperators: false
3435
fileExtensions:
3536
- php
3637
checkAdvancedIsset: false

conf/parametersSchema.neon

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ parametersSchema:
3535
reportPreciseLineForUnusedFunctionParameter: bool()
3636
internalTag: bool()
3737
newStaticInAbstractClassStaticMethod: bool()
38+
checkExtensionsForComparisonOperators: bool()
3839
])
3940
fileExtensions: listOf(string())
4041
checkAdvancedIsset: bool()
@@ -158,7 +159,7 @@ parametersSchema:
158159
resultCachePath: string()
159160
resultCacheSkipIfOlderThanDays: int()
160161
resultCacheChecksProjectExtensionFilesDependencies: bool()
161-
dynamicConstantNames: listOf(string())
162+
dynamicConstantNames: arrayOf(string())
162163
customRulesetUsed: schema(bool(), nullable())
163164
rootDir: string()
164165
tmpDir: string()

e2e/bug-10483/bug-10483.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
define("FILTER_VALIDATE_FLOAT",false);
4+
5+
/** @return mixed */
6+
function doFoo() { return null; }
7+
8+
$mixed = doFoo();
9+
if (filter_var($mixed, FILTER_VALIDATE_BOOLEAN)) {
10+
}

0 commit comments

Comments
 (0)