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

Hotfix: New rector FILE_STATUS_PERMANENT was not added to deprecation list. … #280

Merged
merged 2 commits into from
Dec 28, 2023
Merged
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
13 changes: 8 additions & 5 deletions config/drupal-9/drupal-9.3-deprecations.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

declare(strict_types=1);

use DrupalRector\Drupal8\Rector\Deprecation\ConstantToClassConstantRector;
use DrupalRector\Drupal8\Rector\ValueObject\ConstantToClassConfiguration;
use DrupalRector\Drupal9\Rector\Deprecation\ExtensionPathRector;
use DrupalRector\Drupal9\Rector\Deprecation\FileBuildUriRector;
Expand Down Expand Up @@ -69,9 +70,11 @@
]);

// Change record: https://www.drupal.org/node/3022147
new ConstantToClassConfiguration(
'FILE_STATUS_PERMANENT',
'Drupal\file\FileInterface',
'STATUS_PERMANENT',
);
$rectorConfig->ruleWithConfiguration(ConstantToClassConstantRector::class, [
new ConstantToClassConfiguration(
'FILE_STATUS_PERMANENT',
'Drupal\file\FileInterface',
'STATUS_PERMANENT',
),
]);
};
2 changes: 1 addition & 1 deletion src/Drupal10/Rector/Deprecation/SystemTimeZonesRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class SystemTimeZonesRector extends AbstractDrupalCoreRector
protected array $configuration;

/**
* @var \Rector\Core\PhpParser\Node\Value\ValueResolver
* @var ValueResolver
*/
private ValueResolver $valueResolver;

Expand Down
2 changes: 1 addition & 1 deletion src/Drupal8/Rector/Deprecation/DBRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class DBRector extends AbstractRector implements ConfigurableRectorInterface
private array $configuration;

/**
* @var \DrupalRector\Services\AddCommentService
* @var AddCommentService
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My understanding is that @var descriptions should use the full class path, so I don't understand these changes.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

*/
private AddCommentService $commentService;

Expand Down
2 changes: 1 addition & 1 deletion src/Drupal8/Rector/Deprecation/DrupalSetMessageRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ final class DrupalSetMessageRector extends AbstractRector
use FindParentByTypeTrait;

/**
* @var \DrupalRector\Services\AddCommentService
* @var AddCommentService
*/
private AddCommentService $commentService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
final class EntityInterfaceLinkRector extends AbstractRector
{
/**
* @var \DrupalRector\Services\AddCommentService
* @var AddCommentService
*/
private AddCommentService $commentService;

Expand Down
2 changes: 1 addition & 1 deletion src/Drupal8/Rector/Deprecation/EntityLoadRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ final class EntityLoadRector extends AbstractRector implements ConfigurableRecto
protected array $entityTypes;

/**
* @var \DrupalRector\Services\AddCommentService
* @var AddCommentService
*/
private AddCommentService $commentService;

Expand Down
2 changes: 1 addition & 1 deletion src/Drupal8/Rector/Deprecation/EntityManagerRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ final class EntityManagerRector extends AbstractRector
protected $parentClassScopeResolver;

/**
* @var \DrupalRector\Services\AddCommentService
* @var AddCommentService
*/
private AddCommentService $commentService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
final class FunctionalTestDefaultThemePropertyRector extends AbstractScopeAwareRector
{
/**
* @var \Rector\BetterPhpDocParser\PhpDocInfo\PhpDocInfoFactory
* @var PhpDocInfoFactory
*/
private PhpDocInfoFactory $phpDocInfoFactory;

/**
* @var \Rector\Core\PhpParser\Node\Value\ValueResolver
* @var ValueResolver
*/
private ValueResolver $valueResolver;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ final class LinkGeneratorTraitLRector extends AbstractRector
use FindParentByTypeTrait;

/**
* @var \DrupalRector\Services\AddCommentService
* @var AddCommentService
*/
private AddCommentService $commentService;

Expand Down
2 changes: 1 addition & 1 deletion src/Drupal9/Rector/Deprecation/AssertLegacyTraitRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class AssertLegacyTraitRector extends AbstractRector implements ConfigurableRect
private array $assertLegacyTraitMethods;

/**
* @var \DrupalRector\Services\AddCommentService
* @var AddCommentService
*/
private AddCommentService $commentService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ final class AssertNoFieldByNameRector extends AbstractRector
protected string $comment = 'Verify the assertion: buttonNotExists() if this is for a button.';

/**
* @var \DrupalRector\Services\AddCommentService
* @var AddCommentService
*/
private AddCommentService $commentService;

Expand Down
2 changes: 1 addition & 1 deletion src/Drupal9/Rector/Deprecation/ExtensionPathRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ExtensionPathRector extends AbstractRector implements ConfigurableRectorIn
private array $configuration;

/**
* @var \DrupalRector\Services\AddCommentService
* @var AddCommentService
*/
private AddCommentService $commentService;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public function getNodeTypes(): array
/**
* @param \PhpParser\Node\Expr\MethodCall $node
*
* @throws \Rector\Core\Exception\ShouldNotHappenException
* @throws ShouldNotHappenException
*
* @return array<int, ?\PhpParser\Node\Arg>
*/
Expand Down
2 changes: 1 addition & 1 deletion src/Rector/Deprecation/MethodToMethodWithCheckRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ class MethodToMethodWithCheckRector extends AbstractRector implements Configurab
private array $configuration;

/**
* @var \DrupalRector\Services\AddCommentService
* @var AddCommentService
*/
private AddCommentService $commentService;

Expand Down
4 changes: 2 additions & 2 deletions src/Rector/PHPUnit/ShouldCallParentMethodsRector.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ public function getNodeTypes(): array
/**
* @phpstan-param Node\Stmt\ClassMethod $node
*
* @param \PhpParser\Node $node
* @param \PHPStan\Analyser\Scope $scope
* @param Node $node
* @param Scope $scope
*
* @return \PhpParser\Node|null
*/
Expand Down
12 changes: 4 additions & 8 deletions tests/src/Rector/Deprecation/DeprecationBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,10 @@ class DeprecationBase
/**
* Adds a class to a test.
*
* @param string $rectorClass
* The class being tested
* @param \Rector\Config\RectorConfig $rectorConfig
* The Rector Config handler
* @param bool $add_config
* Indicates that config should be added to the test
* @param array $configuration
* Configuration for the configured rule
* @param string $rectorClass The class being tested
* @param RectorConfig $rectorConfig The Rector Config handler
* @param bool $add_config Indicates that config should be added to the test
* @param array $configuration Configuration for the configured rule
*/
public static function addClass(string $rectorClass, RectorConfig $rectorConfig, bool $add_notice_config = true, array $configuration = [])
{
Expand Down