Find the correct php documentor path

@return null|string
333774
private function findPhpDocumentorPath()
    {
        $phpDocumentorPath = null;
        $directories = ['phpDocumentor', 'phpdocumentor'];
        foreach ($directories as $directory) {
            foreach (Phing::explodeIncludePath() as $path) {
                $testPhpDocumentorPath = $path . DIRECTORY_SEPARATOR . $directory . DIRECTORY_SEPARATOR . 'src';
                if (file_exists($testPhpDocumentorPath)) {
                    $phpDocumentorPath = $testPhpDocumentorPath;
                }
            }
        }

        return $phpDocumentorPath;
    }
1221851
public function determineFromPath()
    {
        $releaseStage = null;
        // Create paths variable with host name, document root and file path
        $httpHost = isset($_SERVER['HTTP_HOST']) ? $_SERVER['HTTP_HOST'] : '';
        $documentRoot = isset($_SERVER['DOCUMENT_ROOT']) ? $_SERVER['DOCUMENT_ROOT'] : '';
        $paths = __DIR__ . $httpHost . $documentRoot;

        // Now check if paths variable contains "stage" or "staging" keywords
        if (strpos($paths, 'stage') !== false || strpos($paths, 'staging') !== false) {
            // Set release stage to staging
            $releaseStage = self::STAGING;
        } elseif (strpos(__FILE__, '/home') !== false && strpos(__FILE__, 'vhosts') !== false) {
            //Check for dev environment that works with cli scripts
            $releaseStage = self::DEVELOPMENT;
        } elseif (substr($httpHost, -6) == '.local' || substr($httpHost, -4) == '.dev') {
            $releaseStage = self::DEVELOPMENT;
        }
        return $releaseStage;
    }
213914
public function getBuildPath()
    {
        if (!$this->getId()) {
            return null;
        }

        if (empty($this->currentBuildPath)) {
            $buildDirectory = $this->getId() . '_' . substr(md5(microtime(true)), 0, 5);
            $this->currentBuildPath = PHPCI_BUILD_ROOT_DIR . $buildDirectory . DIRECTORY_SEPARATOR;
        }

        return $this->currentBuildPath;
    }
703064
public function getAbsolutePath()
    {
        if (empty($this->mount) && is_null($this->path)) {
            return null;
        }

        if (empty($this->mount)) {
            return $this->path;
        }

        return $this->mount . "/" . $this->path;
    }
1320051
public function getDestinationWebPath()
    {
        if (!empty($this->web_root_path)) {
            return str_replace($this->web_root_path, '', $this->getDestinationRealPath());
        } elseif (false===$this->silent) {
            throw new \LogicException(
                '[Compressor] Can\'t create web path because "web_root_path" is not defined!'
            );
        }
        return null;
    }
1173767
private function getHttpPath(): ?string
    {
        $path = null;

        if (isset($_SERVER['REQUEST_URI'])) {
            $path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
        }

        return $path;
    }
85773
public function doClearPath()
    {
        if (
            $this->not_cleared_path &&
            $this->getStorage() instanceof Storage &&
            $this->getStorage()->getPath() &&
            strpos($this->not_cleared_path, $this->getStorage()->getPath()) === 0
        ) {
            $this->path = substr($this->not_cleared_path, strlen($this->getStorage()->getPath()));
            $this->not_cleared_path = '';
        }
    }
1012741
public function getDocumentation()
    {
        $documentation = null;
        $documentationNodes = $this->element->getElementsByTagName('documentation');
        if ($documentationNodes->length > 0) {
            $documentation = $documentationNodes->item(0)->nodeValue;
        }
        return $documentation;
    }
825132
private function _get_path()
    {

        if (empty($this->file) && is_string($this->file)) return false;

        if (strpos($this->file, '/') !== false) {
            $path = explode('/', $this->file);
            array_pop($path);
            $this->path = (string)implode('/', $path) . '/';
        } elseif (strpos('\\', $this->file) !== false) {
            $path = explode('\\', $this->file);
            array_pop($path);
            $this->path = (string)implode('\\', $path) . '\\';
        } else {
            $this->path = getcwd() . '/';
        }

        return true;
    }
362771
private static function find($path)
    {
        $view_path = null;
        foreach (self::$directories as $directory) {
            $formatted_path = self::formatPath($directory . '/' . $path);
            if (self::isValidPath($formatted_path)) {
                $view_path = $formatted_path;
                break;
            }
        }
        
        if (empty($view_path)) {
            if (self::$report_errors) {
                die('View not found: ' . $view_path);
            }
            return null;
        }
        
        return $view_path;
    }
1132272
protected function get_script_path()
    {
        if( null == $this->script_path )
        {
            $class_name =  substr( get_called_class() , strrpos( get_called_class(), '\\') + 1);
            $this->script_path = $this->get_dir() . '/' . $class_name . '.phtml';
        }
        return $this->script_path;
    }
1344763
public function getHelperPath($helper)
    {
        if ($this->finder) {
            if (file_exists($file = $this->finder->find($helper))) {
                return $file;
            }
        }

        if (file_exists($helper)) {
            return $helper;
        } elseif (file_exists($helper . '.helper.php')) {
            return $helper . '.helper.php';
        }

        foreach ($this->viewPaths as $viewPath) {
            if (file_exists($viewPath . '/helpers/' . $helper . '.helper.php')) {
                return $viewPath . '/helpers/' . $helper . '.helper.php';
            }
        }

        return null;
    }
96043
protected function getPropertyFilepaths()
    {
        $file = $this->basename.'.properties';

        if($this->MessageService->fileExists($file))
            return $this->MessageService->resolveFile($file)->getLocalPath();

        return null;
    }
1725
public function getDocumentRootPath()
    {
        /**
         * The absolute pathname of the currently executing script.
         * Notatka: If a script is executed with the CLI, as a relative path, such as file.php or ../file.php,
         * $_SERVER['SCRIPT_FILENAME'] will contain the relative path specified by the user.
         */
        if (isset($_SERVER['SCRIPT_FILENAME'])) {
            $sRealPath = dirname($_SERVER['SCRIPT_FILENAME']);
        }
        else {
            /**
             * realpath — Returns canonicalized absolute pathname
             */
            $sRealPath = realpath('.') ;
        }

        $sRealPath = $this->trimPathTrailingSlashes($sRealPath);

        /**
         * The filename of the currently executing script, relative to the document root.
         * For instance, $_SERVER['PHP_SELF'] in a script at the address http://example.com/test.php/foo.bar
         * would be /test.php/foo.bar.
         */
        $sSelfPath = dirname($_SERVER['PHP_SELF']);
        $sSelfPath = $this->trimPathTrailingSlashes($sSelfPath);

        return $this->trimPathTrailingSlashes(substr($sRealPath, 0, strlen($sRealPath) - strlen($sSelfPath)));
    }
118062
public function documentRoot() {
        if ($this->documentRoot == null) {
            $this->documentRoot = isset($this->serverVariables['DOCUMENT_ROOT']) ? $this->serverVariables['DOCUMENT_ROOT'] : substr(PHPMVC_ROOT_PATH, 0, -1);
        }

        return $this->documentRoot;
    }
483794
public static function path()
    {
        $url = '';

        // Get the rest of the URL
        if (!Arr::key('REQUEST_URI', $_SERVER)) {
            // Microsoft IIS doesn't set REQUEST_URI by default
            if ($queryString = Arr::key('QUERY_STRING', $_SERVER, true)) {
                $url .= '?' . $queryString;
            }
        } else {
            $url .= $_SERVER['REQUEST_URI'];
        }

        return $url ?: null;
    }
847798
public function getPathFilename()
    {
        $path = $this->getPath();

        if ($this->isInternal()) {
            return $this->serverRoot.$path;
        }

        $path = $this->documentRoot.$path;

        if (is_dir($path) === true) {
            $path .= '/index.html';
        }

        return preg_replace('/\/\/+/', '/', $path);
    }