@@ -76,6 +76,7 @@ final class FixerFactory
7676 public static function createFor (string $ launchFile ): Config
7777 {
7878 $ workingDir = dirname ($ launchFile );
79+ $ testsPath = $ workingDir . DIRECTORY_SEPARATOR . 'tests ' . DIRECTORY_SEPARATOR ;
7980
8081 self ::setHeaderFrom ($ launchFile );
8182
@@ -114,9 +115,8 @@ public static function createFor(string $launchFile): Config
114115 self ::$ rules ['Polymorphine/declare_strict_first_line ' ] = true ;
115116 self ::$ rules ['Polymorphine/brace_after_multiline_param_method ' ] = true ;
116117
117- $ excludeSamples = function (SplFileInfo $ file ) use ($ workingDir ) {
118+ $ excludeSamples = function (SplFileInfo $ file ) use ($ testsPath ) {
118119 $ filePath = $ file ->getPath ();
119- $ testsPath = $ workingDir . DIRECTORY_SEPARATOR . 'tests ' . DIRECTORY_SEPARATOR ;
120120 $ samplesDir = DIRECTORY_SEPARATOR . 'code-samples ' . DIRECTORY_SEPARATOR ;
121121 return strpos ($ filePath , $ testsPath ) !== 0 || strpos ($ filePath , $ samplesDir ) === false ;
122122 };
@@ -130,7 +130,7 @@ public static function createFor(string $launchFile): Config
130130 ->registerCustomFixers ([
131131 new Fixer \DoubleLineBeforeClassDefinitionFixer (),
132132 new Fixer \NoTrailingCommaInMultilineArrayFixer (),
133- new Fixer \MultiOrderedClassElementsFixer ($ srcOrder , $ testOrder ),
133+ new Fixer \MultiOrderedClassElementsFixer ($ testsPath , $ srcOrder , $ testOrder ),
134134 new Fixer \NamedConstructorsFirstStaticFixer (),
135135 new Fixer \AlignedMethodChainFixer (),
136136 new Fixer \AlignedAssignmentsFixer (),
0 commit comments