X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FTypo.php;h=1397f6092fa97f7b39d29ff90673ad90e5b83562;hb=2c33a7803e6fc998fe05f3564c79b3e90cd10c5b;hp=5f5fa0ba6876667ed2a4bd945ddf8606aa08ca9a;hpb=c9cce8492e5b2607b2a092474d1de4d188b7a2c9;p=friendica.git diff --git a/src/Console/Typo.php b/src/Console/Typo.php index 5f5fa0ba68..1397f6092f 100644 --- a/src/Console/Typo.php +++ b/src/Console/Typo.php @@ -1,19 +1,41 @@ . + * + */ namespace Friendica\Console; -use Friendica\BaseObject; +use Friendica\Core\Config\Capability\IManageConfigValues; /** * Tired of chasing typos and finding them after a commit. * Run this and quickly see if we've got any parse errors in our application files. - * - * @author Hypolite Petovan */ class Typo extends \Asika\SimpleConsole\Console { protected $helpOptions = ['h', 'help', '?']; + /** + * @var IManageConfigValues + */ + private $config; + protected function getHelp() { $help = <<config = $config; + } + protected function doExecute() { if ($this->getOption('v')) { @@ -43,7 +72,7 @@ HELP; throw new \Asika\SimpleConsole\CommandArgsException('Too many arguments'); } - $php_path = BaseObject::getApp()->getConfigCache()->get('config', 'php_path', 'php'); + $php_path = $this->config->get('config', 'php_path', 'php'); if ($this->getOption('v')) { $this->out('Directory: src'); @@ -57,6 +86,18 @@ HELP; } } + if ($this->getOption('v')) { + $this->out('Directory: tests'); + } + + $Iterator = new \RecursiveDirectoryIterator('tests'); + + foreach (new \RecursiveIteratorIterator($Iterator) as $file) { + if (substr($file, -4) === '.php') { + $this->checkFile($php_path, $file); + } + } + if ($this->getOption('v')) { $this->out('Directory: mod'); }