Skip to content

Commit

Permalink
feat(rector): add ChangeMethodVisibilityRector configuration
Browse files Browse the repository at this point in the history
- Added configuration for ChangeMethodVisibilityRector.
- Changed visibility of 'preConfigureOptionsResolver' method in HasOptions class to PROTECTED.
- This change improves encapsulation and adheres to best practices for method visibility.
  • Loading branch information
guanguans committed Aug 21, 2024
1 parent 180e2ff commit e38428d
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
use Ergebnis\Rector\Rules\Arrays\SortAssociativeArrayByKeyRector;
use Guanguans\Notify\Foundation\Concerns\AsJson;
use Guanguans\Notify\Foundation\Concerns\AsPost;
use Guanguans\Notify\Foundation\Concerns\HasOptions;
use Guanguans\Notify\Foundation\Rectors\HasHttpClientDocCommentRector;
use Guanguans\Notify\Foundation\Rectors\HasOptionsDocCommentRector;
use Guanguans\Notify\Foundation\Rectors\ToInternalExceptionRector;
Expand Down Expand Up @@ -43,6 +44,9 @@
use Rector\Transform\Rector\String_\StringToClassConstantRector;
use Rector\Transform\ValueObject\StringToClassConstant;
use Rector\ValueObject\PhpVersion;
use Rector\ValueObject\Visibility;
use Rector\Visibility\Rector\ClassMethod\ChangeMethodVisibilityRector;
use Rector\Visibility\ValueObject\ChangeMethodVisibility;

return static function (RectorConfig $rectorConfig): void {
// \define('MHASH_XXH3', 2 << 0);
Expand Down Expand Up @@ -191,6 +195,10 @@
),
);

$rectorConfig->ruleWithConfiguration(ChangeMethodVisibilityRector::class, [
new ChangeMethodVisibility(HasOptions::class, 'preConfigureOptionsResolver', Visibility::PROTECTED),
]);

$rectorConfig->ruleWithConfiguration(RemoveTraitUseRector::class, [
AsJson::class,
AsPost::class,
Expand Down

0 comments on commit e38428d

Please sign in to comment.