LocalizationFinder
        
        extends BaseCommand
    
    
            
            in package
            
        
    
    
    
BaseCommand is the base class used in creating CLI commands.
Tags
Table of Contents
Properties
- $commands : Commands
- $logger : LoggerInterface
- $arguments : array<string, string>
- the Command's Arguments description
- $description : string
- the Command's short description
- $group : string
- The group the command is lumped under when listing commands.
- $name : string
- The Command's name
- $options : array<string, string>
- the Command's options description
- $usage : string
- the Command's usage description
- $languagePath : string
- $showNew : bool
- Flag for showing only translations, without saving
- $verbose : bool
- Flag for output detailed information
Methods
- __construct() : mixed
- __get() : array<string, string>|Commands|LoggerInterface|string|null
- Makes it simple to access our protected properties.
- __isset() : bool
- Makes it simple to check our protected properties.
- getPad() : int
- Get pad for $key => $value array output
- run() : int|void
- Actually execute a command.
- setPad() : string
- Pads our string out so that all titles are the same length to nicely line up descriptions.
- showHelp() : void
- Show Help includes (Usage, Arguments, Description, Options).
- call() : int|void
- Can be used by a command to run other commands.
- showError() : void
- A simple method to display an error with line/file, in child commands.
- arrayToTableRows() : array<string|int, mixed>
- Convert multi arrays to specific CLI table rows (flat array)
- buildMultiArray() : array<string|int, mixed>
- Create multidimensional array from another keys
- 
    findLanguageKeysInFiles()
    
                                 : array{'foundLanguageKeys': array>, 'badLanguageKeys': array >, 'countFiles': int} 
- findTranslationsInFile() : array<string, array<string|int, mixed>>
- isIgnoredFile() : bool
- isSubDirectory() : bool
- process() : void
- replaceArraySyntax() : string
- templateFile() : string
- writeIsVerbose() : void
- Show details in the console if the flag is set
Properties
$commands
        public
            Commands
    $commands
    
    
    
    
    
    
$logger
        public
            LoggerInterface
    $logger
    
    
    
    
    
    
$arguments
the Command's Arguments description
        protected
            array<string, string>
    $arguments
     = []
    
    
    
    
    
$description
the Command's short description
        protected
            string
    $description
     = 'Find and save available phrases to translate.'
    
    
    
    
    
$group
The group the command is lumped under when listing commands.
        protected
            string
    $group
     = 'Translation'
    
    
    
    
    
$name
The Command's name
        protected
            string
    $name
     = 'lang:find'
    
    
    
    
    
$options
the Command's options description
        protected
            array<string, string>
    $options
     = ['--locale' => 'Specify locale (en, ru, etc.) to save files.', '--dir' => 'Directory to search for translations relative to APPPATH.', '--show-new' => 'Show only new translations in table. Does not write to files.', '--verbose' => 'Output detailed information.']
    
    
    
    
    
$usage
the Command's usage description
        protected
            string
    $usage
     = 'lang:find [options]'
    
    
    
    
    
$languagePath
        private
            string
    $languagePath
    
    
    
    
    
    
$showNew
Flag for showing only translations, without saving
        private
            bool
    $showNew
     = false
    
    
    
    
    
$verbose
Flag for output detailed information
        private
            bool
    $verbose
     = false
    
    
    
    
    
Methods
__construct()
    public
                    __construct(LoggerInterface $logger, Commands $commands) : mixed
    Parameters
- $logger : LoggerInterface
- $commands : Commands
__get()
Makes it simple to access our protected properties.
    public
                    __get(string $key) : array<string, string>|Commands|LoggerInterface|string|null
    Parameters
- $key : string
Return values
array<string, string>|Commands|LoggerInterface|string|null__isset()
Makes it simple to check our protected properties.
    public
                    __isset(string $key) : bool
    Parameters
- $key : string
Return values
boolgetPad()
Get pad for $key => $value array output
    public
                    getPad(array<string, string> $array, int $pad) : int
    Use setPad() instead.
Parameters
- $array : array<string, string>
- $pad : int
Tags
Return values
intrun()
Actually execute a command.
    public
                    run(array<string|int, mixed> $params) : int|void
    Parameters
- $params : array<string|int, mixed>
Return values
int|voidsetPad()
Pads our string out so that all titles are the same length to nicely line up descriptions.
    public
                    setPad(string $item, int $max[, int $extra = 2 ][, int $indent = 0 ]) : string
    Parameters
- $item : string
- $max : int
- $extra : int = 2
- 
                    How many extra spaces to add at the end 
- $indent : int = 0
Return values
stringshowHelp()
Show Help includes (Usage, Arguments, Description, Options).
    public
                    showHelp() : void
    call()
Can be used by a command to run other commands.
    protected
                    call(string $command[, array<int|string, string|null> $params = [] ]) : int|void
    Parameters
- $command : string
- $params : array<int|string, string|null> = []
Tags
Return values
int|voidshowError()
A simple method to display an error with line/file, in child commands.
    protected
                    showError(Throwable $e) : void
    Parameters
- $e : Throwable
arrayToTableRows()
Convert multi arrays to specific CLI table rows (flat array)
    private
                    arrayToTableRows(string $langFileName, array<string|int, mixed> $array) : array<string|int, mixed>
    Parameters
- $langFileName : string
- $array : array<string|int, mixed>
Return values
array<string|int, mixed>buildMultiArray()
Create multidimensional array from another keys
    private
                    buildMultiArray(array<string|int, mixed> $fromKeys[, string $lastArrayValue = '' ]) : array<string|int, mixed>
    Parameters
- $fromKeys : array<string|int, mixed>
- $lastArrayValue : string = ''
Return values
array<string|int, mixed>findLanguageKeysInFiles()
    private
                    findLanguageKeysInFiles(array<int, SplFileInfo> $files) : array{'foundLanguageKeys': array>, 'badLanguageKeys': array>, 'countFiles': int}  
    Parameters
- $files : array<int, SplFileInfo>
Return values
array{'foundLanguageKeys': arrayfindTranslationsInFile()
    private
                    findTranslationsInFile(SplFileInfo|string $file) : array<string, array<string|int, mixed>>
    Parameters
- $file : SplFileInfo|string
Return values
array<string, array<string|int, mixed>>isIgnoredFile()
    private
                    isIgnoredFile(SplFileInfo $file) : bool
    Parameters
- $file : SplFileInfo
Return values
boolisSubDirectory()
    private
                    isSubDirectory(string $directory, string $rootDirectory) : bool
    Parameters
- $directory : string
- $rootDirectory : string
Return values
boolprocess()
    private
                    process(string $currentDir, string $currentLocale) : void
    Parameters
- $currentDir : string
- $currentLocale : string
replaceArraySyntax()
    private
                    replaceArraySyntax(string $code) : string
    Parameters
- $code : string
Return values
stringtemplateFile()
    private
                    templateFile([array<string|int, mixed> $language = [] ]) : string
    Parameters
- $language : array<string|int, mixed> = []
Return values
stringwriteIsVerbose()
Show details in the console if the flag is set
    private
                    writeIsVerbose([string $text = '' ][, string|null $foreground = null ][, string|null $background = null ]) : void
    Parameters
- $text : string = ''
- $foreground : string|null = null
- $background : string|null = null