]> git.mxchange.org Git - friendica.git/blobdiff - src/Console/DocBloxErrorChecker.php
Fix test
[friendica.git] / src / Console / DocBloxErrorChecker.php
index 4393e99b18c43e65552492a3ab0a6821f5fc58ba..9e9eb149707fda267daf779cd97b8782609ca510 100644 (file)
@@ -1,7 +1,28 @@
 <?php
+/**
+ * @copyright Copyright (C) 2010-2022, the Friendica project
+ *
+ * @license GNU AGPL version 3 or any later version
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
 
 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.
@@ -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 <hypolite@mrpetovan.com>
  */
 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 = <<<HELP
@@ -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 = [];