Replies: 1 comment 8 replies
-
Hi, for working with class names and file names, check PSR4 rules: https://github.com/rectorphp/rector-src/tree/main/rules/PSR4/Rector You'll have to create custom rule, that moves around your files the specific way. |
Beta Was this translation helpful? Give feedback.
8 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi!
I'm playing with Rector on some of my older WordPress projects, where I've used WordPress coding standards. That means that the class has to be named using underscores like
Some_Class_Name
and has to be in the file calledclass-some-class-name.php
.Now, I'd like to change this to fit in PSR-4 autoloading that is
SomeClassName
would be in theSomeClassName.php
. The classes are split into one class per file, and they do follow the structure that the namespace follows the file structure like in PSR-4.Is it possible to target partial class names and files so that they match? Is it possible to get the class names as arguments inside the
configure
method?Beta Was this translation helpful? Give feedback.
All reactions