ComponentCheckCommands
extends AbstractCommands
in package
Command class for toolkit:component-check.
Tags
Table of Contents
Properties
- $abandonedFailed : bool
- $composerFailed : bool
- $composerLock : array<string|int, mixed>
- $composerOutdated : array<string|int, mixed>
- $configurationFailed : bool
- $devCompRequireFailed : bool
- $disabledConfigReadonly : bool
- $evaluationFailed : bool
- $forcedUpdateModule : bool
- $insecureFailed : bool
- $insecureNpmFailed : bool
- $io : mixed
- $mandatoryFailed : bool
- $optsYml : array<string|int, mixed>
- $outdatedFailed : bool
- $outdatedNpmFailed : bool
- $packageReviews : array<string|int, mixed>
- $recommendedFailed : bool
- $recommendedFailedCount : int
- $skipAbandoned : bool
- $skipInsecure : bool
- $skipInsecureNpm : bool
- $skipOutdated : bool
- $skipOutdatedNpm : bool
- $skipRecommended : bool
- $skipUnsupported : bool
- $unsupportedFailed : bool
Methods
- componentAbandoned() : mixed
- Check abandoned components.
- componentCheck() : mixed
- Check composer for components that are not whitelisted/blacklisted.
- componentComposer() : mixed
- Check composer packages.
- componentConfiguration() : mixed
- Check project configuration.
- componentDevelopment() : mixed
- Check development components.
- componentEvaluation() : mixed
- Check Evaluation components.
- componentInsecure() : mixed
- Check insecure components.
- componentMandatory() : mixed
- Check mandatory components.
- componentNpmInsecure() : mixed
- Run NPM Insecure.
- componentNpmOutdated() : mixed
- Run NPM Outdated.
- componentOutdated() : mixed
- Check outdated components.
- componentRecommended() : mixed
- Check recommended components.
- componentUnsupported() : mixed
- Check unsupported components.
- 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.
- 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.
- isJunit() : bool
- Check whether Junit option is being used, or env var is set.
- isSimulating() : bool
- Check if current command is being executed with option simulate.
- prepareSkips() : void
- Prepare the overrides from config and commit message.
- printComponentResults() : mixed
- Print the component check results.
- taskExecute() : mixed
- Execute a command.
- taskProcess() : mixed
- Process the file.
- taskReplaceBlock() : mixed
- Replace block in a file.
- validateComponent() : mixed
- Helper function to validate the component.
- validateEnvironmentVariables() : mixed
- Component Configuration Helper - Validate environment variables.
- addJunitResult() : void
- Add a result to junit if it is enabled.
- disableConfigReadOnly() : mixed
- Ensure that config_readonly is not active by commenting the config line.
- getFailedOrPassed() : string
- If given bool is TRUE 'failed' is return, otherwise 'passed'.
- getOptsYml() : array<string|int, mixed>
- Returns the .opts.yml content.
- getProjectProfile() : string
- Load given project from website and return the profile in the production env.
- getRecommendedWarningMessage() : string
- Returns the recommended components warning message.
- getReleases() : array<string|int, mixed>
- Returns the modules releases.
- loadComposerLock() : bool
- Loads the composer lock packages.
- loadComposerOutdated() : bool
- Loads the composer outdated results.
- loadWebsitePackages() : bool
- Loads the packages from the website.
- restoreConfigReadOnly() : mixed
- Restore the comment added to the config_readonly setting.
- testPackages() : array<string|int, mixed>
- Returns a list of packages to test.
Properties
$abandonedFailed
protected
bool
$abandonedFailed
= false
$composerFailed
protected
bool
$composerFailed
= false
$composerLock
protected
array<string|int, mixed>
$composerLock
$composerOutdated
protected
array<string|int, mixed>
$composerOutdated
$configurationFailed
protected
bool
$configurationFailed
= false
$devCompRequireFailed
protected
bool
$devCompRequireFailed
= false
$disabledConfigReadonly
protected
bool
$disabledConfigReadonly
= false
$evaluationFailed
protected
bool
$evaluationFailed
= false
$forcedUpdateModule
protected
bool
$forcedUpdateModule
= false
$insecureFailed
protected
bool
$insecureFailed
= false
$insecureNpmFailed
protected
bool
$insecureNpmFailed
= false
$io
protected
mixed
$io
$mandatoryFailed
protected
bool
$mandatoryFailed
= false
$optsYml
protected
array<string|int, mixed>
$optsYml
$outdatedFailed
protected
bool
$outdatedFailed
= false
$outdatedNpmFailed
protected
bool
$outdatedNpmFailed
= false
$packageReviews
protected
array<string|int, mixed>
$packageReviews
$recommendedFailed
protected
bool
$recommendedFailed
= false
$recommendedFailedCount
protected
int
$recommendedFailedCount
= 0
$skipAbandoned
protected
bool
$skipAbandoned
= false
$skipInsecure
protected
bool
$skipInsecure
= false
$skipInsecureNpm
protected
bool
$skipInsecureNpm
= true
$skipOutdated
protected
bool
$skipOutdated
= false
$skipOutdatedNpm
protected
bool
$skipOutdatedNpm
= true
$skipRecommended
protected
bool
$skipRecommended
= false
$skipUnsupported
protected
bool
$skipUnsupported
= false
$unsupportedFailed
protected
bool
$unsupportedFailed
= false
Methods
componentAbandoned()
Check abandoned components.
public
componentAbandoned(ConsoleIO $io) : mixed
Parameters
- $io : ConsoleIO
Tags
componentCheck()
Check composer for components that are not whitelisted/blacklisted.
public
componentCheck(ConsoleIO $io[, array<string|int, mixed> $options = ['endpoint' => InputOption::VALUE_REQUIRED, 'test-command' => false] ]) : mixed
Parameters
- $io : ConsoleIO
- $options : array<string|int, mixed> = ['endpoint' => InputOption::VALUE_REQUIRED, 'test-command' => false]
Tags
componentComposer()
Check composer packages.
public
componentComposer(ConsoleIO $io) : mixed
Parameters
- $io : ConsoleIO
Tags
componentConfiguration()
Check project configuration.
public
componentConfiguration(ConsoleIO $io) : mixed
Parameters
- $io : ConsoleIO
Tags
componentDevelopment()
Check development components.
public
componentDevelopment(ConsoleIO $io) : mixed
Parameters
- $io : ConsoleIO
Tags
componentEvaluation()
Check Evaluation components.
public
componentEvaluation(ConsoleIO $io) : mixed
Parameters
- $io : ConsoleIO
Tags
componentInsecure()
Check insecure components.
public
componentInsecure(ConsoleIO $io) : mixed
Parameters
- $io : ConsoleIO
Tags
componentMandatory()
Check mandatory components.
public
componentMandatory(ConsoleIO $io) : mixed
Parameters
- $io : ConsoleIO
Tags
componentNpmInsecure()
Run NPM Insecure.
public
componentNpmInsecure() : mixed
Tags
componentNpmOutdated()
Run NPM Outdated.
public
componentNpmOutdated() : mixed
Tags
componentOutdated()
Check outdated components.
public
componentOutdated(ConsoleIO $io) : mixed
Parameters
- $io : ConsoleIO
Tags
componentRecommended()
Check recommended components.
public
componentRecommended(ConsoleIO $io) : mixed
Parameters
- $io : ConsoleIO
Tags
componentUnsupported()
Check unsupported components.
public
componentUnsupported(ConsoleIO $io) : mixed
Parameters
- $io : ConsoleIO
Tags
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
boolgetBin()
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.
isJunit()
Check whether Junit option is being used, or env var is set.
protected
isJunit() : bool
Return values
boolisSimulating()
Check if current command is being executed with option simulate.
protected
isSimulating() : bool
Return values
bool —True if using --simulate, false otherwise.
prepareSkips()
Prepare the overrides from config and commit message.
protected
prepareSkips() : void
printComponentResults()
Print the component check results.
protected
printComponentResults(ConsoleIO $io) : mixed
Parameters
- $io : ConsoleIO
Tags
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.
validateComponent()
Helper function to validate the component.
protected
validateComponent(array<string|int, mixed> $package) : mixed
Parameters
- $package : array<string|int, mixed>
-
The package to validate.
Tags
validateEnvironmentVariables()
Component Configuration Helper - Validate environment variables.
protected
validateEnvironmentVariables() : mixed
Tags
addJunitResult()
Add a result to junit if it is enabled.
private
addJunitResult(string $testCase, string $message[, string $type = 'error' ]) : void
All test case will be added to the test suite 'Component check'.
Parameters
- $testCase : string
-
The name of the test.
- $message : string
-
The message for the failure.
- $type : string = 'error'
-
The type of failure.
Tags
disableConfigReadOnly()
Ensure that config_readonly is not active by commenting the config line.
private
disableConfigReadOnly() : mixed
getFailedOrPassed()
If given bool is TRUE 'failed' is return, otherwise 'passed'.
private
getFailedOrPassed(bool $value) : string
Parameters
- $value : bool
-
The value to check.
Return values
stringgetOptsYml()
Returns the .opts.yml content.
private
getOptsYml() : array<string|int, mixed>
Return values
array<string|int, mixed>getProjectProfile()
Load given project from website and return the profile in the production env.
private
getProjectProfile(string $projectId) : string
Parameters
- $projectId : string
-
The project to use in the endpoint.
Return values
stringgetRecommendedWarningMessage()
Returns the recommended components warning message.
private
getRecommendedWarningMessage() : string
Return values
stringgetReleases()
Returns the modules releases.
private
getReleases() : array<string|int, mixed>
If the update module is not enabled, it will be enabled, and later disabled.
Return values
array<string|int, mixed>loadComposerLock()
Loads the composer lock packages.
private
loadComposerLock() : bool
Return values
boolloadComposerOutdated()
Loads the composer outdated results.
private
loadComposerOutdated() : bool
Return values
boolloadWebsitePackages()
Loads the packages from the website.
private
loadWebsitePackages() : bool
Return values
boolrestoreConfigReadOnly()
Restore the comment added to the config_readonly setting.
private
restoreConfigReadOnly() : mixed
testPackages()
Returns a list of packages to test.
private
testPackages() : array<string|int, mixed>
Return values
array<string|int, mixed> —An array with packages to test.