From 913d365a0853e1558eb87db5b54403dc62616156 Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Thu, 9 Mar 2017 11:49:41 +0100 Subject: [PATCH 1/2] TASK: Improve documentation * Provide basic usage. * Provide what's included. --- Readme.rst | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) diff --git a/Readme.rst b/Readme.rst index 50a98b1..8640a98 100644 --- a/Readme.rst +++ b/Readme.rst @@ -19,9 +19,34 @@ Run:: make install -Copy the ``vendor/composer/autoload_classaliasmap.php`` generated by ``composer`` in your TYPO3 installation to ``LegacyClassnames.php`` in the root of this project. +and copy the ``vendor/composer/autoload_classaliasmap.php`` generated by ``composer`` in your TYPO3 +installation to ``LegacyClassnames.php`` in the root of this project. Usage ===== -Will follow. +Run:: + + ./vendor/bin/phpcbf + +This will run the auto fixer recursive for ```` fixing all issues. + +Afterwards you should run:: + + ./vendor/bin/phpcs + +To get information about possible issues that were not autofixed. + +What's included? +================ + +Currently we can migrate calls to old legacy class names of the TYPO3 core like ``Tx_Extbase...`` to +new ones like ``\TYPO3\Extbase\...``. This is done for: + +- PHPDocuments, like Includes and annotations for IDEs. + +- Inheritance like ``extends`` and ``implements``. + +- Static calls like ``t3lib_div::`` to ``\TYPO3\Core\Utility\GeneralUtility``. + +- Typehints in methods and function like injects. From 7748d46c1dd5302aa1926eaf04674722073cc73b Mon Sep 17 00:00:00 2001 From: Daniel Siepmann Date: Thu, 9 Mar 2017 11:57:49 +0100 Subject: [PATCH 2/2] FEATURE: Provide a "preview" * To let other know whether its helpful for them --- Readme.rst | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/Readme.rst b/Readme.rst index 8640a98..228c3b6 100644 --- a/Readme.rst +++ b/Readme.rst @@ -50,3 +50,34 @@ new ones like ``\TYPO3\Extbase\...``. This is done for: - Static calls like ``t3lib_div::`` to ``\TYPO3\Core\Utility\GeneralUtility``. - Typehints in methods and function like injects. + + +What does it look like? +======================= + +.. code:: + + $ ./vendor/bin/phpcs -p --colors -s + E + + + FILE: + ---------------------------------------------------------------------- + FOUND 5 ERRORS AFFECTING 5 LINES + ---------------------------------------------------------------------- + 8 | ERROR | [x] Legacy classes are not allowed; found + | | backend_toolbarItem + | | (Typo3Update.LegacyClassnames.Inheritance.legacyClassname) + 14 | ERROR | [x] Legacy classes are not allowed; found TYPO3backend + | | (Typo3Update.LegacyClassnames.DocComment.legacyClassname) + 16 | ERROR | [x] Legacy classes are not allowed; found TYPO3backend + | | (Typo3Update.LegacyClassnames.TypeHint.legacyClassname) + 48 | ERROR | [x] Legacy classes are not allowed; found t3lib_extMgm + | | (Typo3Update.LegacyClassnames.StaticCall.legacyClassname) + 61 | ERROR | [x] Legacy classes are not allowed; found t3lib_div + | | (Typo3Update.LegacyClassnames.StaticCall.legacyClassname) + ---------------------------------------------------------------------- + PHPCBF CAN FIX THE 5 MARKED SNIFF VIOLATIONS AUTOMATICALLY + ---------------------------------------------------------------------- + + Time: 35ms; Memory: 5Mb