Skip to content
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

feat: Conflict phpstan >1.10.54, currently rector is broken with latest phpstan #285

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/functional_test__rector_examples.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install Drupal Rector
run: |
cd ~/drupal
composer require palantirnet/drupal-rector:@dev --no-progress
composer require palantirnet/drupal-rector:@dev --no-progress --update-with-dependencies
- name: Install Drupal Rector Config
run: |
cd ~/drupal
Expand Down
4 changes: 4 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
"rector/rector": "~0.18.0",
"webflo/drupal-finder": "^1.2"
},
"conflict": {
"phpstan/phpstan": ">=1.10.55",
"rector/rector": ">=0.19"
},
"license": "MIT",
"authors": [
{
Expand Down
2 changes: 1 addition & 1 deletion config/drupal-8/drupal-8.2-deprecations.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
});
// https://www.drupal.org/node/2802569
$rectorConfig->ruleWithConfiguration(FunctionToStaticRector::class, [
new \DrupalRector\Rector\ValueObject\FunctionToStaticConfiguration(
new DrupalRector\Rector\ValueObject\FunctionToStaticConfiguration(
'8.2.0',
'file_directory_os_temp',
'Drupal\Component\FileSystem\FileSystem',
Expand Down
2 changes: 1 addition & 1 deletion config/drupal-8/drupal-8.6-deprecations.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
$rectorConfig->singleton(AddCommentService::class, function () {
return new AddCommentService();
});
$rectorConfig->ruleWithConfiguration(\DrupalRector\Drupal8\Rector\Deprecation\StaticToFunctionRector::class, [
$rectorConfig->ruleWithConfiguration(DrupalRector\Drupal8\Rector\Deprecation\StaticToFunctionRector::class, [
// https://www.drupal.org/node/2850048
new StaticToFunctionConfiguration('Drupal\Component\Utility\Unicode', 'strlen', 'mb_strlen'),
// https://www.drupal.org/node/2850048
Expand Down
2 changes: 1 addition & 1 deletion config/drupal-9/drupal-9.1-deprecations.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@
$rectorConfig->rule(AssertNoFieldByNameRector::class);
$rectorConfig->rule(AssertFieldByIdRector::class);

$rectorConfig->ruleWithConfiguration(\DrupalRector\Drupal9\Rector\Deprecation\AssertLegacyTraitRector::class, [
$rectorConfig->ruleWithConfiguration(DrupalRector\Drupal9\Rector\Deprecation\AssertLegacyTraitRector::class, [
new AssertLegacyTraitConfiguration('assertLinkByHref', 'linkByHrefExists'),
new AssertLegacyTraitConfiguration('assertLink', 'linkExists'),
new AssertLegacyTraitConfiguration('assertNoEscaped', 'assertNoEscaped'),
Expand Down
6 changes: 3 additions & 3 deletions config/drupal-9/drupal-9.3-deprecations.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,9 @@
]);

// Change record: https://www.drupal.org/node/2940031
$rectorConfig->rule(\DrupalRector\Drupal9\Rector\Deprecation\FileCreateUrlRector::class);
$rectorConfig->rule(\DrupalRector\Drupal9\Rector\Deprecation\FileUrlTransformRelativeRector::class);
$rectorConfig->rule(\DrupalRector\Drupal9\Rector\Deprecation\FromUriRector::class);
$rectorConfig->rule(DrupalRector\Drupal9\Rector\Deprecation\FileCreateUrlRector::class);
$rectorConfig->rule(DrupalRector\Drupal9\Rector\Deprecation\FileUrlTransformRelativeRector::class);
$rectorConfig->rule(DrupalRector\Drupal9\Rector\Deprecation\FromUriRector::class);

// Change record: https://www.drupal.org/node/3223520
$rectorConfig->ruleWithConfiguration(FunctionToServiceRector::class, [
Expand Down
2 changes: 1 addition & 1 deletion config/drupal-9/drupal-9.4-deprecations.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@

return static function (Rector\Config\RectorConfig $rectorConfig): void {
// Change record https://www.drupal.org/node/3220952
$rectorConfig->rule(\DrupalRector\Drupal9\Rector\Deprecation\ModuleLoadRector::class);
$rectorConfig->rule(DrupalRector\Drupal9\Rector\Deprecation\ModuleLoadRector::class);
};
13 changes: 13 additions & 0 deletions phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ parameters:
count: 1
path: src/Drupal8/Rector/Deprecation/EntityLoadRector.php

-
message: "#^Parameter \\#1 \\$items of class PhpParser\\\\Node\\\\Expr\\\\Array_ constructor expects array\\<PhpParser\\\\Node\\\\ArrayItem\\>, array\\<int, PhpParser\\\\Node\\\\Expr\\\\ArrayItem\\> given\\.$#"
count: 1
path: src/Drupal8/Rector/Deprecation/EntityLoadRector.php

-
message: "#^Access to an undefined property PhpParser\\\\Node\\\\Expr\\:\\:\\$expr\\.$#"
count: 2
Expand Down Expand Up @@ -109,3 +114,11 @@ parameters:
message: "#^Call to an undefined method PHPStan\\\\Type\\\\Type\\:\\:getValue\\(\\)\\.$#"
count: 1
path: src/Drupal9/Rector/Deprecation/ExtensionPathRector.php

-
message: """
#^Fetching deprecated class constant REMOVE_NODE of class PhpParser\\\\NodeTraverser\\:
Use NodeVisitor\\:\\:REMOVE_NODE instead\\.$#
"""
count: 1
path: src/Drupal9/Rector/Deprecation/PassRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rule(\DrupalRector\Drupal8\Rector\Deprecation\FunctionalTestDefaultThemePropertyRector::class);
$rectorConfig->rule(DrupalRector\Drupal8\Rector\Deprecation\FunctionalTestDefaultThemePropertyRector::class);
};
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
use Rector\Config\RectorConfig;

return static function (RectorConfig $rectorConfig): void {
$rectorConfig->rule(\DrupalRector\Drupal9\Rector\Property\ProtectedStaticModulesPropertyRector::class);
$rectorConfig->rule(DrupalRector\Drupal9\Rector\Property\ProtectedStaticModulesPropertyRector::class);
};