PHP Класс Habari\Method

Показать файл Открыть проект

Открытые свойства

Свойство Тип Описание
$class
$method

Открытые методы

Метод Описание
__construct ( string $class, string $method ) : Method Constructor
__invoke ( ) : mixed Execute the representative method when this object is called as a function.
create ( string $class, string $method ) : Method Quick-create for building an instance of Method
dispatch ( Callable | string $method, mixed $multiple_optional_args = null ) : boolean | mixed Dispatch a method, whether a filter or function
dispatch_array ( Callable | string $method, array $args = [] ) : boolean | mixed Dispatch a method, whether a filter or function
exists ( ) : boolean Determine if the method exists and can be called
method_array ( ) : callable Get the array that represents this method

Описание методов

__construct() публичный Метод

Constructor
public __construct ( string $class, string $method ) : Method
$class string The name of the class
$method string The method of the class to execute
Результат Method The method of the class

__invoke() публичный Метод

Example: $fn = Method::create('Habari/Utils', 'debug'); $fn('foo'); // Calls Habari/Utils::debug('foo'); This magic method should not be called directly
public __invoke ( ) : mixed
Результат mixed The return value of the function this Method object represents

create() публичный статический Метод

Quick-create for building an instance of Method
public static create ( string $class, string $method ) : Method
$class string The name of the class
$method string The method of the class
Результат Method An instance of Method to represent the method call

dispatch() публичный статический Метод

Dispatch a method, whether a filter or function
public static dispatch ( Callable | string $method, mixed $multiple_optional_args = null ) : boolean | mixed
$method Callable | string The method to call
$multiple_optional_args mixed Multiple arguments to dispatch() should be passed as separate arguments
Результат boolean | mixed The return value from the dispatched method

dispatch_array() публичный статический Метод

Dispatch a method, whether a filter or function
public static dispatch_array ( Callable | string $method, array $args = [] ) : boolean | mixed
$method Callable | string The method to call
$args array An array of arguments to be passed to the method
Результат boolean | mixed The return value from the dispatched method

exists() публичный Метод

Determine if the method exists and can be called
public exists ( ) : boolean
Результат boolean true if the method exists

method_array() публичный Метод

Get the array that represents this method
public method_array ( ) : callable
Результат callable An array that can be used as a function (O_o)

Описание свойств

$class публичное свойство

public $class

$method публичное свойство

public $method