namespace Friendica\Console;
-use Friendica\BaseObject;
+use Friendica\Core\Config\Configuration;
/**
* Tired of chasing typos and finding them after a commit.
{
protected $helpOptions = ['h', 'help', '?'];
+ /**
+ * @var Configuration
+ */
+ private $config;
+
protected function getHelp()
{
$help = <<<HELP
return $help;
}
+ public function __construct(Configuration $config, array $argv = null)
+ {
+ parent::__construct($argv);
+
+ $this->config = $config;
+ }
+
protected function doExecute()
{
if ($this->getOption('v')) {
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');
}
}
+ 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');
}