src/Console/Helper/PathsHelper.php
public function getRelativeProjectPath(string $path): string
    {
        $realPath = $this->getAbsolutePath($path);
        $gitPath = $this->getAbsolutePath($this->getGitDir());

        if (0 !== strpos($realPath, $gitPath)) {
            return $realPath;
        }

        return rtrim($this->getRelativePath($realPath), '\\/');
    }
public function getRelativeProjectPath(string $path): string
    {
        $realPath = $this->getAbsolutePath($path);
        $gitPath = $this->getAbsolutePath($this->getGitDir());

        if (0 !== strpos($realPath, $gitPath)) {
            return $realPath;
        }

        return rtrim($this->getRelativePath($realPath), '\\/');
    }
public function getRelativeProjectPath ( string $ path ) : string { $ realPath = $ this -> getAbsolutePath ( $ path ) ; $ gitPath = $ this -> getAbsolutePath ( $ this -> getGitDir ( ) ) ; if ( 0 !== strpos ( $ realPath , $ gitPath ) ) { return $ realPath ; } return rtrim ( $ this -> getRelativePath ( $ realPath ) , '\\/' ) ; }
This method will return a relative path to a file of directory if it lives in the current project.
When the file is not located in the current project, the absolute path to the file is returned.


@throws FileNotFoundException
This method will return a relative path to a file of directory if it lives in the current project . When the file is not located in the current project the absolute path to the file is returned .