class Settings (View source)

This class provides a configuration container using magic methods for accessing and modifying properties. It utilizes traits for handling property access, setting, checking existence, and unsetting.

Methods:

  • __get(string $name): mixed: Magic getter method
  • __set(string $name, mixed $value): void: Magic setter method to dynamically set properties.
  • __isset(string $name): bool: This method is triggered by calling isset() or empty() on inaccessible (protected or private) or non-existing properties.
  • __unset(string $name): void: This method is invoked when unset() is used on inaccessible (protected or private) or non-existing properties.
  • __construct(array $property = []): Constructor to initialize the Settings object.
  • __debugInfo(): array: Magic method for debugging.

Fields:

  • $property: Stores properties for dynamic property access.

Traits

This trait provides a private array property intended for use with magic setter and getter methods.

This trait is utilized for reading data from inaccessible (protected or private) or non-existing properties.

This trait is run when writing data to inaccessible (protected or private) or non-existing properties.

This trait provides magic methods to handle __isset and unset operations on inaccessible or non-existing properties within a class.

This trait provides a private array property intended for use with magic setter and getter methods.

This trait provides a private array property intended for use with magic setter and getter methods.

This trait provides a private array property intended for use with magic setter and getter methods.

Methods

mixed
__get(string $name)

Magic method to get the value of inaccessible or non-existing properties.

from  Getter
void
__set(string $name, mixed $value)

This method is run when writing data to inaccessible (protected or private) or non-existing properties.

from  Setter
bool
__isset(string $name)

This method is triggered by calling isset() or empty() on inaccessible (protected or private) or non-existing properties.

from  Cleaner
void
__unset(string $name)

This method is invoked when unset() is used on inaccessible (protected or private) or non-existing properties.

from  Cleaner
__construct(array $property = [])

Constructor to initialize the Settings object.

array
__debugInfo()

Magic method for debugging.

Details

mixed __get(string $name)

Magic method to get the value of inaccessible or non-existing properties.

Parameters

string $name

Property name

Return Value

mixed

The property value

void __set(string $name, mixed $value)

This method is run when writing data to inaccessible (protected or private) or non-existing properties.

Parameters

string $name

Argument to be tested

mixed $value

The value to be defined

Return Value

void

bool __isset(string $name)

This method is triggered by calling isset() or empty() on inaccessible (protected or private) or non-existing properties.

Parameters

string $name

Argument to be tested

Return Value

bool

void __unset(string $name)

This method is invoked when unset() is used on inaccessible (protected or private) or non-existing properties.

Parameters

string $name

Argument to be tested

Return Value

void

__construct(array $property = [])

Constructor to initialize the Settings object.

Parameters

array $property

An array for initializing the property values.

array __debugInfo()

Magic method for debugging.

Returns the property array used for storing settings.

Return Value

array