Automattic\WooCommerce\Vendor\League\Container\Inflector
Inflector::inflect() public WC 1.0
{@inheritdoc}
{} It's a method of the class: Inflector{}
No Hooks.
Return
Null. Nothing.
Usage
$Inflector = new Inflector(); $Inflector->inflect( $object );
- $object (required)
- -
Code of Inflector::inflect() Inflector::inflect WC 5.0.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);
}
}