src/Model/Git/Tree.php
public function getObject($path)
    {
        if ($path === '' || $path === '.') {
            return $this;
        }
        $data = $this->getObjectData($path);
        if ($data === false) {
            return false;
        }

        if ($data['type'] === 'blob') {
            return Blob::fromSha($data['sha'], $this->getUri(), $this->client);
        } elseif ($data['type'] === 'tree') {
            return Tree::fromSha($data['sha'], $this->getUri(), $this->client);
        }

        throw new \RuntimeException('Unrecognised object type: ' . $data['type']);
    }
public function getObject($path)
    {
        if ($path === '' || $path === '.') {
            return $this;
        }
        $data = $this->getObjectData($path);
        if ($data === false) {
            return false;
        }

        if ($data['type'] === 'blob') {
            return Blob::fromSha($data['sha'], $this->getUri(), $this->client);
        } elseif ($data['type'] === 'tree') {
            return Tree::fromSha($data['sha'], $this->getUri(), $this->client);
        }

        throw new \RuntimeException('Unrecognised object type: ' . $data['type']);
    }
public function getObject ( $ path ) { if ( $ path === '' || $ path === '.' ) { return $ this ; } $ data = $ this -> getObjectData ( $ path ) ; if ( $ data === false ) { return false ; } if ( $ data [ 'type' ] === 'blob' ) { return Blob :: fromSha ( $ data [ 'sha' ] , $ this -> getUri ( ) , $ this -> client ) ; } elseif ( $ data [ 'type' ] === 'tree' ) { return Tree :: fromSha ( $ data [ 'sha' ] , $ this -> getUri ( ) , $ this -> client ) ; } throw new \ RuntimeException ( 'Unrecognised object type: ' . $ data [ 'type' ] ) ; }
Get an object in this tree.

@param string $path The path to an object in the tree.

@return Blob|Tree|false
A Blob or Tree object, or false if the object does not exist.
Get an object in this tree .