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

[Example Config] Use class reference instead of self:: on code example config to ease copy paste config #6037

Merged
merged 2 commits into from
Jun 26, 2024

Conversation

samsonasik
Copy link
Member

@samsonasik samsonasik commented Jun 26, 2024

Ref #6035 (review) as they are public constant to copy on configure rector, something like:

    $rectorConfig
        ->ruleWithConfiguration(BooleanInTernaryOperatorRuleFixerRector::class, [
-            self::TREAT_AS_NON_EMPTY => false,
+            BooleanInTernaryOperatorRuleFixerRector::TREAT_AS_NON_EMPTY => false,
        ]);

self just pointed to invalid target class on rector config.

@samsonasik
Copy link
Member Author

All checks have passed 🎉 @TomasVotruba I am merging it ;)

@samsonasik samsonasik merged commit 421f74a into main Jun 26, 2024
35 checks passed
@samsonasik samsonasik deleted the use-class-self branch June 26, 2024 04:06
@TomasVotruba
Copy link
Member

We'll have to fix this in the tool, not enforce it here:)
Could you revert and fix it?

@samsonasik
Copy link
Member Author

samsonasik commented Jun 26, 2024

I don't understand, what tool? There is no example in generarted documentation now, in the past, we have example config in generated documentation, and that feature removed on symplify doc generator, so currently, user only can see example by read the config in the rules, so copy paste from there is needed to symplify DX

@samsonasik
Copy link
Member Author

Reverting at #6038 btw, but I need explanation for this, as this was used for DX

@TomasVotruba
Copy link
Member

Thanks 👍

I think we should solve this in the documentation, as other projects do. I rarely copy-paste any code from other projects internals. It's either documented or never used.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants