PHP 클래스 Habari\Method

파일 보기 프로젝트 열기: habari/system

공개 프로퍼티들

프로퍼티 타입 설명
$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