Skip to content

Commit

Permalink
[TASK] Harden method signature of logicalAnd() and logicalOr()
Browse files Browse the repository at this point in the history
Resolves: #2861
  • Loading branch information
simonschaufi committed Nov 8, 2023
1 parent b329ab8 commit b83b777
Show file tree
Hide file tree
Showing 18 changed files with 761 additions and 8 deletions.
5 changes: 3 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,12 +79,13 @@
"contribute": [
"@fix-rector",
"@fix-style",
"@analyze"
"@analyze",
"@phpstan-generate-baseline"
],
"check-style": "@php vendor/bin/ecs check --ansi",
"fix-style": "@php vendor/bin/ecs check --fix --ansi",
"analyze": "@php vendor/bin/phpstan analyse --memory-limit=-1 --ansi",
"phpstan-generate-baseline": "@php vendor/bin/phpstan analyse --generate-baseline --memory-limit=-1 --ansi",
"phpstan-generate-baseline": "@php vendor/bin/phpstan analyse --generate-baseline --memory-limit=-1 --ansi --allow-empty-baseline",
"test": "@php vendor/bin/phpunit",
"docs": "@php vendor/bin/rule-doc-generator generate src --output-file docs/all_rectors_overview.md --ansi",
"rector": "@php vendor/bin/rector process --dry-run --ansi",
Expand Down
2 changes: 2 additions & 0 deletions config/v12/typo3-120.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Ssch\TYPO3Rector\Rector\v12\v0\typo3\AddMethodToWidgetInterfaceClassesRector;
use Ssch\TYPO3Rector\Rector\v12\v0\typo3\ChangeExtbaseValidatorsRector;
use Ssch\TYPO3Rector\Rector\v12\v0\typo3\ContentObjectRegistrationViaServiceConfigurationRector;
use Ssch\TYPO3Rector\Rector\v12\v0\typo3\HardenMethodSignatureOfLogicalAndAndLogicalOrRector;
use Ssch\TYPO3Rector\Rector\v12\v0\typo3\HintNecessaryUploadedFileChangesRector;
use Ssch\TYPO3Rector\Rector\v12\v0\typo3\ImplementSiteLanguageAwareInterfaceRector;
use Ssch\TYPO3Rector\Rector\v12\v0\typo3\MigrateQueryBuilderExecuteRector;
Expand Down Expand Up @@ -170,4 +171,5 @@
$rectorConfig->rule(RegisterExtbaseTypeConvertersAsServicesRector::class);
$rectorConfig->rule(ChangeExtbaseValidatorsRector::class);
$rectorConfig->rule(ContentObjectRegistrationViaServiceConfigurationRector::class);
$rectorConfig->rule(HardenMethodSignatureOfLogicalAndAndLogicalOrRector::class);
};
2 changes: 2 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
parameters:
ignoreErrors: []
8 changes: 7 additions & 1 deletion phpstan.neon
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
includes:
- phpstan-baseline.neon
# see https://github.com/symplify/phpstan-extensions
- utils/phpstan/config/typo3-rector.neon

Expand Down Expand Up @@ -33,12 +34,17 @@ parameters:
- tests/bootstrap-phpstan.php

inferPrivatePropertyTypeFromConstructor: true
reportUnmatchedIgnoredErrors: true
reportUnmatchedIgnoredErrors: false

ignoreErrors:
# node finder
- '#Method Ssch\\TYPO3Rector\\Rector\\v11\\v0\\ForwardResponseInsteadOfForwardMethodRector\:\:extractForwardMethodCalls\(\) should return array<PhpParser\\Node\\Expr\\MethodCall\> but returns array<PhpParser\\Node\>#'

# These 3 rules are not found for some strange reasons in GitHub Actions but locally they are reported
- "#\\:\\:getRuleDefinition\\(\\) has invalid return type Symplify\\\\RuleDocGenerator\\\\ValueObject\\\\RuleDefinition\\.$#"
- "#^Instantiated class Symplify\\\\RuleDocGenerator\\\\ValueObject\\\\CodeSample\\\\CodeSample not found\\.$#"
- "#^Instantiated class Symplify\\\\RuleDocGenerator\\\\ValueObject\\\\RuleDefinition not found\\.$#"

# waits for Rector and PHPStan to share same php-parser, probably with PHPStan 1.0
- '#PhpParser\\Node\\Arg\|PhpParser\\Node\\VariadicPlaceholder#'

Expand Down
Loading

0 comments on commit b83b777

Please sign in to comment.