Skip to content
Snippets Groups Projects
Select Git revision
  • 8b0cb0598fe584501aa5d334fe5cf951c3dc2b46
  • 11.x default protected
  • 11.2.x protected
  • 10.6.x protected
  • 10.5.x protected
  • 11.1.x protected
  • 10.4.x protected
  • 11.0.x protected
  • 10.3.x protected
  • 7.x protected
  • 10.2.x protected
  • 10.1.x protected
  • 9.5.x protected
  • 10.0.x protected
  • 9.4.x protected
  • 9.3.x protected
  • 9.2.x protected
  • 9.1.x protected
  • 8.9.x protected
  • 9.0.x protected
  • 8.8.x protected
  • 10.5.1 protected
  • 11.2.2 protected
  • 11.2.1 protected
  • 11.2.0 protected
  • 10.5.0 protected
  • 11.2.0-rc2 protected
  • 10.5.0-rc1 protected
  • 11.2.0-rc1 protected
  • 10.4.8 protected
  • 11.1.8 protected
  • 10.5.0-beta1 protected
  • 11.2.0-beta1 protected
  • 11.2.0-alpha1 protected
  • 10.4.7 protected
  • 11.1.7 protected
  • 10.4.6 protected
  • 11.1.6 protected
  • 10.3.14 protected
  • 10.4.5 protected
  • 11.0.13 protected
41 results

ServiceReferenceGraphNode.php

Blame
  • webchick's avatar
    Issue #2161397 by dawehner, tim.plunkett, Crell: Update to Symfony 2.4.1.
    Angie Byron authored
    8b0cb059
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    ServiceReferenceGraphNode.php 2.49 KiB
    <?php
    
    /*
     * This file is part of the Symfony package.
     *
     * (c) Fabien Potencier <fabien@symfony.com>
     *
     * For the full copyright and license information, please view the LICENSE
     * file that was distributed with this source code.
     */
    
    namespace Symfony\Component\DependencyInjection\Compiler;
    
    use Symfony\Component\DependencyInjection\Definition;
    use Symfony\Component\DependencyInjection\Alias;
    
    /**
     * Represents a node in your service graph.
     *
     * Value is typically a definition, or an alias.
     *
     * @author Johannes M. Schmitt <schmittjoh@gmail.com>
     */
    class ServiceReferenceGraphNode
    {
        private $id;
        private $inEdges = array();
        private $outEdges = array();
        private $value;
    
        /**
         * Constructor.
         *
         * @param string $id    The node identifier
         * @param mixed  $value The node value
         */
        public function __construct($id, $value)
        {
            $this->id = $id;
            $this->value = $value;
        }
    
        /**
         * Adds an in edge to this node.
         *
         * @param ServiceReferenceGraphEdge $edge
         */
        public function addInEdge(ServiceReferenceGraphEdge $edge)
        {
            $this->inEdges[] = $edge;
        }
    
        /**
         * Adds an out edge to this node.
         *
         * @param ServiceReferenceGraphEdge $edge
         */
        public function addOutEdge(ServiceReferenceGraphEdge $edge)
        {
            $this->outEdges[] = $edge;
        }
    
        /**
         * Checks if the value of this node is an Alias.
         *
         * @return Boolean True if the value is an Alias instance
         */
        public function isAlias()
        {
            return $this->value instanceof Alias;
        }
    
        /**
         * Checks if the value of this node is a Definition.
         *
         * @return Boolean True if the value is a Definition instance
         */
        public function isDefinition()
        {
            return $this->value instanceof Definition;
        }
    
        /**
         * Returns the identifier.
         *
         * @return string
         */
        public function getId()
        {
            return $this->id;
        }
    
        /**
         * Returns the in edges.
         *
         * @return array The in ServiceReferenceGraphEdge array
         */
        public function getInEdges()
        {
            return $this->inEdges;
        }
    
        /**
         * Returns the out edges.
         *
         * @return array The out ServiceReferenceGraphEdge array
         */
        public function getOutEdges()
        {
            return $this->outEdges;
        }
    
        /**
         * Returns the value of this Node
         *
         * @return mixed The value
         */
        public function getValue()
        {
            return $this->value;
        }
    }