public static function createFromOutputLine(Repository $repository, string $outputLine)
    {
        $slices = static::getLineSlices($outputLine);
        $fullPath = $slices['fullPath'];
        if (false === $pos = mb_strrpos($fullPath, '/')) {
            // repository root
            $path = '';
            $name = $fullPath;
        } else {
            $path = substr($fullPath, 0, $pos);
            $name = substr($fullPath, $pos + 1);
        }

        return new static(
            $repository,
            $slices['permissions'],
            $slices['type'],
            $slices['sha'],
            $slices['size'],
            $name,
            $path
        );
    }
public static function createFromOutputLine(Repository $repository, string $outputLine)
    {
        $slices = static::getLineSlices($outputLine);
        $fullPath = $slices['fullPath'];
        if (false === $pos = mb_strrpos($fullPath, '/')) {
            // repository root
            $path = '';
            $name = $fullPath;
        } else {
            $path = substr($fullPath, 0, $pos);
            $name = substr($fullPath, $pos + 1);
        }

        return new static(
            $repository,
            $slices['permissions'],
            $slices['type'],
            $slices['sha'],
            $slices['size'],
            $name,
            $path
        );
    }
public static function createFromOutputLine ( Repository $ repository , string $ outputLine ) { $ slices = static :: getLineSlices ( $ outputLine ) ; $ fullPath = $ slices [ 'fullPath' ] ; if ( false === $ pos = mb_strrpos ( $ fullPath , '/' ) ) { // repository root $ path = '' ; $ name = $ fullPath ; } else { $ path = substr ( $ fullPath , 0 , $ pos ) ; $ name = substr ( $ fullPath , $ pos + 1 ) ; } return new static ( $ repository , $ slices [ 'permissions' ] , $ slices [ 'type' ] , $ slices [ 'sha' ] , $ slices [ 'size' ] , $ name , $ path ) ; }
create a Object from a single outputLine of the git ls-tree command

@param \GitElephant\Repository $repository repository instance
@param string                  $outputLine output from ls-tree command

@see LsTreeCommand::tree
@return NodeObject
create a Object from a single outputLine of the git ls - tree command