Automattic\WooCommerce\Internal\DependencyManagement
AbstractServiceProvider::get_class()
Gets the class of a parameter.
This method is a replacement for ReflectionParameter::getClass, which is deprecated as of PHP 8.
{} Это метод класса: AbstractServiceProvider{}
Хуков нет.
Возвращает
\ReflectionClass|null
. The class of the parameter, or null if it hasn't any.
Использование
// private - только в коде основоного (родительского) класса $result = $this->get_class( $parameter );
- $parameter(\ReflectionParameter) (обязательный)
- The parameter to get the class for.
Код AbstractServiceProvider::get_class() AbstractServiceProvider::get class WC 6.6.1
private function get_class( \ReflectionParameter $parameter ) { // TODO: Remove this 'if' block once minimum PHP version for WooCommerce is bumped to at least 7.1. if ( version_compare( PHP_VERSION, '7.1', '<' ) ) { return $parameter->getClass(); } return $parameter->getType() && ! $parameter->getType()->isBuiltin() ? new \ReflectionClass( $parameter->getType()->getName() ) : null; }