DiscordPHP Documentation

DynamicPropertyMutatorTrait

Tags
since
10.19.0

Table of Contents

Methods

__get()  : mixed
Handles dynamic get calls onto the part.
__set()  : void
Handles dynamic set calls onto the part.
checkForGetMutator()  : string|false
Checks if there is a get mutator present.
checkForSetMutator()  : string|false
Checks if there is a set mutator present.
getProperty()  : mixed
Gets a property on the parent part.
setProperty()  : void
Sets an property on the parent part.
studly()  : string
Converts a string to studlyCase.

Methods

__get()

Handles dynamic get calls onto the part.

public __get(string $key) : mixed
Parameters
$key : string

The attributes key.

Tags
throws
Exception
see
self::getAttribute()

This function forwards onto getAttribute.

Return values
mixed

The value of the attribute.

__set()

Handles dynamic set calls onto the part.

public __set(string $key, mixed $value) : void
Parameters
$key : string

The attributes key.

$value : mixed

The attributes value.

Tags
see
self::setAttribute()

This function forwards onto setAttribute.

checkForGetMutator()

Checks if there is a get mutator present.

private checkForGetMutator(string $key) : string|false
Parameters
$key : string

The property name to check.

Return values
string|false

Either a string if it is a method or false.

checkForSetMutator()

Checks if there is a set mutator present.

private checkForSetMutator(string $key) : string|false
Parameters
$key : string

The property name to check.

Return values
string|false

Either a string if it is a method or false.

getProperty()

Gets a property on the parent part.

private getProperty(string $key) : mixed
Parameters
$key : string

The name of the property.

Tags
throws
Exception
Return values
mixed

Either the property if it exists or void.

setProperty()

Sets an property on the parent part.

private setProperty(string $key, mixed $value) : void
Parameters
$key : string

The name of the property.

$value : mixed

The value of the property.

studly()

Converts a string to studlyCase.

private static studly(string $string) : string

This is a port of updated Laravel's implementation, a non-regex with static cache. This method is private static as we may move it outside this class in future.

Parameters
$string : string

The string to convert.

Tags
since
10.0.0
Return values
string

        
On this page

Search results