\duncan3dc\GitHubFile

Summary

Methods
Properties
Constants
fromTreeItem()
getName()
getSize()
getMode()
getHash()
getContents()
No public properties found
No constants found
No protected methods found
No protected properties found
N/A
__construct()
$api
$data
$contents
N/A

Properties

$data

$data : \stdClass

Type

\stdClass — The file's data.

$contents

$contents : string|null

Type

string|null — The file's contents.

Methods

fromTreeItem()

fromTreeItem(\stdClass  $item, \duncan3dc\GitHub\ApiInterface  $api) : \duncan3dc\GitHub\FileInterface

Create a new instance.

Parameters

\stdClass $item

The tree item data from the GitHub Api

\duncan3dc\GitHub\ApiInterface $api

The Api instance to communicate with GitHub

Returns

\duncan3dc\GitHub\FileInterface

getName()

getName() : string

Get the name of this file.

Returns

string

getSize()

getSize() : integer

Get the size of this file.

Returns

integer

getMode()

getMode() : string

Get the permissions and special mode flags of this file.

Returns

string

getHash()

getHash() : string

Get the hash of this file.

Returns

string

getContents()

getContents() : string

Download this file from GitHub.

Returns

string

__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