Automattic\WooCommerce\Internal\ProductAttributesLookup
CLIRunner::invoke
Invoke a method from the class, and if an exception is thrown, show it using WP_CLI::error.
Метод класса: CLIRunner{}
Хуков нет.
Возвращает
Разное. Result from the method, or 1 if an exception is thrown.
Использование
// private - только в коде основоного (родительского) класса $result = $this->invoke( $method_name, $args, $assoc_args );
- $method_name(строка) (обязательный)
- Name of the method to invoke.
- $args(массив) (обязательный)
- Positional arguments to pass to the method.
- $assoc_args(массив) (обязательный)
- Associative arguments to pass to the method.
Код CLIRunner::invoke() CLIRunner::invoke WC 10.3.6
private function invoke( string $method_name, array $args, array $assoc_args ) {
try {
return call_user_func( array( $this, $method_name ), $args, $assoc_args );
} catch ( \Exception $e ) {
WP_CLI::error( $e->getMessage() );
return 1;
}
}