\duncan3dc\GitHubTree

Summary

Methods
Properties
Constants
fromApiResponse()
getDirectories()
getDirectory()
hasDirectory()
getFiles()
getFile()
hasFile()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
__construct()
$api
$data
N/A

Properties

$data

$data : \stdClass

Type

\stdClass — The tree's data.

Methods

fromApiResponse()

fromApiResponse(\stdClass  $data, \duncan3dc\GitHub\ApiInterface  $api) : \duncan3dc\GitHub\TreeInterface

Create a new instance.

Parameters

\stdClass $data

The tree's data from the GitHub Api

\duncan3dc\GitHub\ApiInterface $api

The Api instance to communicate with GitHub

Returns

\duncan3dc\GitHub\TreeInterface

getDirectories()

getDirectories() : \duncan3dc\GitHub\iterable|array<mixed,\duncan3dc\GitHub\DirectoryInterface>

Get the subdirectories in this directory.

Returns

\duncan3dc\GitHub\iterable|array<mixed,\duncan3dc\GitHub\DirectoryInterface>

getDirectory()

getDirectory(\duncan3dc\GitHub\string  $name) : \duncan3dc\GitHub\DirectoryInterface

Get a directory by its name.

Parameters

\duncan3dc\GitHub\string $name

The name of the directory

Returns

\duncan3dc\GitHub\DirectoryInterface

hasDirectory()

hasDirectory(\duncan3dc\GitHub\string  $name) : boolean

Check if a directory exists.

Parameters

\duncan3dc\GitHub\string $name

The name of the directory

Returns

boolean

getFiles()

getFiles() : \duncan3dc\GitHub\iterable|array<mixed,\duncan3dc\GitHub\FileInterface>

inheritDoc

Returns

\duncan3dc\GitHub\iterable|array<mixed,\duncan3dc\GitHub\FileInterface>

getFile()

getFile(\duncan3dc\GitHub\string  $name) : \duncan3dc\GitHub\FileInterface

Get a file by its name.

Parameters

\duncan3dc\GitHub\string $name

The name of the file

Returns

\duncan3dc\GitHub\FileInterface

hasFile()

hasFile(\duncan3dc\GitHub\string  $name) : boolean

Check if a file exists.

Parameters

\duncan3dc\GitHub\string $name

The name of the file

Returns

boolean

__construct()

__construct(\stdClass  $data, \duncan3dc\GitHub\ApiInterface  $api) 

Create a new instance.

Parameters

\stdClass $data

The tree's data from the GitHub Api

\duncan3dc\GitHub\ApiInterface $api

The Api instance to communicate with GitHub