Project

General

Profile

Actions

Task #104799

closed

Let ExtensionScanner recognize implementations of deprecated/removed abstract/interface method definitions

Added by Garvin Hicking 3 months ago. Updated about 1 month ago.

Status:
Closed
Priority:
Should have
Category:
Install Tool
Target version:
-
Start date:
2024-09-03
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
13
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

The Extension Scanner of the EXT:install module allows to scan
custom extensions based on several static code analysis rules.

Most of these rules depend on analyzing code to see if deprecated
or removed methods are called, or if argument names change,
annotations/attributes get removed and so on.

This patch adds a MethodDefinitionMatcher matcher which
can analyze definitions that need to be migrated.

A good example for this is a change in Fluid ViewHelpers deprecating
the renderStatic method.

Because ViewHelpers themself do not execute a renderStatic
method, any custom ViewHelper implementing renderStatic
would not be revealed in the Extension Scanner before.

The Matcher receives a configuration like:

return [
 'TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper::renderStatic' 
   => [
        'restFiles' => [
          'Breaking-82162-GlobalErrorConstantsRemoved.rst',
      ],
   ],
];

and based on this, iterates every custom code to check if
any class inherits from this
TYPO3Fluid\Fluid\Core\ViewHelper\AbstractViewHelper abstract,
and then checks for a given method name (here renderStatic).

These matches will be reported as strong matches.


Files

Actions

Also available in: Atom PDF