AxeCommands
extends AbstractCommands
in package
Commands to interact with the axe-scan.
Tags
Table of Contents
Properties
- $dependencies : array<string|int, mixed>|array<string|int, string>
- A list of dependencies for axe-scan.
Methods
- getConfigurationFile() : mixed
- Path to YAML configuration file containing command defaults.
- getJson() : array<string|int, mixed>
- Returns the JSON parsed content.
- getWorkingDir() : string
- Returns the current working directory.
- isWebsiteInstalled() : bool
- Check if the website is installed.
- toolkitRunAxeScan() : mixed
- Run the axe-scan.
- toolkitRunAxeScanSummary() : mixed
- Run the axe-scan summary.
- toolkitSetupAxeScan() : mixed
- Make sure axe-scan is installed and properly configured.
- getBin() : string
- Validate and return the path to given bin.
- getBinPath() : string
- Return the path to given bin.
- getConfigValue() : mixed
- {@inheritdoc}
- getNodeBin() : string
- Validate and return the path to given bin from node packages.
- getNodeBinPath() : string
- Return the path to given bin from node packages.
- isSimulating() : bool
- Check if current command is being executed with option simulate.
- taskExecute() : mixed
- Execute a command.
- taskProcess() : mixed
- Process the file.
- taskReplaceBlock() : mixed
- Replace block in a file.
Properties
$dependencies
A list of dependencies for axe-scan.
private
array<string|int, mixed>|array<string|int, string>
$dependencies
= [
// cspell:disable .
'libnss3-tools',
'libatk1.0-0',
'libatk-bridge2.0-0',
'libdrm2',
'libxcomposite1',
'libxdamage1',
'libxfixes3',
'libxrandr2',
'libgbm1',
'libxkbcommon-x11-0',
'libpangocairo-1.0-0',
'libasound2',
'fonts-liberation',
'libgcc1',
'libxss1',
'libgtk-3-0',
'libx11-xcb1',
'libxcursor1',
'xdg-utils',
]
Methods
getConfigurationFile()
Path to YAML configuration file containing command defaults.
public
getConfigurationFile() : mixed
Command classes should implement this method.
getJson()
Returns the JSON parsed content.
public
getJson(string $filename[, mixed $throwException = true ]) : array<string|int, mixed>
Parameters
- $filename : string
- $throwException : mixed = true
Return values
array<string|int, mixed>getWorkingDir()
Returns the current working directory.
public
getWorkingDir() : string
Return values
string —The current working directory.
isWebsiteInstalled()
Check if the website is installed.
public
isWebsiteInstalled() : bool
Return values
booltoolkitRunAxeScan()
Run the axe-scan.
public
toolkitRunAxeScan() : mixed
Tags
toolkitRunAxeScanSummary()
Run the axe-scan summary.
public
toolkitRunAxeScanSummary() : mixed
Tags
toolkitSetupAxeScan()
Make sure axe-scan is installed and properly configured.
public
toolkitSetupAxeScan() : mixed
Tags
getBin()
Validate and return the path to given bin.
protected
getBin(string $name) : string
Parameters
- $name : string
-
The bin to look for.
Tags
Return values
string —The bin path.
getBinPath()
Return the path to given bin.
protected
getBinPath(string $name) : string
Parameters
- $name : string
Return values
string —The path to given binary.
getConfigValue()
{@inheritdoc}
protected
getConfigValue(mixed $key[, mixed $default = null ]) : mixed
Parameters
- $key : mixed
- $default : mixed = null
getNodeBin()
Validate and return the path to given bin from node packages.
protected
getNodeBin(string $name) : string
Parameters
- $name : string
-
The bin to look for.
Tags
Return values
string —The bin path.
getNodeBinPath()
Return the path to given bin from node packages.
protected
getNodeBinPath(string $name) : string
Parameters
- $name : string
Return values
string —The path to given binary.
isSimulating()
Check if current command is being executed with option simulate.
protected
isSimulating() : bool
Return values
bool —True if using --simulate, false otherwise.
taskExecute()
Execute a command.
protected
taskExecute(array<string|int, mixed> $tasks) : mixed
Parameters
- $tasks : array<string|int, mixed>
-
An array with tasks to execute.
taskProcess()
Process the file.
protected
taskProcess(string $source[, string $destination = '' ]) : mixed
Parameters
- $source : string
-
The source file to process.
- $destination : string = ''
-
The destination file.
taskReplaceBlock()
Replace block in a file.
protected
taskReplaceBlock([string $filename = '' ]) : mixed
Parameters
- $filename : string = ''
-
The file to process.