helpers/Builder.php
public static function build(array $pointer, array $context)
    {
        if (array_key_exists('value', $pointer)) {
            return $pointer['value'];
        }
        if (!empty($pointer['classname'])) {
            $classname = NameResolver::resolve($pointer['classname'], $context);
            return self::buildByClassname($classname, $pointer, $context);
        }
        if (!empty($pointer['creator'])) {
            return Callback::call($pointer['creator'], [$pointer, $context]);
        }
        if (!empty($context['classname'])) {
            return self::buildByClassname($context['classname'], $pointer, $context);
        }
        if (!empty($context['creator'])) {
            return Callback::call($context['creator'], [$pointer, $context]);
        }
        throw new InvalidPointer('');
    }
public static function build(array $pointer, array $context)
    {
        if (array_key_exists('value', $pointer)) {
            return $pointer['value'];
        }
        if (!empty($pointer['classname'])) {
            $classname = NameResolver::resolve($pointer['classname'], $context);
            return self::buildByClassname($classname, $pointer, $context);
        }
        if (!empty($pointer['creator'])) {
            return Callback::call($pointer['creator'], [$pointer, $context]);
        }
        if (!empty($context['classname'])) {
            return self::buildByClassname($context['classname'], $pointer, $context);
        }
        if (!empty($context['creator'])) {
            return Callback::call($context['creator'], [$pointer, $context]);
        }
        throw new InvalidPointer('');
    }
public static function build ( array $ pointer , array $ context ) { if ( array_key_exists ( 'value' , $ pointer ) ) { return $ pointer [ 'value' ] ; } if ( ! empty ( $ pointer [ 'classname' ] ) ) { $ classname = NameResolver :: resolve ( $ pointer [ 'classname' ] , $ context ) ; return self :: buildByClassname ( $ classname , $ pointer , $ context ) ; } if ( ! empty ( $ pointer [ 'creator' ] ) ) { return Callback :: call ( $ pointer [ 'creator' ] , [ $ pointer , $ context ] ) ; } if ( ! empty ( $ context [ 'classname' ] ) ) { return self :: buildByClassname ( $ context [ 'classname' ] , $ pointer , $ context ) ; } if ( ! empty ( $ context [ 'creator' ] ) ) { return Callback :: call ( $ context [ 'creator' ] , [ $ pointer , $ context ] ) ; } throw new InvalidPointer ( '' ) ; }
Builds an object by the pointer

@param array $pointer
the normalized pointer
@param array $context
the normalized context
@return mixed
the target object
@throws \axy\creator\errors\InvalidPointer
Builds an object by the pointer