Unverified Commit 3034f3fe authored by Daniel Siepmann's avatar Daniel Siepmann
Browse files

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
parent 633a7140
Pipeline #238 passed with stages
in 2 minutes and 22 seconds
......@@ -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']);
}
}
......
......@@ -38,4 +38,4 @@
+ public function something(\TYPO3\CMS\Extbase\Domain\Model\BackendUser $user)
{
}
}
......@@ -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.RemovedClass.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.RemovedClass.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.RemovedClass.perm",
"type": "WARNING"
}
],
"warnings": 0
"warnings": 3
}
},
"totals": {
"errors": 6,
"fixable": 6,
"warnings": 0
"warnings": 3
}
}
......@@ -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)
{
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment