ExtensionScannerService

Scans PHP files for usages of removed or deprecated TYPO3 Core code.

This is the engine behind the "Extension scanner" of the install tool. It reports what static analysis found and where it came from; it deliberately does not resolve the referenced changelog files to documents, and it does not read the matched source lines. Both are presentation concerns of the caller.

Not declared final only because the unit tests of EXT:install replace it with a test double; substitutability is not a promise of this API.

Internal

This class is only meant to be used within EXT:install and is not part of the TYPO3 Core API.

Tags
todo

When opening up the API for future TYPO3 versions, class should be made final and tests adjusted.

Table of Contents

Methods

__construct()  : mixed
findScannableFiles()  : array<int, string>
Collect PHP files below the given directory that can be handed to scanFile(), sorted by name.
scanFile()  : ScanResult
Scan a single file. A file that can not be parsed does not raise an exception: the result carries the parser message instead, so that scanning many files is not aborted by a single broken one.

Methods

findScannableFiles()

Collect PHP files below the given directory that can be handed to scanFile(), sorted by name.

public findScannableFiles(string $basePath) : array<int, string>
Parameters
$basePath : string
Tags
throws
RuntimeException

if the path is not a directory

Return values
array<int, string> —

absolute file paths

scanFile()

Scan a single file. A file that can not be parsed does not raise an exception: the result carries the parser message instead, so that scanning many files is not aborted by a single broken one.

public scanFile(string $absoluteFilePath) : ScanResult
Parameters
$absoluteFilePath : string
Tags
throws
RuntimeException

if the path is not a readable file

Return values
ScanResult
On this page

Search results