ProjectFile
in package
implements
SerializableContract
uses
Serializable
AbstractYes
Filesystem abstraction for a file stored in the project.
Table of Contents
Interfaces
- SerializableContract
- Specifies that a class can be serialized to an array and/or JSON.
Properties
- $path : string
Methods
- __construct() : mixed
- arraySerialize() : array<string|int, mixed>
- Recursively serialize Arrayables
- getAbsolutePath() : string
- getContents() : string
- getExtension() : string
- getName() : string
- getPath() : string
- jsonSerialize() : array<string|int, mixed>
- make() : static
- toArray() : array{name: string, path: string}
- Get the instance as an array.
- toJson() : string
- automaticallySerialize() : array<string|int, mixed>
- Automatically serialize all public properties.
Properties
$path read-only
public
string
$path
The path relative to the project root.
Tags
Methods
__construct()
public
__construct(string $path) : mixed
Parameters
- $path : string
arraySerialize()
Recursively serialize Arrayables
public
arraySerialize() : array<string|int, mixed>
Return values
array<string|int, mixed>getAbsolutePath()
public
getAbsolutePath() : string
Return values
stringgetContents()
public
getContents() : string
Return values
stringgetExtension()
public
getExtension() : string
Return values
stringgetName()
public
getName() : string
Return values
stringgetPath()
public
getPath() : string
Return values
stringjsonSerialize()
public
jsonSerialize() : array<string|int, mixed>
Tags
Return values
array<string|int, mixed>make()
public
static make(string $path) : static
Parameters
- $path : string
Return values
statictoArray()
Get the instance as an array.
public
toArray() : array{name: string, path: string}
Return values
array{name: string, path: string}toJson()
public
toJson([int $options = 0 ]) : string
Parameters
- $options : int = 0
Return values
stringautomaticallySerialize()
Automatically serialize all public properties.
protected
automaticallySerialize() : array<string|int, mixed>