Updated Rector to commit 1d7208b816e8c12d7732a2d633b44d8e8bc0041e

1d7208b816 feat: add Behat annotations to attributes set (#6510)
This commit is contained in:
Tomas Votruba 2024-11-25 14:55:56 +00:00
parent c5a315e2c4
commit a6f87828b7
4 changed files with 21 additions and 3 deletions

View File

@ -0,0 +1,11 @@
<?php
declare (strict_types=1);
namespace RectorPrefix202411;
use Rector\Config\RectorConfig;
use Rector\Php80\Rector\Class_\AnnotationToAttributeRector;
use Rector\Php80\ValueObject\AnnotationToAttribute;
return static function (RectorConfig $rectorConfig) : void {
$rectorConfig->ruleWithConfiguration(AnnotationToAttributeRector::class, [new AnnotationToAttribute('Given', 'Behat\\Step\\Given', [], \true), new AnnotationToAttribute('When', 'Behat\\Step\\When', [], \true), new AnnotationToAttribute('Then', 'Behat\\Step\\Then', [], \true), new AnnotationToAttribute('BeforeSuite', 'Behat\\Hook\\BeforeSuite', [], \true), new AnnotationToAttribute('AfterSuite', 'Behat\\Hook\\AfterSuite', [], \true), new AnnotationToAttribute('BeforeFeature', 'Behat\\Hook\\BeforeFeature', [], \true), new AnnotationToAttribute('AfterFeature', 'Behat\\Hook\\AfterFeature', [], \true), new AnnotationToAttribute('BeforeScenario', 'Behat\\Hook\\BeforeScenario', [], \true), new AnnotationToAttribute('AfterScenario', 'Behat\\Hook\\AfterScenario', [], \true), new AnnotationToAttribute('BeforeStep', 'Behat\\Hook\\BeforeStep', [], \true), new AnnotationToAttribute('AfterStep', 'Behat\\Hook\\AfterStep', [], \true)]);
};

View File

@ -19,12 +19,12 @@ final class VersionResolver
* @api
* @var string
*/
public const PACKAGE_VERSION = '12b471059bc5717e3f87cf1e811f05396e3571cf';
public const PACKAGE_VERSION = '1d7208b816e8c12d7732a2d633b44d8e8bc0041e';
/**
* @api
* @var string
*/
public const RELEASE_DATE = '2024-11-25 21:20:15';
public const RELEASE_DATE = '2024-11-25 15:53:11';
/**
* @var int
*/

View File

@ -315,7 +315,7 @@ final class RectorConfigBuilder
/**
* Upgrade your annotations to attributes
*/
public function withAttributesSets(bool $symfony = \false, bool $doctrine = \false, bool $mongoDb = \false, bool $gedmo = \false, bool $phpunit = \false, bool $fosRest = \false, bool $jms = \false, bool $sensiolabs = \false, bool $all = \false) : self
public function withAttributesSets(bool $symfony = \false, bool $doctrine = \false, bool $mongoDb = \false, bool $gedmo = \false, bool $phpunit = \false, bool $fosRest = \false, bool $jms = \false, bool $sensiolabs = \false, bool $behat = \false, bool $all = \false) : self
{
// if nothing is passed, enable all as convention in other method
if (\func_get_args() === []) {
@ -345,6 +345,9 @@ final class RectorConfigBuilder
if ($sensiolabs || $all) {
$this->sets[] = SensiolabsSetList::ANNOTATIONS_TO_ATTRIBUTES;
}
if ($behat || $all) {
$this->sets[] = SetList::BEHAT_ANNOTATIONS_TO_ATTRIBUTES;
}
return $this;
}
/**

View File

@ -123,4 +123,8 @@ final class SetList
* @var string
*/
public const CARBON = __DIR__ . '/../../../config/set/datetime-to-carbon.php';
/**
* @var string
*/
public const BEHAT_ANNOTATIONS_TO_ATTRIBUTES = __DIR__ . '/../../../config/set/behat-annotations-to-attributes.php';
}