Skip to content

Commit

Permalink
[TASK] Upgrade PHPStan to latest version 0.12.99
Browse files Browse the repository at this point in the history
This is the latest version before 1.0.0 release.
PHPStan 1.0 is going to be PHPStan 0.12.99 + bleeding edge + BC breaks.

composer req --dev phpstan/phpstan:^0.12.99

Resolves: #95606
Releases: master
Change-Id: I9334b21b904e986b1ef51c3a8e695a49b55c357c
Reviewed-on: https://review.typo3.org/c/Packages/TYPO3.CMS/+/71597
Reviewed-by: Rudy Gnodde <rudy@famouswolf.com>
Reviewed-by: Simon Schaufelberger <simonschaufi+typo3@gmail.com>
Reviewed-by: Jochen <rothjochen@gmail.com>
Reviewed-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
Tested-by: Simon Schaufelberger <simonschaufi+typo3@gmail.com>
Tested-by: core-ci <typo3@b13.com>
Tested-by: Jochen <rothjochen@gmail.com>
Tested-by: Anja Leichsenring <aleichsenring@ab-softlab.de>
  • Loading branch information
wouter90 authored and maddy2101 committed Nov 3, 2021
1 parent 9468258 commit fbbdfe7
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 20 deletions.
18 changes: 18 additions & 0 deletions Build/phpstan.level3.neon
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,12 @@ conditionalTags:
PHPStan\Rules\Arrays\ArrayDestructuringRule:
phpstan.rules.rule: %featureToggles.arrayDestructuring%

PHPStan\Rules\Exceptions\ThrowsVoidFunctionWithExplicitThrowPointRule:
phpstan.rules.rule: %featureToggles.throwsVoid%

PHPStan\Rules\Exceptions\ThrowsVoidMethodWithExplicitThrowPointRule:
phpstan.rules.rule: %featureToggles.throwsVoid%

parameters:
checkPhpDocMethodSignatures: true

Expand Down Expand Up @@ -57,6 +63,18 @@ services:
tags:
- phpstan.rules.rule

-
class: PHPStan\Rules\Exceptions\ThrowsVoidFunctionWithExplicitThrowPointRule
arguments:
exceptionTypeResolver: @exceptionTypeResolver
missingCheckedExceptionInThrows: %exceptions.check.missingCheckedExceptionInThrows%

-
class: PHPStan\Rules\Exceptions\ThrowsVoidMethodWithExplicitThrowPointRule
arguments:
exceptionTypeResolver: @exceptionTypeResolver
missingCheckedExceptionInThrows: %exceptions.check.missingCheckedExceptionInThrows%

# -
# class: PHPStan\Rules\Functions\ReturnTypeRule
# arguments:
Expand Down
25 changes: 15 additions & 10 deletions Build/phpstan.level4.neon
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,21 @@ rules:
conditionalTags:
PHPStan\Rules\Exceptions\CatchWithUnthrownExceptionRule:
phpstan.rules.rule: %featureToggles.preciseExceptionTracking%

PHPStan\Rules\Exceptions\OverwrittenExitPointByFinallyRule:
phpstan.rules.rule: %featureToggles.preciseExceptionTracking%

PHPStan\Rules\DeadCode\UnusedPrivateConstantRule:
phpstan.rules.rule: %featureToggles.unusedClassElements%

PHPStan\Rules\DeadCode\UnusedPrivateMethodRule:
phpstan.rules.rule: %featureToggles.unusedClassElements%

PHPStan\Rules\DeadCode\UnusedPrivatePropertyRule:
phpstan.rules.rule: %featureToggles.unusedClassElements%
PHPStan\Rules\Variables\IssetRule:
phpstan.rules.rule: %featureToggles.nullCoalesce%
PHPStan\Rules\Variables\NullCoalesceRule:
phpstan.rules.rule: %featureToggles.nullCoalesce%

parameters:
checkAdvancedIsset: true

services:
-
Expand Down Expand Up @@ -165,6 +168,14 @@ services:
-
class: PHPStan\Rules\Exceptions\CatchWithUnthrownExceptionRule

-
class: PHPStan\Rules\Exceptions\DeadCatchRule
arguments:
bleedingEdge: %featureToggles.bleedingEdge%

tags:
- phpstan.rules.rule

-
class: PHPStan\Rules\Exceptions\OverwrittenExitPointByFinallyRule

Expand All @@ -175,9 +186,3 @@ services:

tags:
- phpstan.rules.rule

-
class: PHPStan\Rules\Variables\IssetRule

-
class: PHPStan\Rules\Variables\NullCoalesceRule
1 change: 1 addition & 0 deletions Build/phpstan.level6.neon
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ parameters:
checkMissingTypehints: true

rules:
- PHPStan\Rules\Constants\MissingClassConstantTypehintRule
- PHPStan\Rules\Functions\MissingFunctionParameterTypehintRule
- PHPStan\Rules\Functions\MissingFunctionReturnTypehintRule
# - PHPStan\Rules\Methods\MissingMethodParameterTypehintRule
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@
"php-webdriver/webdriver": "^1.11.1",
"phpspec/prophecy": "^1.14.0",
"phpspec/prophecy-phpunit": "^2.0",
"phpstan/phpstan": "^0.12.98",
"phpstan/phpstan": "^0.12.99",
"phpunit/phpunit": "^9.5.10",
"typo3/cms-styleguide": "~11.5.0",
"typo3/testing-framework": "^6.12.0"
Expand Down
14 changes: 7 additions & 7 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions typo3/sysext/core/Classes/Utility/IpAnonymizationUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class IpAnonymizationUtility
* 1) Mask host
* 2) Mask host and subnet
*
* @var array
* @var array<int, string>
*/
const MASKV4 = [
1 => '255.255.255.0',
Expand All @@ -44,7 +44,7 @@ class IpAnonymizationUtility
* 1) Mask Interface ID
* 2) Mask Interface ID and SLA ID
*
* @var array
* @var array<int, string>
*/
const MASKV6 = [
1 => 'ffff:ffff:ffff:ffff:0000:0000:0000:0000',
Expand Down

0 comments on commit fbbdfe7

Please sign in to comment.