#96567php ast catches wrong class
Description
PHP AST recognizes the RecordsContentObject but mistakenly recognizes it as a PageRenderer and captures it as a page render class. This triggers the following error Breaking: #93003 – PageRenderer renders only full page
example method which throws the error
public function render()
{
$conf = $this->buildConfArray($this->arguments[‘uid’]);
$recordsObjectManager = $this->objectManager->get(RecordsContentObject::class);
return $this->RecordsContentObject->render($conf);
}
I would like to request a modification of the scanner.
Reviews 2
Related issues 1
Files 1
History 68
-
Georg Ringer commented and changed status
NewNeeds Feedback 01/19/22, 19:08 -
Christian Kuhn commented 01/22/22, 20:14
Hey.
As Georg already mentioned, this is a limit of the extension scanner. For non-static method calls, it basically does not know which on which object/class the method is called, so it just classifies the matching method name as “weak” match: A candidate to check.
For more information, see https://docs.typo3.org/m/typo3/reference-coreapi/11.5/en-us/ApiOverview/ExtensionScanner/Index.html#limits .
-
Christian Kuhn commented 01/22/22, 20:17
However, since render() is such a generic method name, we are probably better off removing that matcher from the configuration and maybe adapt the .rst file of #93003 to ‘not scanned’. This will help avoiding too many false positives in this very case.
-
Christian Kuhn changed Related to #93003 01/22/22, 20:17
-
Gerrit Code Review pushed patch set 1 for main to change 73132 status
Needs FeedbackUnder Review 01/23/22, 10:35 -
Gerrit Code Review pushed patch set 1 for 11.5 to change 73089 01/24/22, 14:45
-
Christian Kuhn commented and changed status
Under ReviewResolved done0 %100 % 01/24/22, 14:50Applied in changeset commit:50d4e2c3c969d1951e88328a9f08e53913d52a07.
-
Benni Mack changed status
ResolvedClosed 10/04/22, 14:14
thanks for creating the issue!
this is a weak and as there is only a static code check this is IMO fine. Read more about it at https://docs.typo3.org/m/typo3/reference-coreapi/main/en-us/ApiOverview/ExtensionScanner/Index.html
it is ok to close the issue?