X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FConsole%2FDocBloxErrorChecker.php;h=7028de8a1355103f34cc77e6d68b588bec7ea93c;hb=d4a5a8051ad34a7be72238967afb3e6b140afdc8;hp=4393e99b18c43e65552492a3ab0a6821f5fc58ba;hpb=4dcdc56e8173d6db3410014fa4c4ae3445a2436d;p=friendica.git diff --git a/src/Console/DocBloxErrorChecker.php b/src/Console/DocBloxErrorChecker.php index 4393e99b18..7028de8a13 100644 --- a/src/Console/DocBloxErrorChecker.php +++ b/src/Console/DocBloxErrorChecker.php @@ -1,7 +1,28 @@ . + * + */ namespace Friendica\Console; +use Friendica\App; + /** * When I installed docblox, I had the experience that it does not generate any output at all. * This script may be used to find that kind of problems with the documentation build process. @@ -9,7 +30,7 @@ namespace Friendica\Console; * * Basically, docblox takes a list of files to build documentation from. This script assumes there is a file or set of files * breaking the build when it is included in that list. It tries to calculate the smallest list containing these files. - * Unfortunatly, the original problem is NP-complete, so what the script does is a best guess only. + * Unfortunately, the original problem is NP-complete, so what the script does is a best guess only. * * So it starts with a list of all files in the project. * If that list can't be build, it cuts it in two parts and tries both parts independently. If only one of them breaks, @@ -20,15 +41,22 @@ namespace Friendica\Console; * After that, the script tries to remove a file from the list. It tests if the list breaks and if so, it * assumes that the file it removed belongs to the set of erroneous files. * This is done for all files, so, in the end removing one file leads to a working doc build. - * - * @author Alexander Kampmann - * @author Hypolite Petovan */ class DocBloxErrorChecker extends \Asika\SimpleConsole\Console { protected $helpOptions = ['h', 'help', '?']; + /** @var App */ + private $app; + + public function __construct(App $app, array $argv = null) + { + parent::__construct($argv); + + $this->app = $app; + } + protected function getHelp() { $help = <<getOption('v')) { $this->out('Class: ' . __CLASS__); @@ -59,7 +87,7 @@ HELP; throw new \RuntimeException('DocBlox isn\'t available.'); } - $dir = \get_app()->getBasePath(); + $dir = $this->app->getBasePath(); //stack for dirs to search $dirstack = [];