diff --git a/.gitlab/merge_request_templates/default.md b/.gitlab/merge_request_templates/default.md new file mode 100644 index 0000000..67ad892 --- /dev/null +++ b/.gitlab/merge_request_templates/default.md @@ -0,0 +1,6 @@ +* Write some info about what has been done. +* Also don't forget to mention why this has been done, e.g. introduced new + feature? + +Resolves: #IssueNumber + diff --git a/Documentation/source/configuration.rst b/Documentation/source/configuration.rst index 5b5b458..cf33c5b 100644 --- a/Documentation/source/configuration.rst +++ b/Documentation/source/configuration.rst @@ -311,3 +311,29 @@ Two examples:: new HRULER: replacement: 'Any installation should migrate to alternatives such as F...' docsUrl: 'https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog...' + +Features +^^^^^^^^ + +Configures which Features should be attached to x Sniffs, where Key is the FQCN of the feature and +the values are FQCN of the sniffs. + +Works only if the sniff respects execution of features. + +One example:: + + Typo3Update\Feature\LegacyClassnameFeature: + - Typo3Update_Sniffs_Classname_InheritanceSniff + - Typo3Update_Sniffs_Classname_InlineCommentSniff + - Typo3Update_Sniffs_Classname_InstanceofSniff + - Typo3Update_Sniffs_Classname_InstantiationWithMakeInstanceSniff + - Typo3Update_Sniffs_Classname_InstantiationWithNewSniff + - Typo3Update_Sniffs_Classname_InstantiationWithObjectManagerSniff + - Typo3Update_Sniffs_Classname_IsACallSniff + - Typo3Update_Sniffs_Classname_MissingVendorForPluginsAndModulesSniff + - Typo3Update_Sniffs_Classname_PhpDocCommentSniff + - Typo3Update_Sniffs_Classname_StaticCallSniff + - Typo3Update_Sniffs_Classname_TypeHintCatchExceptionSniff + - Typo3Update_Sniffs_Classname_TypeHintSniff + - Typo3Update_Sniffs_Classname_UseSniff + - Typo3Update_Sniffs_LegacyClassname_MissingNamespaceSniff diff --git a/Documentation/source/features.rst b/Documentation/source/features.rst index 89531eb..8e8f021 100644 --- a/Documentation/source/features.rst +++ b/Documentation/source/features.rst @@ -15,7 +15,7 @@ Possible configurations for all sniffs: Implemented sniffs: -- PHPDocuments, like Includes and annotations for IDEs. +- PHPDocComments, like Includes and annotations for IDEs. Possible extra configurations: @@ -106,6 +106,16 @@ functions. For configuration options see :ref:`configuration-removedConstantConf Check for usage of *removed signals*. The signals are configured in same way as removed functions. For configuration options see :ref:`configuration-removedSignalConfigFiles`. +Check for usage of *removed TypoScript*. The TypoScript objects are configured in same way as +removed functions. For configuration options see :ref:`configuration-removedTypoScriptConfigFiles`. +This will check whether you are using already removed TypoScript parts, supported are: + +- Objects, e.g. ``CLEARGIF``, ``FORM`` + +- Paths like ``styles.insertContent`` + +For a complete list, take a look at the corresponding YAML-Files. + Further checks -------------- diff --git a/tests/Fixtures/Standards/Typo3Update/Sniffs/Classname.php b/tests/Fixtures/Standards/Typo3Update/Sniffs/Classname.php new file mode 100644 index 0000000..ca3784e --- /dev/null +++ b/tests/Fixtures/Standards/Typo3Update/Sniffs/Classname.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class InlineCommentSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/InheritanceSniffTest.php b/tests/Sniffs/Classname/InheritanceSniffTest.php new file mode 100644 index 0000000..56c8bcb --- /dev/null +++ b/tests/Sniffs/Classname/InheritanceSniffTest.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class InheritanceSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/InlineCommentSniffTest.php b/tests/Sniffs/Classname/InlineCommentSniffTest.php new file mode 100644 index 0000000..ca3784e --- /dev/null +++ b/tests/Sniffs/Classname/InlineCommentSniffTest.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class InlineCommentSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/InstanceofSniffTest.php b/tests/Sniffs/Classname/InstanceofSniffTest.php new file mode 100644 index 0000000..49f9210 --- /dev/null +++ b/tests/Sniffs/Classname/InstanceofSniffTest.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class InstanceofSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/InstantiationWithMakeInstanceSniffTest.php b/tests/Sniffs/Classname/InstantiationWithMakeInstanceSniffTest.php new file mode 100644 index 0000000..a54ab8f --- /dev/null +++ b/tests/Sniffs/Classname/InstantiationWithMakeInstanceSniffTest.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class InstantiationWithMakeInstanceSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/InstantiationWithNewSniffTest.php b/tests/Sniffs/Classname/InstantiationWithNewSniffTest.php new file mode 100644 index 0000000..3c07834 --- /dev/null +++ b/tests/Sniffs/Classname/InstantiationWithNewSniffTest.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class InstantiationWithNewSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/InstantiationWithObjectManagerSniffTest.php b/tests/Sniffs/Classname/InstantiationWithObjectManagerSniffTest.php new file mode 100644 index 0000000..c2348bf --- /dev/null +++ b/tests/Sniffs/Classname/InstantiationWithObjectManagerSniffTest.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class InstantiationWithObjectManagerSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/IsACallSniffTest.php b/tests/Sniffs/Classname/IsACallSniffTest.php new file mode 100644 index 0000000..6930ddf --- /dev/null +++ b/tests/Sniffs/Classname/IsACallSniffTest.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class IsACallSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/PhpDocCommentSniffTest.php b/tests/Sniffs/Classname/PhpDocCommentSniffTest.php new file mode 100644 index 0000000..fb7fa8c --- /dev/null +++ b/tests/Sniffs/Classname/PhpDocCommentSniffTest.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class PhpDocCommentSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/StaticCallSniffTest.php b/tests/Sniffs/Classname/StaticCallSniffTest.php new file mode 100644 index 0000000..e3b5faa --- /dev/null +++ b/tests/Sniffs/Classname/StaticCallSniffTest.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class StaticCallSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/TypeHintCatchExceptionSniffTest.php b/tests/Sniffs/Classname/TypeHintCatchExceptionSniffTest.php new file mode 100644 index 0000000..a7d14b9 --- /dev/null +++ b/tests/Sniffs/Classname/TypeHintCatchExceptionSniffTest.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class TypeHintCatchExceptionSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/TypeHintSniffTest.php b/tests/Sniffs/Classname/TypeHintSniffTest.php new file mode 100644 index 0000000..e8c1637 --- /dev/null +++ b/tests/Sniffs/Classname/TypeHintSniffTest.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class TypeHintSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Classname/UseSniffTest.php b/tests/Sniffs/Classname/UseSniffTest.php new file mode 100644 index 0000000..ee03896 --- /dev/null +++ b/tests/Sniffs/Classname/UseSniffTest.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class UseSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Deprecated/AjaxRegistrationTest.php b/tests/Sniffs/Deprecated/AjaxRegistrationTest.php new file mode 100644 index 0000000..b67c1ec --- /dev/null +++ b/tests/Sniffs/Deprecated/AjaxRegistrationTest.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class AjaxRegistrationSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/LegacyClassname/MissingNamespaceSniffTest.php b/tests/Sniffs/LegacyClassname/MissingNamespaceSniffTest.php new file mode 100644 index 0000000..07239dc --- /dev/null +++ b/tests/Sniffs/LegacyClassname/MissingNamespaceSniffTest.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class MissingNamespaceSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/LegacyClassname/MissingVendorForPluginsAndModulesSniffTest.php b/tests/Sniffs/LegacyClassname/MissingVendorForPluginsAndModulesSniffTest.php new file mode 100644 index 0000000..d73ca67 --- /dev/null +++ b/tests/Sniffs/LegacyClassname/MissingVendorForPluginsAndModulesSniffTest.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class MissingVendorForPluginsAndModulesSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Removed/GenericConstantUsageSniffTest.php b/tests/Sniffs/Removed/GenericConstantUsageSniffTest.php new file mode 100644 index 0000000..c955042 --- /dev/null +++ b/tests/Sniffs/Removed/GenericConstantUsageSniffTest.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class GenericConstantUsageSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Removed/GenericFunctionCallSniffTest.php b/tests/Sniffs/Removed/GenericFunctionCallSniffTest.php new file mode 100644 index 0000000..a0176b8 --- /dev/null +++ b/tests/Sniffs/Removed/GenericFunctionCallSniffTest.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class GenericFunctionCallSniffTest extends SniffsTest +{ +} diff --git a/tests/Sniffs/Removed/TypoScriptSniffTest.php b/tests/Sniffs/Removed/TypoScriptSniffTest.php new file mode 100644 index 0000000..f7f91cc --- /dev/null +++ b/tests/Sniffs/Removed/TypoScriptSniffTest.php @@ -0,0 +1,28 @@ + + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA + * 02110-1301, USA. + */ + +use Typo3Update\Tests\SniffsTest; + +class TypoScriptSniffTest extends SniffsTest +{ +} diff --git a/tests/SniffsTest.php b/tests/SniffsTest.php index 9f7a3b9..39f5ac4 100644 --- a/tests/SniffsTest.php +++ b/tests/SniffsTest.php @@ -29,7 +29,7 @@ use Symfony\Component\Finder\Finder; * * To add a test, just create the necessary fixture folder structure with files. */ -class SniffsTest extends TestCase +abstract class SniffsTest extends TestCase { /** * Get all fixtures for sniffs. @@ -61,16 +61,20 @@ class SniffsTest extends TestCase public function getSniffs() { $sniffs = []; - $finder = new Finder(); - $finder->in( - __DIR__ - . DIRECTORY_SEPARATOR . 'Fixtures' - . DIRECTORY_SEPARATOR . 'Standards' - . DIRECTORY_SEPARATOR . 'Typo3Update' - . DIRECTORY_SEPARATOR . 'Sniffs' - ); - foreach ($finder->directories()->name('*Sniff') as $folder) { + $classnameParts = array_slice(explode('\\', get_class($this)), 3); + $lastIndex = count($classnameParts) - 1; + $classnameParts[$lastIndex] = substr($classnameParts[$lastIndex], 0, -4); + $folderName = array_pop($classnameParts); + $folder = array_merge([ + __DIR__, + 'Fixtures', 'Standards', 'Typo3Update', 'Sniffs', + ], $classnameParts); + + $finder = new Finder(); + $finder->in(implode(DIRECTORY_SEPARATOR, $folder)); + + foreach ($finder->directories()->name($folderName) as $folder) { $sniff = [ $folder, [],