{@inheritdoc}

@return EvolvableLinkInterface
333621
public function withHref($href)
    {
        /** @var EvolvableLinkInterface $that */
        $that = clone($this);
        $that->href = $href;

        $that->templated = ($this->hrefIsTemplated($href));

        return $that;
    }
841080
protected function bindSentryProvider()
    {
        $this->app->singleton('revisionable.userprovider', function ($app) {
            $field = $app['config']->get('revisionable.userfield');
            return new Adapters\Sentry($app['sentry'], $field);
        });
    }
1169849
private function getOrmTargetEntityResolverNode()
    {
        $treeBuilder = new TreeBuilder('resolve_target_entities');

        if (method_exists($treeBuilder, 'getRootNode')) {
            $node = $treeBuilder->getRootNode();
        } else {
            // BC layer for symfony/config 4.1 and older
            $node = $treeBuilder->root('resolve_target_entities');
        }

        $node
            ->useAttributeAsKey('interface')
            ->prototype('scalar')
                ->cannotBeEmpty()
            ->end();

        return $node;
    }
199618
public function add(DefinitionInterface $definition): Endpoint
    {
        if ($definition instanceof MutationDefinition) {
            return $this->addMutation($definition);
        }

        if ($definition instanceof QueryDefinition) {
            return $this->addQuery($definition);
        }

        return $this->addType($definition);
    }
1215352
public function link($destination, $args = [])
	{
		// edit start
		if (!$this->_createRequestMethodReflection) {
			$this->_createRequestMethodReflection = new \ReflectionMethod(Presenter::class, 'createRequest');
			$this->_createRequestMethodReflection->setAccessible(true);
			$this->_handleInvalidLinkMethodReflection = new \ReflectionMethod(Presenter::class, 'handleInvalidLink');
			$this->_handleInvalidLinkMethodReflection->setAccessible(true);
		}

		try {
			$args = func_num_args() < 3 && is_array($args) ? $args : array_slice(func_get_args(), 1);
			return $this->_createRequestMethodReflection->invoke($this->getPresenter(), $this, $destination, $args, 'link');

		} catch (InvalidLinkException $e) {
			$this->_handleInvalidLinkMethodReflection->invoke($e);
		}
		// edit end
	}
1158676
protected function createObjectUsingFactory(Binding $binding, InjectionPointInterface $point = NULL)
	{
		$callback = $binding->getTarget();
		
		if(is_array($callback))
		{
			$callback = [$this->get($callback[0]), $callback[1]];
			$ref = new \ReflectionMethod(get_class($callback[0]), $callback[1]);
		}
		else
		{
			$ref = new \ReflectionFunction($callback);
		}
		
		$resolvers = (array)$binding->getResolvers();
		
		// Special case: inject config of the type to be created into the factory:
		foreach($ref->getParameters() as $param)
		{
			if($this->getParamType($param) === Configuration::class)
			{
				$resolvers[$param->name] = $this->config->getConfig(str_replace('\\', '.', $binding->getTypeName()));
			}
		}
		
		$args = $this->populateArguments($ref, 0, $resolvers, $point);
			
		switch(count($args))
		{
			case 0:
				$object = $callback();
				break;
			case 1:
				$object = $callback($args[0]);
				break;
			case 2:
				$object = $callback($args[0], $args[1]);
				break;
			case 3:
				$object = $callback($args[0], $args[1], $args[2]);
				break;
			case 4:
				$object = $callback($args[0], $args[1], $args[2], $args[3]);
				break;
			default:
				$object = call_user_func_array($callback, $args);
		}
		
		if($object instanceof ScopedProxyInterface)
		{
			return $object;
		}
		
		$object = $this->initialize($object);
		
		foreach($binding->getMarkers(SetterInjection::class) as $setter)
		{
			$this->performSetterInjection($object, $setter);
		}
		
		$initializers = $binding->getInitializers();
		
		if(!empty($initializers))
		{
			$object = $this->invokeBindingInitializers($binding->getTypeName(), $object, $initializers);
		}
			
		return $object;
	}
823918
protected static function getConfigResolver()
    {
        if ( self::$configResolver == null )
        {
            self::init();
        }
        if ( self::$configResolver == null )
        {
            throw new RuntimeException( 'resolver not injected' );
        }
        return self::$configResolver;
    }
763394
public function getResolver()/*# : ParameterInterface */
    {
        if (!$this->hasResolver()) {
            throw new NotFoundException(
                Message::get(Message::PARAM_RESOLVER_MISS),
                Message::PARAM_RESOLVER_MISS
            );
        }
        return $this->resolver;
    }
518795
public function LinkOrCurrent()
    {
        $isCurrent = null;
        $this->extend('updateLinkOrCurrent', $isCurrent);
        if ($isCurrent) {
            return $this->config()->get('linking_mode_current');
        } else {
            return $this->config()->get('linking_mode_default');
        }
    }
946396
public function withReadableLink(bool $readableLink): self
    {
        $metadata = clone $this;
        $metadata->readableLink = $readableLink;

        return $metadata;
    }
41265
public function return(): \Pho\Lib\Graph\EntityInterface
    {
        if($this->predicate()->consumer()) {
            return $this->head()->node();
        }
        return $this;
    }
1208830
public function duplicate(string $name = null): LinkInterface
    {
        $link = new self($name ?? $this->name(), $this->href());
        $link->metaInformation()->mergeCollection($this->metaInformation());

        return $link;
    }
551193
function &_resolveLink()
    {
        $phpdoctor = $this->_root->phpdoctor();
        $matches = array();
        $return = NULL;
        $packageRegex = '[a-zA-Z0-9_\x7f-\xff .\\\\-]+';
        $labelRegex = '[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*';
        $regex = '/^\\\\?(?:('.$packageRegex.')[.\\\\])?(?:('.$labelRegex.')(?:#|::))?\$?('.$labelRegex.')(?:\(\))?$/';
        if (preg_match($regex, $this->_link, $matches)) {
            $packageName = $matches[1];
            $className = $matches[2];
            $elementName = $matches[3];

            if ($packageName) { // get package
                $package =& $this->_root->packageNamed($packageName);
                if (!$package) {
                    return $return;
                }
            }
            if ($className) { // get class
                if (isset($package)) {
                    $classes =& $package->allClasses();
                } else {
                    $classes =& $this->_root->classes();
                }
                if ($classes) {
                    foreach ($classes as $key => $class) {
                        if ($class->name() == $className) {
                            break;
                        }
                    }
                    $class =& $classes[$key];
                }
            }
            if ($elementName) { // get element
                if (isset($class)) { // from class
                    $methods =& $class->methods();
                    if ($methods) {
                        foreach ($methods as $key => $method) {
                            if ($method->name() == $elementName) {
                                $element =& $methods[$key];
                                break;
                            }
                        }
                    }
                    if (!isset($element)) {
                        $fields =& $class->fields();
                        if ($fields) {
                            foreach ($fields as $key => $field) {
                                if ($field->name() == $elementName) {
                                    $element =& $fields[$key];
                                    break;
                                }
                            }
                        }
                    }
                } elseif (isset($package)) { // from package
                    $classes =& $package->allClasses();
                    foreach ($classes as $key => $class) {
                        if ($class->name() == $elementName) {
                            $element =& $classes[$key];
                            break;
                        }
                        $methods =& $class->methods();
                        if ($methods) {
                            foreach ($methods as $key => $method) {
                                if ($method->name() == $elementName) {
                                    $element =& $methods[$key];
                                    break 2;
                                }
                            }
                        }
                        if (!isset($element)) {
                            $fields =& $class->fields();
                            if ($fields) {
                                foreach ($fields as $key => $field) {
                                    if ($field->name() == $elementName) {
                                        $element =& $fields[$key];
                                        break 2;
                                    }
                                }
                            }
                        }
                    }
                    if (!isset($element)) {
                        $functions =& $package->functions();
                        if ($functions) {
                            foreach ($functions as $key => $function) {
                                if ($function->name() == $elementName) {
                                    $element =& $functions[$key];
                                    break;
                                }
                            }
                        }
                        if (!isset($element)) {
                            $globals =& $package->globals();
                            if ($globals) {
                                foreach ($globals as $key => $global) {
                                    if ($global->name() == $elementName) {
                                        $element =& $globals[$key];
                                        break;
                                    }
                                }
                            }
                        }
                    }
                } else { // from anywhere
                    $classes =& $this->_root->classes();
                    if ($classes) {
                        foreach ($classes as $key => $class) {
                            if ($class->name() == $elementName) {
                                $element =& $classes[$key];
                                break;
                            }
                            $methods =& $class->methods();
                            if ($methods) {
                                foreach ($methods as $key => $method) {
                                    if ($method->name() == $elementName) {
                                        $element =& $methods[$key];
                                        break 2;
                                    }
                                }
                            }
                            if (!isset($element)) {
                                $fields =& $class->fields();
                                if ($fields) {
                                    foreach ($fields as $key => $field) {
                                        if ($field->name() == $elementName) {
                                            $element =& $fields[$key];
                                            break 2;
                                        }
                                    }
                                }
                            }
                        }
                    }
                    if (!isset($element)) {
                        $functions =& $this->_root->functions();
                        if ($functions) {
                            foreach ($functions as $key => $function) {
                                if ($function->name() == $elementName) {
                                    $element =& $functions[$key];
                                    break;
                                }
                            }
                        }
                        if (!isset($element)) {
                            $globals =& $this->_root->globals();
                            if ($globals) {
                                foreach ($globals as $key => $global) {
                                    if ($global->name() == $elementName) {
                                        $element =& $globals[$key];
                                        break;
                                    }
                                }
                            }
                        }
                    }
                }
            }
            $return =& $element;
        }

        return $return;
    }
490388
public function linkable($create = true, $edit = true)
    {
        $this->linkOnly = true;
        parent::writeable($create, $edit);
        return $this;
    }
989298
public function build(): AddBindingRequest
	{
		$instance = new AddBindingRequest();
		if ($this->name === null) {
			throw new BuilderException('Property [name] is required.');
		}
		$instance->name = $this->name;
		$instance->executionContextId = $this->executionContextId;
		return $instance;
	}
1156863
public function normalizeLink(string $path, $object, NormalizerContextInterface $context)
    {
        $callback = $this->callback;

        $link = $callback($path, $object, $context);

        if (null === $link) {
            return null;
        }

        if (!$link instanceof LinkInterface) {
            $type = is_object($link) ? get_class($link) : gettype($link);

            throw SerializerLogicException::createInvalidLinkTypeReturned($path, $type);
        }

        return [
            'href' => $link->getHref(),
            'templated' => $link->isTemplated(),
            'rel' => $link->getRels(),
            'attributes' => $link->getAttributes(),
        ];
    }
34673
@Override
	protected ControllerEntityLinks createInstance() {

		Collection<Class<?>> controllerTypes = new HashSet<>();

		for (Class<?> controllerType : getBeanTypesWithAnnotation(annotation)) {
			if (AnnotationUtils.findAnnotation(controllerType, ExposesResourceFor.class) != null) {
				controllerTypes.add(controllerType);
			}
		}

		return new ControllerEntityLinks(controllerTypes, linkBuilderFactory);
	}