-
-
Notifications
You must be signed in to change notification settings - Fork 364
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[CodeQuality] Skip CallableThisArrayToAnonymousFunctionRector when in…
…side of Attribute (#2212) * [CodeQuality] Skip CallableThisArrayToAnonymousFunctionRector when inside of Attribute * Fixed 🎉
- Loading branch information
1 parent
1c828ee
commit 992d1ef
Showing
3 changed files
with
41 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
...ector/Array_/CallableThisArrayToAnonymousFunctionRector/Fixture/skip_in_attribute.php.inc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<?php | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector\Fixture; | ||
|
||
use Rector\Tests\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector\Source\LocaleUtils; | ||
|
||
class SkipInAttribute | ||
{ | ||
#[Assert\Choice(callback: [LocaleUtils::class, 'getAllLocales'])] | ||
private ?string $locale = null; | ||
|
||
public function getLocale(): ?string | ||
{ | ||
return $this->locale; | ||
} | ||
|
||
public function setLocale(?string $locale): Account | ||
{ | ||
$this->locale = $locale; | ||
return $this; | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
...deQuality/Rector/Array_/CallableThisArrayToAnonymousFunctionRector/Source/LocaleUtils.php
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Rector\Tests\CodeQuality\Rector\Array_\CallableThisArrayToAnonymousFunctionRector\Source; | ||
|
||
class LocaleUtils | ||
{ | ||
public static function getAllLocales(): array | ||
{ | ||
return true; | ||
} | ||
} |