Compare commits

...

43 commits

Author SHA1 Message Date
Daniel Siepmann 65132780a5
Also mention TYPO3 rector project 2021-03-08 09:26:20 +01:00
Daniel Siepmann f23c740ecb
Merge pull request #69 from DanielSiepmann/feature/mention-new-project
TASK: Mention new project which should be used instead
2018-09-13 08:32:51 +02:00
Daniel Siepmann cf00e165b1
TASK: Mention new project which should be used instead 2018-09-13 08:31:16 +02:00
Daniel Siepmann 0d8ca01ae3 Merge branch 'feature/44-add-checks-for-deprecated-removed-extensions' into 'develop'
FEATURE: Add checks for deprecated/removed extensions

Closes #44

See merge request !70
2017-05-18 08:41:09 +02:00
Daniel Siepmann f5c609e57b
Merge remote-tracking branch 'origin/develop' into feature/44-add-checks-for-deprecated-removed-extensions 2017-05-18 08:39:04 +02:00
Daniel Siepmann 87cf3a3195
TASK: Do not check all classname parts for extension name
* As discussed in PR, fetch possible extension names and lookup only
  them, not all parts of class name.

Relates: #44, !70
2017-05-18 08:33:10 +02:00
Daniel Siepmann 41d5ec0dff
Merge remote-tracking branch 'origin/develop' into feature/44-add-checks-for-deprecated-removed-extensions 2017-05-16 16:29:14 +02:00
Daniel Siepmann e8e0b11df2 Merge branch 'feature/77-globals' into 'develop'
FEATURE: Globals

Closes #77

See merge request !90
2017-05-16 16:27:01 +02:00
Daniel Siepmann 180a8a77c2
Merge branch 'develop' into feature/77-globals 2017-05-16 16:24:33 +02:00
Daniel Hürtgen 0c91d7b22c Merge branch 'feature/15-check-all-possible-occurences-of-class' into 'develop'
FEATURE: Detect classes in strings

Closes #15 and #43

See merge request !84
2017-05-16 15:32:55 +02:00
Daniel Hürtgen 6be0de28d3 Update StringSniff.php 2017-05-16 15:05:54 +02:00
Daniel Siepmann f723d9a28b
TASK: Add missing mapping 2017-05-16 10:47:26 +02:00
Daniel Siepmann 7aafc28dbf
TASK: Fix broken test
Relates: #77
2017-05-09 15:55:43 +02:00
Daniel Siepmann 219103561e
TASK: Update docs
* To reflect new feature.

Relates: #77
2017-05-09 15:03:35 +02:00
Daniel Siepmann 4ac34503d1
FEATURE: Check removed globals
* Add feature, tests and configuration.
* Refactor to follow DRY, move prepareStructure to abstract.

Resolves: #77
2017-05-09 14:48:44 +02:00
Daniel Siepmann c1712d0bc5
TASK: Update docs
Relates: #44
2017-05-09 13:31:51 +02:00
Daniel Siepmann 640f85af7d
TASK: Update InheritanceSniff tests to reflect added removed extension
Relates: #44
2017-05-09 13:20:20 +02:00
Daniel Siepmann 84e4c426ef
TASK: Update InlineCommentSniff tests to reflect added removed extension
Relates: #44
2017-05-09 12:12:46 +02:00
Daniel Siepmann 27864c70a1
TASK: Update InstanceofSniff tests to reflect added removed extension
Relates: #44
2017-05-09 12:09:51 +02:00
Daniel Siepmann 8dd569a6a6
TASK: Update InstantiationWithMakeInstanceSniff tests
Relates: #44
2017-05-09 12:07:12 +02:00
Daniel Siepmann e3dd6013ba
BUGFIX: Look for argument only in current statement
* Just check T_STRING as this are all function calls.
* Remove unused line of code.
* Limit position to current statement to not return later classname
  multiple times.

Relates: #44
2017-05-09 12:05:54 +02:00
Daniel Siepmann 2894784978
TASK: Update InstantiationWithNewSniff tests
Relates: #44
2017-05-09 11:42:32 +02:00
Daniel Siepmann e2c972ed58
TASK: Update InstantiationWithObjectManagerSniff tests
Relates: #44
2017-05-09 11:39:59 +02:00
Daniel Siepmann d38ce3dc41
BUGFIX: Fix identifier for removed extension
* Due to copy and paste the identifier was not indicating a removed
  extension.
* Identifier and tests were adjusted accordingly.

Relates: #44
2017-05-09 11:33:55 +02:00
Daniel Siepmann 9b028d24e6
TASK: Update IsACallSniff tests to reflect added removed extension
Relates: #44
2017-05-09 11:31:15 +02:00
Daniel Siepmann 3503a5b63a
TASK: Update PhpDocCommentSniff tests to reflect added removed extension
Relates: #44
2017-05-09 11:25:54 +02:00
Daniel Siepmann af50ddfd99
TASK: Update StaticCallSniff tests to reflect added removed extension
* Also update getBefore method of AbstractClassnameChecker to make
  lookups before, like in StaticCallSniff work.

Relates: #44
2017-05-09 11:20:45 +02:00
Daniel Siepmann b32fc01110
TASK: Add test for TypeHintCatchExceptionSniff
* Check that the sniff works with new feature of removed extension.

Relates: #44
2017-05-09 10:55:17 +02:00
Daniel Siepmann fda1921d50
TASK: Refactor sniffs
* Move generic logic to abstract class.
* As not only UseSniff but also all others have the same logic, if
  method is not overwritten.
* Therefore all other sniffs should work with new feature of removed
  extension.

Relates: #44
2017-05-09 10:54:17 +02:00
Daniel Siepmann 3034f3fec4
FEATURE: Add removed extension to type hint sniff
* Integrate feature and adjust code as needed.
* We need to find the class names inside of type hints more accurate.
* Also tests need to cover the new feature.

Relates: #44
2017-05-09 10:34:58 +02:00
Daniel Siepmann 633a714043
FEATURE: Implement removed extension into use sniff.
* Detect removed extensions in use statements.

Relates: #44
2017-05-09 08:41:38 +02:00
Daniel Siepmann c7ddbc4aef
TASK: Finish removed extension test
* Adjust expected result to match result.
* Remove example usage of "use" as this is part of a feature and not
  this sniff.

Relates: #44
2017-05-09 08:35:58 +02:00
Daniel Siepmann 5adbac1a25
TASK: Implement basic structure
* Adjust to latest develop state of project.
* Provide basic implementation.

Relates: #44
2017-05-04 16:43:09 +02:00
Daniel Siepmann c7112c0fae
Merge remote-tracking branch 'origin/develop' into feature/44-add-checks-for-deprecated-removed-extensions 2017-05-04 16:04:51 +02:00
Daniel Siepmann 7a16dac529
FEATURE: Allow auto migration of classes in strings
* We now check class names case sensitive in strings.
* This will prevent issues with stuff like TCA, as class names mathing
  table names are written in lower case.
* Also add further tests and fix issues.
* Extend test to check that lower version is not replaced but mentioned
  as warning.
* Expected class names in Tx_ format are reported as fixable error.

Resolves: #15
2017-05-04 13:35:02 +02:00
Daniel Siepmann b69c262288
TASK: Improve tests and fix issues
* Configure code coverage for new tested class.
* Fix usage of class with new insensitivity lookup.
* Add further tests.
2017-05-04 12:46:39 +02:00
Daniel Siepmann 666bbdb26a
TASK: Add tests for mapping class
* Add minimum phpdoc.
* Add tests.
* Fix issue in class.
* Fix phpmd issues.
2017-05-04 11:58:49 +02:00
Daniel Siepmann 8db7a8bb1f
TASK: Split legacy mapping into two files
* One files is provided by us for TYPO3 mappings.
* Second one keeps as is and contains the generated mappings.

Relates: #43
2017-05-04 10:44:49 +02:00
Daniel Siepmann aa5cc51043
Merge branch 'feature/seperate-tests' into feature/15-check-all-possible-occurences-of-class 2017-05-04 08:41:23 +02:00
Daniel Siepmann 34bf941a21 Merge branch 'develop' into feature/15-check-all-possible-occurences-of-class 2017-05-04 08:21:37 +02:00
Daniel Siepmann f3448b088a
TASK: Add mention of feature to docs
Relates: #15
2017-05-02 11:58:21 +02:00
Daniel Siepmann afd6f78196
FEATURE: Detect classes in strings
* Detect class names in strings.
* Attach feature to new detection.
* Only add warnings for classes in strings, they might be table names.

Closes: #15
2017-05-02 11:52:42 +02:00
Daniel Hürtgen 4461e116db FEATURE: Test for removed extension key sniff added 2017-04-11 13:01:37 +02:00
75 changed files with 2560 additions and 4409 deletions

1
.gitignore vendored
View file

@ -1,4 +1,5 @@
/LegacyClassnames.php
/tests/Fixtures/LegacyClassnames.php
/composer.lock
/vendor/

View file

@ -233,6 +233,50 @@ Using ``runtime-set``:
--runtime-set removedClassConfigFiles "/Some/Absolute/Path/*.yaml"
.. _configuration-removedExtensionConfigFiles:
removedExtensionConfigFiles
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Configure where to look for configuration files defining the removed extensions. Default is
``Configuration/Removed/Extension/*.yaml`` inside the standard itself. We already try to deliver as
much as possible. Globing is used, so placeholders like ``*`` are possible, see
https://secure.php.net/manual/en/function.glob.php
Using :file:`ruleset.xml`:
.. code:: xml
<config name="removedExtensionConfigFiles" value="/Some/Absolute/Path/*.yaml"/>
Using ``runtime-set``:
.. code:: bash
--runtime-set removedExtensionConfigFiles "/Some/Absolute/Path/*.yaml"
.. _configuration-removedGlobalConfigFiles:
removedGlobalConfigFiles
^^^^^^^^^^^^^^^^^^^^^^^^
Configure where to look for configuration files defining the removed globals. Default is
``Configuration/Removed/Globals/*.yaml`` inside the standard itself. We already try to deliver as
much as possible. Globing is used, so placeholders like ``*`` are possible, see
https://secure.php.net/manual/en/function.glob.php
Using :file:`ruleset.xml`:
.. code:: xml
<config name="removedGlobalConfigFiles" value="/Some/Absolute/Path/*.yaml"/>
Using ``runtime-set``:
.. code:: bash
--runtime-set removedGlobalConfigFiles "/Some/Absolute/Path/*.yaml"
.. _configuration-removedTypoScriptConfigFiles:
removedTypoScriptConfigFiles

View file

@ -106,6 +106,12 @@ functions. For configuration options see :ref:`configuration-removedConstantConf
Check for usage of *removed PHP classes*. The classes are configured in same way as removed
functions. For configuration options see :ref:`configuration-removedClassConfigFiles`.
Check for usage of *removed PHP globals*. The globals are configured in same way as removed
functions. For configuration options see :ref:`configuration-removedGlobalConfigFiles`.
Check for usage of *removed TYPO3 extension*. For configuration options see
:ref:`configuration-removedExtensionConfigFiles`.
Check for usage of *removed signals*. The signals are configured in same way as removed
functions. For configuration options see :ref:`configuration-removedSignalConfigFiles`.
@ -130,3 +136,7 @@ Further checks
--------------
- Legacy ajax registrations for TYPO3 Backend.
- We check usage of legacy classes in strings, covering properties and configuration directives.
They are only added as warning, not fixable error, as they might be table names and expected to
stay.

View file

@ -1,3 +1,14 @@
Deprecation
===========
TYPO3 nowadays provides the Extension Scanner, which was encapsulated into a
standalone project at https://github.com/tuurlijk/typo3scan.
There is also an 3rd party tool based on https://github.com/rectorphp/rector which
can be found at https://github.com/sabbelasichon/typo3-rector.
This project will not be developed any further, instead use the new projects.
About
=====
@ -6,8 +17,8 @@ Our goal is to provide an automated migration for TYPO3 updates.
This should include source code modifications like adjusting old legacy class names to new ones.
The official project home page can be found at https://git.higidi.com/Automated-TYPO3-Update/automated-typo3-update .
Please open new issues and merge requests there. You can login with your Github account.
Please open new issues and merge requests there. You can login with your GitHub account.
Github is just used as a mirror for the project.
GitHub is just used as a mirror for the project.
Check out the official documentation at: https://automated-typo3-update.readthedocs.io

View file

@ -32,6 +32,7 @@
},
"require-dev": {
"phpunit/phpunit": "5.7.*",
"mikey179/vfsStream": "1.6.*",
"symfony/finder": "3.2.*",
"phpmd/phpmd": "2.6.*",
"pdepend/pdepend": "2.5.*"

View file

@ -5,6 +5,7 @@
<file>./src</file>
<file>./tests</file>
<exclude-pattern>*/Fixtures/*</exclude-pattern>
<exclude-pattern>*/LegacyClassnames.php</exclude-pattern>
<!-- Excludes for PHPCS Code Style -->
<rule ref="PSR1.Classes.ClassDeclaration.MissingNamespace">

View file

@ -21,7 +21,11 @@
<filter>
<whitelist>
<directory>./src/</directory>
<directory>./src</directory>
<exclude>
<directory>./src/Standards/Typo3Update/Sniffs/</directory>
<file>./src/Standards/Typo3Update/Configuration/LegacyClassnames.php</file>
</exclude>
</whitelist>
</filter>
</phpunit>

View file

@ -9,6 +9,7 @@ Typo3Update\Feature\LegacyClassnameFeature:
- Typo3Update_Sniffs_Classname_MissingVendorForPluginsAndModulesSniff
- Typo3Update_Sniffs_Classname_PhpDocCommentSniff
- Typo3Update_Sniffs_Classname_StaticCallSniff
- Typo3Update_Sniffs_Classname_StringSniff
- Typo3Update_Sniffs_Classname_TypeHintCatchExceptionSniff
- Typo3Update_Sniffs_Classname_TypeHintSniff
- Typo3Update_Sniffs_Classname_UseSniff

View file

@ -0,0 +1,14 @@
Typo3Update\Feature\RemovedExtensionFeature:
- 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

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,6 @@
# Breaking changes in 7.0: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Index.html#breaking-changes
'7.0':
perm:
replacement: 'The logic is moved into EXT:beuser'
docsUrl: 'https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html'

View file

@ -0,0 +1,8 @@
# Breaking changes in 7.0: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Index.html#breaking-changes
'7.0':
typo3CacheManager:
replacement: 'Use GeneralUtility::makeInstance() instead'
docsUrl: 'https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62416-DeprecatedCodeRemovalInCoreSysext.html#removed-php-classes'
typo3CacheFactory:
replacement: 'Use GeneralUtility::makeInstance() instead'
docsUrl: 'https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62416-DeprecatedCodeRemovalInCoreSysext.html#removed-php-classes'

View file

@ -21,12 +21,15 @@ namespace Typo3Update\Feature;
*/
use PHP_CodeSniffer_File as PhpCsFile;
use Typo3Update\Sniffs\ExtendedPhpCsSupportTrait;
/**
* Provides "feature" support for sniffs.
*/
trait FeaturesSupport
{
use ExtendedPhpCsSupportTrait;
/**
* @return Features
*/
@ -44,6 +47,8 @@ trait FeaturesSupport
*/
public function processFeatures(PhpCsFile $phpcsFile, $stackPtr, $content)
{
$content = $this->getStringContent($content);
foreach ($this->getFeatures() as $featureClassName) {
$feature = $this->createFeature($featureClassName);
$feature->process($phpcsFile, $stackPtr, $content);

View file

@ -23,6 +23,7 @@ namespace Typo3Update\Feature;
use PHP_CodeSniffer as PhpCs;
use PHP_CodeSniffer_File as PhpCsFile;
use PHP_CodeSniffer_Sniff as PhpCsSniff;
use Typo3Update_Sniffs_Classname_StringSniff as StringSniff;
/**
* This feature will add fixable errors for old legacy classnames.
@ -96,7 +97,11 @@ class LegacyClassnameFeature implements FeatureInterface
*/
protected function isLegacyClassname($classname)
{
return $this->legacyMapping->isLegacyClassname($classname);
if (get_class($this->sniff) === StringSniff::class) {
return $this->legacyMapping->isLegacyClassname($classname);
}
return $this->legacyMapping->isCaseInsensitiveLegacyClassname($classname);
}
/**
@ -108,6 +113,12 @@ class LegacyClassnameFeature implements FeatureInterface
*/
protected function isMaybeLegacyClassname($classname)
{
if (get_class($this->sniff) === StringSniff::class
&& $this->legacyMapping->isCaseInsensitiveLegacyClassname($classname)
) {
return true;
}
if (strpos($classname, 'Tx_') === false) {
return false;
}

View file

@ -45,6 +45,7 @@ final class LegacyClassnameMapping
return static::$instance;
}
// @codeCoverageIgnoreStart
private function __clone()
{
}
@ -54,17 +55,54 @@ final class LegacyClassnameMapping
private function __wakeup()
{
}
// @codeCoverageIgnoreEnd
private function __construct()
{
$this->mappings = require Options::getMappingFile();
if (is_file(Options::getMappingFile())) {
$this->mappings = require Options::getMappingFile();
$this->buildKeyArray($this->mappings, $this->mappingsKeys);
}
$this->typo3Mappings = require implode(DIRECTORY_SEPARATOR, [
__DIR__, '..', 'Configuration', '',
]) . 'LegacyClassnames.php';
$this->buildKeyArray($this->typo3Mappings, $this->typo3MappingsKeys);
}
// Singleton implementation - End
/**
* Contains mappings as defined by composer for alias mapping.
* @var array
*/
protected $typo3Mappings = [];
/**
* @var array
*/
protected $typo3MappingsKeys = [];
/**
* @var array
*/
protected $mappings = [];
/**
* @var array
*/
protected $mappingsKeys = [];
/**
* @var bool
*/
protected $dirty = false;
/**
* @param array $originalArray
* @param array $targetVariable
*/
protected function buildKeyArray($originalArray, &$targetVariable)
{
foreach (array_keys($originalArray) as $key) {
$targetVariable[strtolower($key)] = $key;
}
}
/**
* Checks whether a mapping exists for the given $classname,
@ -75,7 +113,22 @@ final class LegacyClassnameMapping
*/
public function isLegacyClassname($classname)
{
return isset($this->mappings['aliasToClassNameMapping'][strtolower($classname)]);
return $this->isLegacyTypo3Classname($classname) || $this->isLegacyMappingClassname($classname);
}
/**
* Checks whether a mapping exists for the given $classname,
* indicating it's legacy.
*
* @param string $classname
* @return bool
*/
public function isCaseInsensitiveLegacyClassname($classname)
{
$lowerVersion = strtolower($classname);
return $this->isLegacyTypo3Classname($classname) || $this->isLegacyMappingClassname($classname)
|| isset($this->typo3MappingsKeys[$lowerVersion]) || isset($this->mappingsKeys[$lowerVersion]);
}
/**
@ -84,7 +137,47 @@ final class LegacyClassnameMapping
*/
public function getNewClassname($classname)
{
return $this->mappings['aliasToClassNameMapping'][strtolower($classname)];
if ($this->isLegacyTypo3Classname($classname) || isset($this->typo3MappingsKeys[strtolower($classname)])) {
return $this->typo3Mappings[$this->getTypo3MappingKey($classname)];
}
return $this->mappings[$this->getLegacyMappingKey($classname)];
}
/**
* @param string $classname
* @return string
*/
protected function getTypo3MappingKey($classname)
{
return $this->typo3MappingsKeys[strtolower($classname)];
}
/**
* @param string $classname
* @return string
*/
protected function getLegacyMappingKey($classname)
{
return $this->mappingsKeys[strtolower($classname)];
}
/**
* @param string $classname
* @return bool
*/
protected function isLegacyTypo3Classname($classname)
{
return isset($this->typo3Mappings[$classname]);
}
/**
* @param string $classname
* @return bool
*/
protected function isLegacyMappingClassname($classname)
{
return isset($this->mappings[$classname]);
}
/**
@ -98,27 +191,30 @@ final class LegacyClassnameMapping
*/
public function addLegacyClassname($legacyClassname, $newClassname)
{
$key = strtolower($legacyClassname);
$this->mappings['aliasToClassNameMapping'][$key] = $newClassname;
$this->mappings['classNameToAliasMapping'][$newClassname] = [$key => $key];
$this->mappings[$legacyClassname] = $newClassname;
$this->mappingsKeys[strtolower($legacyClassname)] = $legacyClassname;
$this->dirty = true;
}
/**
* Used to persist new mappings.
*/
public function __destruct()
public function persistMappings()
{
// For some reasons desctruct is called multiple times, while construct
// is called once. Until we know the issue and fix it, this is our
// workaround to not break the file and do stuff in an unkown instance.
if ($this !== static::$instance) {
if ($this->dirty === false) {
return;
}
file_put_contents(
Options::getMappingFile(),
'<?php' . PHP_EOL . 'return ' . var_export($this->mappings, true) . ';'
'<?php' . PHP_EOL . 'return ' . var_export($this->mappings, true) . ';' . PHP_EOL
);
$this->dirty = false;
}
/**
* Used to persist new mappings.
* @codeCoverageIgnore
*/
public function __destruct()
{
$this->persistMappings();
}
}

View file

@ -0,0 +1,82 @@
<?php
namespace Typo3Update\Feature;
/*
* Copyright (C) 2017 Daniel Siepmann <coding@daniel-siepmann.de>
*
* 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 PHP_CodeSniffer_File as PhpCsFile;
use Typo3Update\Options;
class RemovedExtensionFeature extends AbstractYamlRemovedUsage
{
public function process(PhpCsFile $phpcsFile, $classnamePosition, $classname)
{
$extname = $this->getExtnameFromClassname($classname);
if ($extname === '' || $this->configured->isRemoved($extname) === false) {
return;
}
$this->addWarning(
$phpcsFile,
$classnamePosition,
$this->configured->getRemoved($extname)
);
}
protected function getExtnameFromClassname($classname)
{
$classname = ltrim($classname, '\\');
$classnameParts = array_filter(preg_split('/\\\\|_/', $classname));
$classnameParts = array_values($classnameParts); // To reset key numbers of array.
$extname = '';
if (count($classnameParts) <= 2) {
return '';
}
$extname = $classnameParts[1];
if (stripos($classname, 'TYPO3\CMS') === 0) {
$extname = $classnameParts[2];
}
return strtolower($extname);
}
protected function prepareStructure(array $typo3Versions)
{
$newStructure = [];
foreach ($typo3Versions as $typo3Version => $removals) {
foreach ($removals as $removed => $config) {
$config['name'] = $removed;
$config['identifier'] = 'RemovedExtension.' . str_replace('\\', '_', ltrim($removed, '\\'));
$config['versionRemoved'] = $typo3Version;
$config['oldUsage'] = $removed;
$newStructure[$removed] = $config;
}
}
return $newStructure;
}
protected function getRemovedConfigFiles()
{
return Options::getRemovedExtensionConfigFiles();
}
}

View file

@ -56,6 +56,17 @@ class Options
);
}
/**
* @return array<string>
*/
public static function getRemovedExtensionConfigFiles()
{
return static::getOptionFileNames(
'removedExtensionConfigFiles',
__DIR__ . '/Configuration/Removed/Extension/*.yaml'
);
}
/**
* Returns an array of absolute file names containing removed function configurations.
*
@ -147,6 +158,19 @@ class Options
);
}
/**
* Returns an array of absolute file names containing removed globals configurations.
*
* @return array<string>
*/
public static function getRemovedGlobalConfigFiles()
{
return static::getOptionFileNames(
'removedGlobalConfigFiles',
__DIR__ . '/Configuration/Removed/Globals/*.yaml'
);
}
/**
* Get the option by optionName, if not defined, use default.
*

View file

@ -62,19 +62,75 @@ abstract class AbstractClassnameChecker implements PhpCsSniff
*/
public function process(PhpCsFile $phpcsFile, $stackPtr)
{
$tokens = $phpcsFile->getTokens();
if ($this->shouldLookBefore()) {
$classnamePosition = $phpcsFile->findPrevious(T_STRING, $stackPtr);
} else {
$classnamePosition = $phpcsFile->findNext(T_STRING, $stackPtr);
}
if ($classnamePosition === false) {
try {
if ($this->shouldLookBefore()) {
list($classnamePosition, $classname) = $this->getBefore($phpcsFile, $stackPtr);
} else {
list($classnamePosition, $classname) = $this->getAfter($phpcsFile, $stackPtr);
}
} catch (\UnexpectedValueException $e) {
return;
}
$classname = $tokens[$classnamePosition]['content'];
$this->processFeatures($phpcsFile, $classnamePosition, $classname);
}
/**
* Get position and classname before current stack pointer.
*
* @param PhpCsFile $phpcsFile
* @param int $stackPtr The position in the stack where
*
* @return array
*/
protected function getBefore(PhpCsFile $phpcsFile, $stackPtr)
{
$possibleStart = $phpcsFile->findPrevious([
T_STRING, T_NS_SEPARATOR,
], $stackPtr - 1, null, true, null, true);
if ($possibleStart === false) {
throw new \UnexpectedValueException('Could not find start of classname.', 1494319966);
}
$classnamePosition = $phpcsFile->findNext(T_STRING, $possibleStart);
if ($classnamePosition === false) {
throw new \UnexpectedValueException('Could not find start of classname.', 1494319966);
}
$end = $phpcsFile->findNext([
T_STRING, T_NS_SEPARATOR
], $classnamePosition + 1, $stackPtr + 1, true, null, true);
if ($end === false) {
throw new \UnexpectedValueException('Could not find end of classname.', 1494319651);
}
$classname = $phpcsFile->getTokensAsString($classnamePosition, $end - $classnamePosition);
return [$classnamePosition, $classname];
}
/**
* Get position and classname after current stack pointer.
*
* @param PhpCsFile $phpcsFile
* @param int $stackPtr The position in the stack where
*
* @return array
*/
protected function getAfter(PhpCsFile $phpcsFile, $stackPtr)
{
$classnamePosition = $phpcsFile->findNext(T_STRING, $stackPtr);
if ($classnamePosition === false) {
throw new \UnexpectedValueException('Could not find start of classname.', 1494319665);
}
$end = $phpcsFile->findNext([T_STRING, T_NS_SEPARATOR], $classnamePosition, null, true, null, true);
if ($end === false) {
throw new \UnexpectedValueException('Could not find end of classname.', 1494319651);
}
$classname = $phpcsFile->getTokensAsString($classnamePosition, $end - $classnamePosition);
return [$classnamePosition, $classname];
}
}

View file

@ -72,11 +72,19 @@ class Typo3Update_Sniffs_Classname_InheritanceSniff extends AbstractClassnameChe
return;
}
$lastPosition = $phpcsFile->findNext(T_OPEN_CURLY_BRACKET, $stackPtr);
foreach ($interfaces as $interface) {
$position = $phpcsFile->findNext(T_STRING, $stackPtr, null, false, $interface);
if ($position === false) {
continue;
}
$interface = trim($interface, '\\');
$position = $stackPtr;
do {
try {
list($position, $classname) = $this->getAfter($phpcsFile, $position + 1);
} catch (\UnexpectedValueException $e) {
continue 2;
}
} while ($classname !== $interface && $position <= $lastPosition);
$this->processFeatures($phpcsFile, $position, $interface);
}

View file

@ -34,7 +34,7 @@ class Typo3Update_Sniffs_Classname_InstantiationWithMakeInstanceSniff extends Ab
*/
public function register()
{
return Tokens::$functionNameTokens;
return [T_STRING];
}
/**
@ -57,13 +57,12 @@ class Typo3Update_Sniffs_Classname_InstantiationWithMakeInstanceSniff extends Ab
return;
}
$classnamePosition = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, $stackPtr);
$classnamePosition = $phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, $stackPtr, null, false, null, true);
if ($classnamePosition === false) {
return;
}
$classname = $tokens[$classnamePosition]['content'];
$this->originalTokenContent = $tokens[$classnamePosition]['content'];
$this->processFeatures($phpcsFile, $classnamePosition, $classname);
}
}

View file

@ -0,0 +1,53 @@
<?php
/*
* Copyright (C) 2017 Daniel Siepmann <coding@daniel-siepmann.de>
*
* 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 PHP_CodeSniffer_File as PhpCsFile;
use PHP_CodeSniffer_Sniff as PhpCsSniff;
use PHP_CodeSniffer_Tokens as PhpCsTokens;
use Typo3Update\Feature\FeaturesSupport;
class Typo3Update_Sniffs_Classname_StringSniff implements PhpCsSniff
{
use FeaturesSupport;
/**
* @return array<int>
*/
public function register()
{
return PhpCsTokens::$stringTokens;
}
/**
* @param PhpCsFile $phpcsFile
* @param int $stackPtr
*/
public function process(PhpCsFile $phpcsFile, $stackPtr)
{
$token = $phpcsFile->getTokens()[$stackPtr]['content'];
// Special chars like ":" and "&" are used in configuration directives.
$classnames = array_filter(preg_split('/\s+|:|->|&/', substr($token, 1, -1)));
foreach ($classnames as $classname) {
$this->processFeatures($phpcsFile, $stackPtr, $classname);
}
}
}

View file

@ -51,10 +51,18 @@ class Typo3Update_Sniffs_Classname_TypeHintSniff extends AbstractClassnameChecke
continue;
}
$position = $phpcsFile->findPrevious(T_STRING, $parameter['token'], $stackPtr, false, null, true);
$position = $phpcsFile->findPrevious([
T_OPEN_PARENTHESIS, T_COMMA
], $parameter['token'] - 2, $stackPtr, false, null, true);
if ($position === false) {
continue;
}
$position = $phpcsFile->findNext(T_STRING, $position);
if ($position === false) {
continue;
}
$this->processFeatures($phpcsFile, $position, $parameter['type_hint']);
}
}

View file

@ -19,7 +19,6 @@
* 02110-1301, USA.
*/
use PHP_CodeSniffer_File as PhpCsFile;
use Typo3Update\Sniffs\Classname\AbstractClassnameChecker;
class Typo3Update_Sniffs_Classname_UseSniff extends AbstractClassnameChecker

View file

@ -28,6 +28,28 @@ use PHP_CodeSniffer_Tokens as Tokens;
*/
trait ExtendedPhpCsSupportTrait
{
/**
* Check whether variable at $stackPtr is global.
*
* @param PhpCsFile $phpcsFile
* @param int $stackPtr
*
* @return bool
*/
protected function isGlobalVariable(PhpCsFile $phpcsFile, $stackPtr)
{
$position = $phpcsFile->findPrevious(T_GLOBAL, $stackPtr, null, false, null, true);
if ($position !== false) {
return true;
}
if ($phpcsFile->getTokens()[$stackPtr]['content'] === '$GLOBALS') {
return true;
}
return false;
}
/**
* Check whether current stackPtr is a function call.
*
@ -68,10 +90,6 @@ trait ExtendedPhpCsSupportTrait
}
/**
* Returns all parameters for function call as values.
* Quotes are removed from strings.
*
* @param PhpCsFile $phpcsFile
* @param int $stackPtr
*
* @return array<string>

View file

@ -33,6 +33,27 @@ abstract class AbstractGenericUsage extends BaseAbstractYamlRemovedUsage impleme
*/
abstract protected function findRemoved(PhpCsFile $phpcsFile, $stackPtr);
/**
* @param array $typo3Versions
* @return array
*/
protected function prepareStructure(array $typo3Versions)
{
$newStructure = [];
foreach ($typo3Versions as $typo3Version => $removals) {
foreach ($removals as $removed => $config) {
$config['name'] = $removed;
$config['identifier'] = $removed;
$config['oldUsage'] = $removed;
$config['versionRemoved'] = $typo3Version;
$newStructure[$removed] = $config;
}
}
return $newStructure;
}
/**
* @param PhpCsFile $phpcsFile
* @param int $stackPtr

View file

@ -0,0 +1,62 @@
<?php
/*
* Copyright (C) 2017 Daniel Siepmann <coding@daniel-siepmann.de>
*
* 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 PHP_CodeSniffer_File as PhpCsFile;
use Typo3Update\Options;
use Typo3Update\Sniffs\ExtendedPhpCsSupportTrait;
use Typo3Update\Sniffs\Removed\AbstractGenericUsage;
class Typo3Update_Sniffs_Removed_ExtensionSniff extends AbstractGenericUsage
{
use ExtendedPhpCsSupportTrait;
/**
* @var array
*/
public $methodsToCheck = ['isLoaded', 'extPath', 'extRelPath', 'getCN', 'getExtensionVersion'];
public function register()
{
return [T_STRING];
}
protected function getRemovedConfigFiles()
{
return Options::getRemovedExtensionConfigFiles();
}
protected function findRemoved(PhpCsFile $phpcsFile, $stackPtr)
{
$token = $phpcsFile->getTokens()[$stackPtr];
if (!$this->isFunctionCall($phpcsFile, $stackPtr)
|| !in_array($token['content'], $this->methodsToCheck)
) {
return [];
}
$arguments = $this->getFunctionCallParameters($phpcsFile, $stackPtr);
if ($this->configured->isRemoved($arguments[0])) {
return [$this->configured->getRemoved($arguments[0])];
}
return [];
}
}

View file

@ -0,0 +1,66 @@
<?php
/*
* Copyright (C) 2017 Daniel Siepmann <coding@daniel-siepmann.de>
*
* 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 PHP_CodeSniffer_File as PhpCsFile;
use Typo3Update\Options;
use Typo3Update\Sniffs\Removed\AbstractGenericUsage;
use Typo3Update\Sniffs\ExtendedPhpCsSupportTrait;
class Typo3Update_Sniffs_Removed_GenericGlobalSniff extends AbstractGenericUsage
{
use ExtendedPhpCsSupportTrait;
public function register()
{
return [T_VARIABLE];
}
/**
* @param PhpCsFile $phpcsFile
* @param int $stackPtr
* @return array
*/
protected function findRemoved(PhpCsFile $phpcsFile, $stackPtr)
{
if ($this->isGlobalVariable($phpcsFile, $stackPtr) === false) {
return [];
}
$variableName = substr($phpcsFile->getTokens()[$stackPtr]['content'], 1);
if ($variableName === 'GLOBALS') {
$variableName = trim(
$phpcsFile->getTokens()[$phpcsFile->findNext(T_CONSTANT_ENCAPSED_STRING, $stackPtr)]['content'],
'\'"'
);
}
if ($this->configured->isRemoved($variableName)) {
return [$this->configured->getRemoved($variableName)];
}
return [];
}
protected function getRemovedConfigFiles()
{
return Options::getRemovedGlobalConfigFiles();
}
}

View file

@ -42,23 +42,6 @@ class Typo3Update_Sniffs_Removed_TypoScriptConstantSniff extends AbstractGeneric
];
}
protected function prepareStructure(array $typo3Versions)
{
$newStructure = [];
foreach ($typo3Versions as $typo3Version => $removals) {
foreach ($removals as $removed => $config) {
$config['name'] = $removed;
$config['identifier'] = $removed;
$config['oldUsage'] = $removed;
$config['versionRemoved'] = $typo3Version;
$newStructure[$removed] = $config;
}
}
return $newStructure;
}
protected function findRemoved(PhpCsFile $phpcsFile, $stackPtr)
{
$removed = [];

View file

@ -0,0 +1,160 @@
<?php
namespace Typo3Update\Tests\Feature;
/*
* Copyright (C) 2017 Daniel Siepmann <coding@daniel-siepmann.de>
*
* 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 PHPUnit\Framework\TestCase;
use Typo3Update\Feature\LegacyClassnameMapping;
use org\bovigo\vfs\vfsStream;
class LegacyClassnameMappingTest extends TestCase
{
/**
* @var \org\bovigo\vfs\vfsStreamDirectory
*/
protected $fileSystem;
/**
* @var LegacyClassnameMapping
*/
protected $subject;
/**
* @param string $fileName
* @return string
*/
protected function getFixturePath($fileName)
{
return implode(DIRECTORY_SEPARATOR, [
__DIR__, '..', 'Fixtures', 'Standards','Typo3Update',
'Feature', 'LegacyClassnameMapping', $fileName,
]);
}
public function setUp()
{
$this->fileSystem = vfsStream::setup('root', null, [
'LegacyClassnames.php' => file_get_contents($this->getFixturePath('MappingContent.php')),
]);
$GLOBALS['PHP_CODESNIFFER_CONFIG_DATA'] = [
'mappingFile' => vfsStream::url('root/LegacyClassnames.php'),
];
$this->subject = LegacyClassnameMapping::getInstance();
}
/**
* @test
*/
public function inCaseSensitivityLookupWorks()
{
$this->assertFalse(
$this->subject->isLegacyClassname('tx_extbase_domain_model_backenduser'),
'Classname was returned to be legacy but should not due to lowercase version and case sensitivity.'
);
$this->assertFalse(
$this->subject->isLegacyClassname('Tx_Extbase_Domain_Model_Backenduser'),
'Classname was returned to be legacy but should not due to lowercase version and case sensitivity.'
);
$this->assertTrue(
$this->subject->isCaseInsensitiveLegacyClassname('Tx_Extbase_Domain_Model_Backenduser'),
'Classname was not returned to be legacy but should due to case insensitivity.'
);
}
/**
* @test
*/
public function weCanRetrieveNewClassname()
{
$this->assertSame(
'TYPO3\CMS\Extbase\Command\HelpCommandController',
$this->subject->getNewClassname('tx_extbase_command_helpcommandcontroller'),
'New class name could not be fetched for lower cased version.'
);
$this->assertSame(
'TYPO3\CMS\Extbase\Command\HelpCommandController',
$this->subject->getNewClassname('Tx_Extbase_Command_HelpCommandController'),
'New class name could not be fetched.'
);
}
/**
* @test
*/
public function nothingWillBePersistedUntilWeAddSomething()
{
$this->subject->persistMappings();
$this->assertSame(
file_get_contents($this->getFixturePath('MappingContent.php')),
file_get_contents(vfsStream::url('root/LegacyClassnames.php')),
'File content should not be changed.'
);
$this->subject->addLegacyClassname('Tx_ExtName_Controller_ExampleController', '\\Vendor\\ExtName\\Controller\\ExampleController');
$this->subject->persistMappings();
$this->assertSame(
file_get_contents($this->getFixturePath('ExpectedMappingContent.php')),
file_get_contents(vfsStream::url('root/LegacyClassnames.php')),
'File content is not changed as expected.'
);
}
/**
* @test
* @runInSeparateProcess Because of file operations.
*/
public function addingLegacyClassnamesWillAdjustLookupAndBePersisted()
{
$this->assertFalse(
$this->subject->isLegacyClassname('Tx_ExtName_Controller_ExampleController'),
'Classname is not configured but returned to be legacy.'
);
$this->subject->addLegacyClassname('Tx_ExtName_Controller_ExampleController', '\\Vendor\\ExtName\\Controller\\ExampleController');
$this->assertTrue(
$this->subject->isLegacyClassname('Tx_ExtName_Controller_ExampleController'),
'Classname is configured but not returned to be legacy.'
);
}
/**
* @test
* @runInSeparateProcess Because of file operations.
*/
public function weCanRetrieveNewClassnameAddedBefore()
{
$this->subject->addLegacyClassname('Tx_ExtName_Controller_ExampleController', '\\Vendor\\ExtName\\Controller\\ExampleController');
$this->assertSame(
'\\Vendor\\ExtName\\Controller\\ExampleController',
$this->subject->getNewClassname('Tx_ExtName_Controller_ExampleController'),
'New class name could not be fetched.'
);
}
public function tearDown()
{
unset($this->subject);
unset($this->fileSystem);
}
}

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,4 @@
<?php
return array (
'Tx_ExtName_Controller_ExampleController' => '\\Vendor\\ExtName\\Controller\\ExampleController',
);

View file

@ -0,0 +1,3 @@
<?php
return array (
);

View file

@ -56,14 +56,41 @@
"severity": 5,
"source": "Typo3Update.Classname.Inheritance.legacyClassname",
"type": "ERROR"
},
{
"column": 35,
"fixable": false,
"line": 34,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.Inheritance.RemovedExtension.perm",
"type": "WARNING"
},
{
"column": 6,
"fixable": false,
"line": 35,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.Inheritance.RemovedExtension.perm",
"type": "WARNING"
},
{
"column": 5,
"fixable": false,
"line": 36,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.Inheritance.RemovedExtension.perm",
"type": "WARNING"
}
],
"warnings": 0
"warnings": 3
}
},
"totals": {
"errors": 6,
"fixable": 6,
"warnings": 0
"warnings": 3
}
}

View file

@ -30,3 +30,10 @@ class InputFileForIssues extends Tx_Extbase_Configuration_Configurationmanager i
{
}
class InputFileForIssues extends \TYPO3\CMS\Perm\Controller\PermissionAjaxController implements
\TYPO3\CMS\Perm\Controller\PermissionAjaxController,
TYPO3\CMS\Perm\Controller\PermissionModuleController
{
}

View file

@ -19,5 +19,5 @@
- // @var Tx_Extbase_Command_HelpCommandController $variable
+ // @var \TYPO3\CMS\Extbase\Command\HelpCommandController $variable
$variable;
}
}
/* @var $variable TYPO3\CMS\Perm\Controller\PermissionAjaxController */

View file

@ -38,14 +38,50 @@
"severity": 5,
"source": "Typo3Update.Classname.InlineComment.legacyClassname",
"type": "ERROR"
},
{
"column": 9,
"fixable": false,
"line": 38,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.InlineComment.RemovedExtension.perm",
"type": "WARNING"
},
{
"column": 9,
"fixable": false,
"line": 41,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.InlineComment.RemovedExtension.perm",
"type": "WARNING"
},
{
"column": 9,
"fixable": false,
"line": 44,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.InlineComment.RemovedExtension.perm",
"type": "WARNING"
},
{
"column": 9,
"fixable": false,
"line": 47,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.InlineComment.RemovedExtension.perm",
"type": "WARNING"
}
],
"warnings": 0
"warnings": 4
}
},
"totals": {
"errors": 4,
"fixable": 4,
"warnings": 0
"warnings": 4
}
}

View file

@ -34,5 +34,17 @@ class InputFileForIssues
// @var Tx_Extbase_Command_HelpCommandController $variable
$variable;
/* @var $variable TYPO3\CMS\Perm\Controller\PermissionAjaxController */
$variable;
// @var $variable \TYPO3\CMS\Perm\Controller\PermissionAjaxController
$variable;
/* @var \TYPO3\CMS\Perm\Controller\PermissionAjaxController $variable */
$variable;
// @var TYPO3\CMS\Perm\Controller\PermissionAjaxController $variable
$variable;
}
}

View file

@ -1,6 +1,6 @@
--- tests/Fixtures/Standards/Typo3Update/Sniffs/Classname/InstanceofSniff/InputFileForIssues.php
+++ PHP_CodeSniffer
@@ -19,6 +19,6 @@
@@ -19,7 +19,7 @@
* 02110-1301, USA.
*/
@ -8,3 +8,4 @@
+if ($a instanceof \TYPO3\CMS\Core\SingletonInterface) {
// do something
}
if ($a instanceof \TYPO3\CMS\Perm\Controller\PermissionAjaxController) {

View file

@ -11,14 +11,32 @@
"severity": 5,
"source": "Typo3Update.Classname.Instanceof.legacyClassname",
"type": "ERROR"
},
{
"column": 20,
"fixable": false,
"line": 25,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.Instanceof.RemovedExtension.perm",
"type": "WARNING"
},
{
"column": 19,
"fixable": false,
"line": 28,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.Instanceof.RemovedExtension.perm",
"type": "WARNING"
}
],
"warnings": 0
"warnings": 2
}
},
"totals": {
"errors": 1,
"fixable": 1,
"warnings": 0
"warnings": 2
}
}

View file

@ -22,3 +22,9 @@
if ($a instanceof t3lib_Singleton) {
// do something
}
if ($a instanceof \TYPO3\CMS\Perm\Controller\PermissionAjaxController) {
// do something
}
if ($a instanceof TYPO3\CMS\Perm\Controller\PermissionAjaxController) {
// do something
}

View file

@ -11,14 +11,23 @@
"severity": 5,
"source": "Typo3Update.Classname.InstantiationWithMakeInstance.legacyClassname",
"type": "ERROR"
},
{
"column": 25,
"fixable": false,
"line": 27,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.InstantiationWithMakeInstance.RemovedExtension.perm",
"type": "WARNING"
}
],
"warnings": 0
"warnings": 1
}
},
"totals": {
"errors": 1,
"fixable": 1,
"warnings": 0
"warnings": 1
}
}

View file

@ -23,3 +23,5 @@ t3lib_div::makeInstance('Tx_Extbase_Command_HelpCommandController');
t3lib_div::makeInstance(\TYPO3\CMS\Core\Resource\Service\IndexerService::class);
// Not handled by this sniff, but StaticCallSniff, as this uses double colon.
t3lib_div::makeInstance(Tx_Extbase_Command_HelpCommandController::class);
t3lib_div::makeInstance('TYPO3\CMS\Perm\Controller\PermissionAjaxController');

View file

@ -1,6 +1,6 @@
--- tests/Fixtures/Standards/Typo3Update/Sniffs/Classname/InstantiationWithNewSniff/InputFileForIssues.php
+++ PHP_CodeSniffer
@@ -19,13 +19,13 @@
@@ -19,14 +19,14 @@
* 02110-1301, USA.
*/
@ -20,3 +20,4 @@
+(new \TYPO3\CMS\Extbase\Command\HelpCommandController)
->doSomething()
;

View file

@ -56,14 +56,32 @@
"severity": 5,
"source": "Typo3Update.Classname.InstantiationWithNew.legacyClassname",
"type": "ERROR"
},
{
"column": 5,
"fixable": false,
"line": 33,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.InstantiationWithNew.RemovedExtension.perm",
"type": "WARNING"
},
{
"column": 7,
"fixable": false,
"line": 34,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.InstantiationWithNew.RemovedExtension.perm",
"type": "WARNING"
}
],
"warnings": 0
"warnings": 2
}
},
"totals": {
"errors": 6,
"fixable": 6,
"warnings": 0
"warnings": 2
}
}

View file

@ -29,3 +29,8 @@ new Tx_Extbase_Command_HelpCommandController;
(new Tx_Extbase_Command_HelpCommandController)
->doSomething()
;
new TYPO3\CMS\Perm\Controller\PermissionAjaxController;
(new \TYPO3\CMS\Perm\Controller\PermissionAjaxController)
->doSomething()
;

View file

@ -1,6 +1,6 @@
--- tests/Fixtures/Standards/Typo3Update/Sniffs/Classname/InstantiationWithObjectManagerSniff/InputFileForIssues.php
+++ PHP_CodeSniffer
@@ -21,13 +21,13 @@
@@ -21,16 +21,16 @@
// Not handled by this sniff, but StaticCallSniff, as this uses double colon.
$this->objectManager->get(\Tx_Extbase_Command_HelpCommandController::class);
@ -18,3 +18,6 @@
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager)
- ->get('Tx_Extbase_Command_HelpCommandController');
+ ->get('\TYPO3\CMS\Extbase\Command\HelpCommandController');
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager)
->get('\TYPO3\CMS\Perm\Controller\PermissionAjaxController');

View file

@ -38,14 +38,32 @@
"severity": 5,
"source": "Typo3Update.Classname.InstantiationWithObjectManager.legacyClassname",
"type": "ERROR"
},
{
"column": 11,
"fixable": false,
"line": 36,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.InstantiationWithObjectManager.RemovedExtension.perm",
"type": "WARNING"
},
{
"column": 27,
"fixable": false,
"line": 37,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.InstantiationWithObjectManager.RemovedExtension.perm",
"type": "WARNING"
}
],
"warnings": 0
"warnings": 2
}
},
"totals": {
"errors": 4,
"fixable": 4,
"warnings": 0
"warnings": 2
}
}

View file

@ -31,3 +31,7 @@ $this->objectManager->get('Tx_Extbase_Command_HelpCommandController');
->get('\Tx_Extbase_Command_HelpCommandController');
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager)
->get('Tx_Extbase_Command_HelpCommandController');
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager)
->get('\TYPO3\CMS\Perm\Controller\PermissionAjaxController');
$this->objectManager->get('TYPO3\CMS\Perm\Controller\PermissionAjaxController');

View file

@ -1,6 +1,6 @@
--- tests/Fixtures/Standards/Typo3Update/Sniffs/Classname/IsACallSniff/InputFileForIssues.php
+++ PHP_CodeSniffer
@@ -23,15 +23,15 @@
@@ -23,16 +23,16 @@
if (is_a($a, t3lib_Singleton::class)) {
// do something
}
@ -20,3 +20,4 @@
+if (is_a($a, "\\TYPO3\\CMS\\Core\\SingletonInterface")) {
// do something
}
if (is_a($a, "\\TYPO3\CMS\Perm\Controller\PermissionAjaxController")) {

View file

@ -38,14 +38,23 @@
"severity": 5,
"source": "Typo3Update.Classname.IsACall.legacyClassname",
"type": "ERROR"
},
{
"column": 14,
"fixable": false,
"line": 38,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.IsACall.RemovedExtension.perm",
"type": "WARNING"
}
],
"warnings": 0
"warnings": 1
}
},
"totals": {
"errors": 4,
"fixable": 4,
"warnings": 0
"warnings": 1
}
}

View file

@ -35,3 +35,6 @@ if (is_a($a, "t3lib_Singleton")) {
if (is_a($a, "\\t3lib_Singleton")) {
// do something
}
if (is_a($a, "\\TYPO3\CMS\Perm\Controller\PermissionAjaxController")) {
// do something
}

View file

@ -1,6 +1,6 @@
--- tests/Fixtures/Standards/Typo3Update/Sniffs/Classname/PhpDocCommentSniff/InputFileForIssues.php
+++ PHP_CodeSniffer
@@ -22,26 +22,26 @@
@@ -22,27 +22,27 @@
class InputFileForIssues
{
/**
@ -22,6 +22,7 @@
- * @param t3lib_div
+ * @param \TYPO3\CMS\Core\Utility\GeneralUtility
* @param \TYPO3\CMS\Backend\Template\MediumDocumentTemplate
* @param \TYPO3\CMS\Perm\Controller\PermissionAjaxController
*
- * @return Tx_Extbase_Configuration_Configurationmanager
+ * @return \TYPO3\CMS\Extbase\Configuration\ConfigurationManager

View file

@ -49,19 +49,19 @@
"type": "WARNING"
},
{
"column": 16,
"fixable": true,
"line": 40,
"message": "Legacy classes are not allowed; found \"Tx_Extbase_Configuration_Configurationmanager\", use \"TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager\" instead",
"column": 15,
"fixable": false,
"line": 39,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.PhpDocComment.legacyClassname",
"type": "ERROR"
"source": "Typo3Update.Classname.PhpDocComment.RemovedExtension.perm",
"type": "WARNING"
},
{
"column": 18,
"column": 16,
"fixable": true,
"line": 44,
"message": "Legacy classes are not allowed; found \"t3lib_div\", use \"TYPO3\\CMS\\Core\\Utility\\GeneralUtility\" instead",
"line": 41,
"message": "Legacy classes are not allowed; found \"Tx_Extbase_Configuration_Configurationmanager\", use \"TYPO3\\CMS\\Extbase\\Configuration\\ConfigurationManager\" instead",
"severity": 5,
"source": "Typo3Update.Classname.PhpDocComment.legacyClassname",
"type": "ERROR"
@ -74,14 +74,23 @@
"severity": 5,
"source": "Typo3Update.Classname.PhpDocComment.legacyClassname",
"type": "ERROR"
},
{
"column": 18,
"fixable": true,
"line": 46,
"message": "Legacy classes are not allowed; found \"t3lib_div\", use \"TYPO3\\CMS\\Core\\Utility\\GeneralUtility\" instead",
"severity": 5,
"source": "Typo3Update.Classname.PhpDocComment.legacyClassname",
"type": "ERROR"
}
],
"warnings": 1
"warnings": 2
}
},
"totals": {
"errors": 7,
"fixable": 7,
"warnings": 1
"warnings": 2
}
}

View file

@ -36,6 +36,7 @@ class InputFileForIssues
/**
* @param t3lib_div
* @param \TYPO3\CMS\Backend\Template\MediumDocumentTemplate
* @param \TYPO3\CMS\Perm\Controller\PermissionAjaxController
*
* @return Tx_Extbase_Configuration_Configurationmanager
*/

View file

@ -1,6 +1,6 @@
--- tests/Fixtures/Standards/Typo3Update/Sniffs/Classname/StaticCallSniff/InputFileForIssues.php
+++ PHP_CodeSniffer
@@ -19,13 +19,13 @@
@@ -19,16 +19,16 @@
* 02110-1301, USA.
*/
@ -19,3 +19,6 @@
-is_a($a, t3lib_Singleton::class);
+ ->get(\TYPO3\CMS\Extbase\Command\HelpCommandController::class);
+is_a($a, \TYPO3\CMS\Core\SingletonInterface::class);
\TYPO3\CMS\Perm\Controller\PermissionAjaxController::configurePlugin(
$_EXTKEY,

View file

@ -56,14 +56,32 @@
"severity": 5,
"source": "Typo3Update.Classname.StaticCall.legacyClassname",
"type": "ERROR"
},
{
"column": 2,
"fixable": false,
"line": 33,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.StaticCall.RemovedExtension.perm",
"type": "WARNING"
},
{
"column": 28,
"fixable": false,
"line": 38,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.StaticCall.RemovedExtension.perm",
"type": "WARNING"
}
],
"warnings": 0
"warnings": 2
}
},
"totals": {
"errors": 6,
"fixable": 6,
"warnings": 0
"warnings": 2
}
}

View file

@ -29,3 +29,10 @@ $this->objectManager->get(\Tx_Extbase_Command_HelpCommandController::class);
\TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance(\TYPO3\CMS\Extbase\Object\ObjectManager)
->get(\Tx_Extbase_Command_HelpCommandController::class);
is_a($a, t3lib_Singleton::class);
\TYPO3\CMS\Perm\Controller\PermissionAjaxController::configurePlugin(
$_EXTKEY,
'name',
['Controller' => 'action']
);
$this->objectManager->get(\TYPO3\CMS\Perm\Controller\PermissionAjaxController::class);

View file

@ -0,0 +1,17 @@
--- tests/Fixtures/Standards/Typo3Update/Sniffs/Classname/StringSniff/InputFileForIssues.php
+++ PHP_CodeSniffer
@@ -19,10 +19,10 @@
* 02110-1301, USA.
*/
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = 'Tx_Extbase_Command_HelpCommandController';
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = "Tx_Extbase_Command_HelpCommandController";
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = '\TYPO3\CMS\Extbase\Command\HelpCommandController';
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = "\\TYPO3\\CMS\\Extbase\\Command\\HelpCommandController";
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['createHashBase'][] = 'EXT:ext_key/Classes/Hooks/Cache.php:&Tx_Extbase_Command_HelpCommandController->getHash';
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['createHashBase'][] = 'EXT:ext_key/Classes/Hooks/Cache.php:&\TYPO3\CMS\Extbase\Command\HelpCommandController->getHash';
-$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = "Tx_About_Domain_Model_Extension";
+$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = "\\TYPO3\\CMS\\About\\Domain\\Model\\Extension";
$GLOBALS['TCA']['tx_about_domain_model_extension'] = [];

View file

@ -0,0 +1,60 @@
{
"files": {
"InputFileForIssues.php": {
"errors": 4,
"messages": [
{
"column": 80,
"fixable": true,
"line": 22,
"message": "Legacy classes are not allowed; found \"Tx_Extbase_Command_HelpCommandController\", use \"TYPO3\\CMS\\Extbase\\Command\\HelpCommandController\" instead",
"severity": 5,
"source": "Typo3Update.Classname.String.legacyClassname",
"type": "ERROR"
},
{
"column": 80,
"fixable": true,
"line": 23,
"message": "Legacy classes are not allowed; found \"Tx_Extbase_Command_HelpCommandController\", use \"TYPO3\\CMS\\Extbase\\Command\\HelpCommandController\" instead",
"severity": 5,
"source": "Typo3Update.Classname.String.legacyClassname",
"type": "ERROR"
},
{
"column": 93,
"fixable": true,
"line": 25,
"message": "Legacy classes are not allowed; found \"Tx_Extbase_Command_HelpCommandController\", use \"TYPO3\\CMS\\Extbase\\Command\\HelpCommandController\" instead",
"severity": 5,
"source": "Typo3Update.Classname.String.legacyClassname",
"type": "ERROR"
},
{
"column": 80,
"fixable": true,
"line": 27,
"message": "Legacy classes are not allowed; found \"Tx_About_Domain_Model_Extension\", use \"TYPO3\\CMS\\About\\Domain\\Model\\Extension\" instead",
"severity": 5,
"source": "Typo3Update.Classname.String.legacyClassname",
"type": "ERROR"
},
{
"column": 17,
"fixable": false,
"line": 28,
"message": "Legacy classes are not allowed; found tx_about_domain_model_extension that might be a legacy class that does not exist anymore",
"severity": 5,
"source": "Typo3Update.Classname.String.mightBeLegacyClassname",
"type": "WARNING"
}
],
"warnings": 1
}
},
"totals": {
"errors": 4,
"fixable": 4,
"warnings": 1
}
}

View file

@ -0,0 +1,28 @@
<?php
/*
* Copyright (C) 2017 Daniel Siepmann <coding@daniel-siepmann.de>
*
* 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.
*/
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = 'Tx_Extbase_Command_HelpCommandController';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = "Tx_Extbase_Command_HelpCommandController";
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['tslib/class.tslib_fe.php']['createHashBase'][] = 'EXT:ext_key/Classes/Hooks/Cache.php:&Tx_Extbase_Command_HelpCommandController->getHash';
$GLOBALS['TYPO3_CONF_VARS']['SC_OPTIONS']['extbase']['commandControllers'][] = "Tx_About_Domain_Model_Extension";
$GLOBALS['TCA']['tx_about_domain_model_extension'] = [];

View file

@ -20,14 +20,23 @@
"severity": 5,
"source": "Typo3Update.Classname.TypeHintCatchException.legacyClassname",
"type": "ERROR"
},
{
"column": 11,
"fixable": false,
"line": 48,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.TypeHintCatchException.RemovedExtension.perm",
"type": "WARNING"
}
],
"warnings": 0
"warnings": 1
}
},
"totals": {
"errors": 2,
"fixable": 2,
"warnings": 0
"warnings": 1
}
}

View file

@ -42,3 +42,9 @@ try {
} catch (TYPO3\CMS\Extbase\Exception $e) {
// else
}
try {
// something
} catch (\TYPO3\CMS\Perm\Controller\PermissionAjaxController $e) {
// else
}

View file

@ -38,4 +38,4 @@
+ public function something(\TYPO3\CMS\Extbase\Domain\Model\BackendUser $user)
{
}
}

View file

@ -56,14 +56,41 @@
"severity": 5,
"source": "Typo3Update.Classname.TypeHint.legacyClassname",
"type": "ERROR"
},
{
"column": 31,
"fixable": false,
"line": 63,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.TypeHint.RemovedExtension.perm",
"type": "WARNING"
},
{
"column": 96,
"fixable": false,
"line": 63,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.TypeHint.RemovedExtension.perm",
"type": "WARNING"
},
{
"column": 31,
"fixable": false,
"line": 66,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.TypeHint.RemovedExtension.perm",
"type": "WARNING"
}
],
"warnings": 0
"warnings": 3
}
},
"totals": {
"errors": 6,
"fixable": 6,
"warnings": 0
"warnings": 3
}
}

View file

@ -59,4 +59,11 @@ class SomeClass
public function something(Tx_Extbase_Domain_Model_Backenduser $user)
{
}
public function something(TYPO3\CMS\Perm\Controller\PermissionAjaxController $controller, \Tx_Perm_Controller_PermissionAjaxController $controller)
{
}
public function something(Tx_Perm_Controller_PermissionAjaxController $controller)
{
}
}

View file

@ -10,4 +10,4 @@
+use TYPO3\CMS\Extbase\Domain\Model\BackendUser;
use TYPO3\CMS\Extbase\Mvc\Cli\Command;
use \TYPO3\CMS\Extbase\Mvc\Cli\Command;
use TYPO3\CMS\Perm\Controller\PermissionAjaxController;

View file

@ -20,14 +20,41 @@
"severity": 5,
"source": "Typo3Update.Classname.Use.legacyClassname",
"type": "ERROR"
},
{
"column": 5,
"fixable": false,
"line": 26,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.Use.RemovedExtension.perm",
"type": "WARNING"
},
{
"column": 6,
"fixable": false,
"line": 27,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.Use.RemovedExtension.perm",
"type": "WARNING"
},
{
"column": 5,
"fixable": false,
"line": 28,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Classname.Use.RemovedExtension.perm",
"type": "WARNING"
}
],
"warnings": 0
"warnings": 3
}
},
"totals": {
"errors": 2,
"fixable": 2,
"warnings": 0
"warnings": 3
}
}

View file

@ -23,4 +23,6 @@ use \Tx_Extbase_Domain_Model_Backenduser;
use Tx_Extbase_Domain_Model_Backenduser;
use TYPO3\CMS\Extbase\Mvc\Cli\Command;
use \TYPO3\CMS\Extbase\Mvc\Cli\Command;
use TYPO3\CMS\Perm\Controller\PermissionAjaxController;
use \Tx_Perm_Controller_PermissionAjaxController;
use Tx_Perm_Controller_PermissionAjaxController;

View file

@ -0,0 +1,33 @@
{
"files": {
"InputFileForIssues.php": {
"errors": 0,
"messages": [
{
"column": 53,
"fixable": false,
"line": 22,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Removed.Extension.perm",
"type": "WARNING"
},
{
"column": 53,
"fixable": false,
"line": 23,
"message": "Calls to removed code are not allowed; found perm. Removed in 7.0. The logic is moved into EXT:beuser. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62339-MoveExtPermIntoExtBeuser.html",
"severity": 5,
"source": "Typo3Update.Removed.Extension.perm",
"type": "WARNING"
}
],
"warnings": 2
}
},
"totals": {
"errors": 0,
"fixable": 0,
"warnings": 2
}
}

View file

@ -0,0 +1,23 @@
<?php
/*
* Copyright (C) 2017 Daniel Siepmann <coding@daniel-siepmann.de>
*
* 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.
*/
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::isLoaded('perm');
\TYPO3\CMS\Core\Utility\ExtensionManagementUtility::extRelPath('perm');

View file

@ -0,0 +1,33 @@
{
"files": {
"InputFileForIssues.php": {
"errors": 0,
"messages": [
{
"column": 12,
"fixable": false,
"line": 24,
"message": "Calls to removed code are not allowed; found typo3CacheFactory. Removed in 7.0. Use GeneralUtility::makeInstance() instead. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62416-DeprecatedCodeRemovalInCoreSysext.html#removed-php-classes",
"severity": 5,
"source": "Typo3Update.Removed.GenericGlobal.typo3CacheFactory",
"type": "WARNING"
},
{
"column": 26,
"fixable": false,
"line": 25,
"message": "Calls to removed code are not allowed; found typo3CacheManager. Removed in 7.0. Use GeneralUtility::makeInstance() instead. See: https://docs.typo3.org/typo3cms/extensions/core/7.6/Changelog/7.0/Breaking-62416-DeprecatedCodeRemovalInCoreSysext.html#removed-php-classes",
"severity": 5,
"source": "Typo3Update.Removed.GenericGlobal.typo3CacheManager",
"type": "WARNING"
}
],
"warnings": 2
}
},
"totals": {
"errors": 0,
"fixable": 0,
"warnings": 2
}
}

View file

@ -0,0 +1,27 @@
<?php
/*
* Copyright (C) 2017 Daniel Siepmann <coding@daniel-siepmann.de>
*
* 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.
*/
function name()
{
global $typo3CacheFactory;
$typo3CacheManager = $GLOBALS['typo3CacheManager'];
$typo3CacheManager->something();
}

View file

@ -0,0 +1,28 @@
<?php
namespace Typo3Update\Tests\Sniffs\Classname;
/*
* Copyright (C) 2017 Daniel Siepmann <coding@daniel-siepmann.de>
*
* 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 StringSniffTest extends SniffsTest
{
}

View file

@ -0,0 +1,28 @@
<?php
namespace Typo3Update\Tests\Sniffs\Removed;
/*
* Copyright (C) 2017 Daniel Siepmann <coding@daniel-siepmann.de>
*
* 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 ExtensionSniffTest extends SniffsTest
{
}

View file

@ -0,0 +1,28 @@
<?php
namespace Typo3Update\Tests\Sniffs\Removed;
/*
* Copyright (C) 2017 Daniel Siepmann <coding@daniel-siepmann.de>
*
* 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 GenericGlobalSniffTest extends SniffsTest
{
}