class Inspector (View source)

Class that extracts information from package controller.php files.

Properties

protected Filesystem $fs

The Filesystem instance to be used for filesystem operations.

private Parser[]|null $parsers

The list of registered parsers.

Methods

__construct(Filesystem $fs, array $parsers)

No description

$this
addParser(Parser $parser)

Add a parser to the parsers list.

getParsers()

Get the parsers list.

inspectPackageDirectory(string $directory)

Extract the package details from the directory containing the package controller.php file.

inspectControllerFile(string $filename)

Extract the package details reading its controller.php file.

inspectControllerContent(string|mixed $content)

Extract the package details analyzing the contents of its controller.php file.

determineParser(array $tokens)

Analyze the tokens to determine the analyzer to be used.

Details

__construct(Filesystem $fs, array $parsers)

No description

Parameters

Filesystem $fs
array $parsers

$this addParser(Parser $parser)

Add a parser to the parsers list.

Parameters

Parser $parser

Return Value

$this

getParsers()

Get the parsers list.

\Concrete\Core\Package\Offline\Parser[]

PackageInfo inspectPackageDirectory(string $directory)

Extract the package details from the directory containing the package controller.php file.

Parameters

string $directory

the directory containing the package controller.php file

Return Value

PackageInfo

Exceptions

Exception

PackageInfo inspectControllerFile(string $filename)

Extract the package details reading its controller.php file.

Parameters

string $filename

the path to the package controller.php file

Return Value

PackageInfo

Exceptions

Exception

PackageInfo inspectControllerContent(string|mixed $content)

Extract the package details analyzing the contents of its controller.php file.

Parameters

string|mixed $content

the content of the package controller.php file

Return Value

PackageInfo

Exceptions

Exception

protected Parser determineParser(array $tokens)

Analyze the tokens to determine the analyzer to be used.

Parameters

array $tokens

Return Value

Parser

Exceptions

Exception