class ValidatorsCommands (View source)

Methods

CommandError|null
validateEntityLoad(CommandData $commandData)

Validate that passed entity names are valid.

CommandError|null
validateModuleEnabled(Input $input, AnnotationData $annotationData)

Validate that passed module names are enabled. We use pre-init phase because interact() methods run early and they need to know that their module is enabled (e.g. image-flush).

CommandError|null
validateFileExists(CommandData $commandData)

Validate that the file path exists.

CommandError|null
validatePHPExtension(CommandData $commandData)

Validate that required PHP extension exists.

CommandError|null
validatePermissions(CommandData $commandData)

Validate that the permission exists.

Details

CommandError|null validateEntityLoad(CommandData $commandData)

Validate that passed entity names are valid.

Parameters

CommandData $commandData

Return Value

CommandError|null

See also

ViewsCommands::execute for an example.

CommandError|null validateModuleEnabled(Input $input, AnnotationData $annotationData)

Validate that passed module names are enabled. We use pre-init phase because interact() methods run early and they need to know that their module is enabled (e.g. image-flush).

Parameters

Input $input
AnnotationData $annotationData

Return Value

CommandError|null

See also

WatchdogCommands::show for an example.

CommandError|null validateFileExists(CommandData $commandData)

Validate that the file path exists.

Annotation value should be the name of the argument containing the path.

Parameters

CommandData $commandData

Return Value

CommandError|null

CommandError|null validatePHPExtension(CommandData $commandData)

Validate that required PHP extension exists.

Annotation value should be extension name. If multiple, delimit by a comma.

Parameters

CommandData $commandData

Return Value

CommandError|null

CommandError|null validatePermissions(CommandData $commandData)

Validate that the permission exists.

Annotation value should be the name of the argument/option containing the permission(s).

Parameters

CommandData $commandData

Return Value

CommandError|null