public function getEdge(array $edge)
    {
        foreach ($this->instructions as $instruction) {
            if (!$instruction instanceof Edge) {
                continue;
            }

            if ($instruction->getList() == $edge) {
                return $instruction;
            }
        }

        $label = implode(' -> ', array_map(function ($edge) {
            if (is_string($edge)) {
                return $edge;
            }

            return implode(':', $edge);
        }, $edge));

        throw new \InvalidArgumentException(sprintf('Found no edge "%s".', $label));
    }
public function getEdge(array $edge)
    {
        foreach ($this->instructions as $instruction) {
            if (!$instruction instanceof Edge) {
                continue;
            }

            if ($instruction->getList() == $edge) {
                return $instruction;
            }
        }

        $label = implode(' -> ', array_map(function ($edge) {
            if (is_string($edge)) {
                return $edge;
            }

            return implode(':', $edge);
        }, $edge));

        throw new \InvalidArgumentException(sprintf('Found no edge "%s".', $label));
    }
public function getEdge ( array $ edge ) { foreach ( $ this -> instructions as $ instruction ) { if ( ! $ instruction instanceof Edge ) { continue ; } if ( $ instruction -> getList ( ) == $ edge ) { return $ instruction ; } } $ label = implode ( ' -> ' , array_map ( function ( $ edge ) { if ( is_string ( $ edge ) ) { return $ edge ; } return implode ( ':' , $ edge ) ; } , $ edge ) ) ; throw new \ InvalidArgumentException ( sprintf ( 'Found no edge "%s".' , $ label ) ) ; }
Returns an edge by its path.

@param (string|string[])[] a path

@return Edge

@throws InvalidArgumentException path not found
Returns an edge by its path .