Automattic\WooCommerce\Vendor\League\Container\Inflector

Inflector::inflect()publicWC 1.0

{@inheritdoc}

Метод класса: Inflector{}

Хуков нет.

Возвращает

null. Ничего (null).

Использование

$Inflector = new Inflector();
$Inflector->inflect( $object );
$object (обязательный)
-

Код Inflector::inflect() WC 8.7.0

public function inflect($object)
{
    $properties = $this->resolveArguments(array_values($this->properties));
    $properties = array_combine(array_keys($this->properties), $properties);

    // array_combine() can technically return false
    foreach ($properties ?: [] as $property => $value) {
        $object->{$property} = $value;
    }

    foreach ($this->methods as $method => $args) {
        $args = $this->resolveArguments($args);

        /** @var callable $callable */
        $callable = [$object, $method];
        call_user_func_array($callable, $args);
    }

    if ($this->callback !== null) {
        call_user_func($this->callback, $object);
    }
}