Tools
class Tools
Contains functions for miscellaneous tasks.
Constants
| BG_BLACK |
Value for background black. |
| BG_RED |
Value for background red. |
| BG_GREEN |
Value for background green. |
| BG_YELLOW |
Value for background yellow. |
| BG_BLUE |
Value for background blue. |
| BG_MAGENTA |
Value for background magenta. |
| BG_CYAN |
Value for background cyan. |
| BG_LIGHT_GREY |
Value for background light grey |
| TEXT_BLACK |
Value for text black. |
| TEXT_WHITE |
Value for text white. |
| TEXT_DARK_GREY |
Value for text dark grey. |
| TEXT_RED |
Value for text red. |
| TEXT_GREEN |
Value for text green. |
| TEXT_BROWN |
Value for text brown. |
| TEXT_YELLOW |
Value for text yellow. |
| TEXT_BLUE |
Value for text blue. |
| TEXT_MAGENTA |
Value for text magenta. |
| TEXT_CYAN |
Value for text cyan. |
| TEXT_LIGHT_CYAN |
Value for text light cyan. |
| TEXT_LIGHT_GREY |
Value for text light grey. |
| TEXT_LIGHT_RED |
Value for text light red. |
| TEXT_LIGHT_GREEN |
Value for text light green. |
| TEXT_LIGHT_BLUE |
Value for text light blue. |
| TEXT_LIGHT_MAGENTA |
Value for text light magenta. |
Properties
| static private OutputInterface|null | $output | Supports ability to log information to console. |
Methods
Returns dashed border.
Creates a directory. It checks if it already exists. If not, user is asked to confirm the want to create a new directory.
Checks if input is in dot notation. If in dot notation the string is placed in an array where the first index is the directory name. The second element is the file name. The structure is shown below:
Checks if value for background color or text color matches list of available constants.
Generates output messages for console commands.
Tests if a path exits and creates it if necessary.
Enables output for symfony.
Generates files for console commands
Details
at line 80
static string
border()
Returns dashed border.
at line 92
static int
createDirWithPrompt(string $directory, InputInterface $cmdInput, OutputInterface $cmdOutput)
Creates a directory. It checks if it already exists. If not, user is asked to confirm the want to create a new directory.
at line 141
static array|int
dotNotationVerify(string $inputName, InputInterface $input)
Checks if input is in dot notation. If in dot notation the string is placed in an array where the first index is the directory name. The second element is the file name. The structure is shown below:
["directory_name","file_name"]
If not in the
at line 169
static private bool
hasConstant(string $value, string $type)
Checks if value for background color or text color matches list of available constants.
at line 199
static void
info(string $message, string $level = Logger::INFO, string $background = self::BG_GREEN, string $text = self::TEXT_LIGHT_GREY)
Generates output messages for console commands.
at line 232
static void
pathExists(string $path, int $permissions = 0755, bool $recursive = true)
Tests if a path exits and creates it if necessary.
at line 244
static void
setOutput(OutputInterface $output)
Enables output for symfony.
at line 256
static int
writeFile(string $path, string $content, string $name)
Generates files for console commands