Skip to content

Conversation

@samsonasik
Copy link
Member

@samsonasik samsonasik commented May 12, 2025

@marcelthole here I cherry-picked your commits from PR:

as an alternative PR, this utilize DynamicSourceLocatorProvider which verify target is on the Reflector which use of paths defined in configuration.

The StatusEnum needs to be moved to Source so it marked as "outside" Fixture so be skipped from change.
This on unit test, I add includeFixtureDirectoryAsSource flag so defined PHP classes in Fixture directory can be load when set.

Closes #6890

@samsonasik
Copy link
Member Author

@marcelthole @TomasVotruba All checks have passed 🎉 🎉 🎉 I think it is ready ;)

@samsonasik samsonasik force-pushed the alternative-pascal-case-enum-names branch from 22495d0 to 10ce326 Compare May 14, 2025 22:28
@samsonasik
Copy link
Member Author

Rebased and cleaned up use of BetterReflection classes usage 10ce326 👍

@samsonasik samsonasik force-pushed the alternative-pascal-case-enum-names branch from 10ce326 to 97995f7 Compare May 18, 2025 10:35
@samsonasik
Copy link
Member Author

Rebased and cleaned up unnecessary manual reset as already in setUp() as DynamicSourceLocatorProvider already on ResetableInterface 97995f7

@samsonasik
Copy link
Member Author

Rebased 👍

@samsonasik samsonasik force-pushed the alternative-pascal-case-enum-names branch from 26bda34 to 80a0d0b Compare May 27, 2025 03:19
@samsonasik
Copy link
Member Author

@marcelthole @boesing I added failing new test for use of ->withAutoloadPaths()

80a0d0b#diff-9c0f8fca70b157b9f8b24c57101088a00f86f370940d68c4d595544d5dee22ff

as withAutoloadPaths() adds to DynamicSourceLocatorDecorator, use of DynamicSourceLocatorDecorator become invalid, it seems it needs to check on paths as fallback

@samsonasik samsonasik force-pushed the alternative-pascal-case-enum-names branch from cd5cc16 to 9ac254c Compare May 27, 2025 04:09
@samsonasik
Copy link
Member Author

Fixed with verify that target path is part of autoload paths as fallback 9ac254c

@samsonasik
Copy link
Member Author

@marcelthole @boesing I talked with @TomasVotruba today, and it is ok to merge it as is :)

This rule is not part of any set, so after the merge, you can try dev-main:

composer config minimum-stability dev
composer config prefer-stable true
composer update rector/rector:dev-main

and register manually:

<?php

declare(strict_types=1);

use Rector\CodingStyle\Rector\Enum_\EnumCaseToPascalCaseRector;
use Rector\Config\RectorConfig;

return RectorConfig::configure()
     // other config here...
    ->withRules([EnumCaseToPascalCaseRector::class]);

@samsonasik samsonasik merged commit a099fd5 into main May 27, 2025
45 checks passed
@samsonasik samsonasik deleted the alternative-pascal-case-enum-names branch May 27, 2025 11:30
@github-actions
Copy link
Contributor

This pull request has been automatically locked because it has been closed for 150 days. Please open a new PR if you want to continue the work.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Nov 29, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants