Strata\Shell\Command\StrataCommandBase

Base class for Shell Command reflection.

This class contains a basic toolset to perform repetitive visual outputs.
It is also the interface between Strata and Symfony's codebase.

    Synopsis

    class StrataCommandBase extends Command {
    • // members
    • protected string $tree_line = " ├── ";
    • protected string $tree_end = " └── ";
    • public InputInterface $input = null;
    • public OutputInterface $output = null;
    }

    Hierarchy

    Extends

    • Symfony\Component\Console\Command\Command

    Members

    protected

    • $tree_end — string
      The bottom part of a tree representation prefix.
    • $tree_line — string
      A tree representation prefix.

    public

    Methods

    protected

    public

    • factory()
    • fail() — Creates a visual representation of a failed status. This is useful when performing an action that can be skipped or succeed.
    • generateClassPath() — Generates a possible namespace and classname combination of a Strata controller. Mainly used to avoid hardcoding the '\\Shell\\Command\\' string everywhere.
    • nl() — Return a new line.
    • ok() — Creates a visual representation of an OK status. This is useful when performing an action that can fail or be skipped.
    • shutdown() — The shutdown function should be called each time a command has completed execution.
    • startup() — The startup function should be called each time a command is being executed. It saves the Input and Output interfaces to allow the command to use it further down the process.
    • tree() — Creates a visual representation of a tree branch. This is useful when generating a list of files.