Code Coverage
 
Classes and Traits
Functions and Methods
Lines
Total
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
3 / 3
CRAP
100.00% covered (success)
100.00%
5 / 5
Edge
100.00% covered (success)
100.00%
1 / 1
100.00% covered (success)
100.00%
3 / 3
3
100.00% covered (success)
100.00%
5 / 5
 __construct(Vertex $from, Vertex $to)
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
3 / 3
 getSource()
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
 getTarget()
100.00% covered (success)
100.00%
1 / 1
1
100.00% covered (success)
100.00%
1 / 1
<?php
/*
 * Mondrian
 */
namespace Trismegiste\Mondrian\Graph;
/**
 * Edge is a directed edge
 */
class Edge
{
    protected $to;
    protected $from;
    /**
     * Since edge has one source vertex and one target vertex
     * it is builded with two vertices in its constructor
     *
     * @param Vertex $from
     * @param Vertex $to
     */
    public function __construct(Vertex $from, Vertex $to)
    {
        $this->from = $from;
        $this->to = $to;
    }
    /**
     * Get the source vertex
     *
     * @return Vertex
     */
    public function getSource()
    {
        return $this->from;
    }
    /**
     * Get the target vertex
     *
     * @return Vertex
     */
    public function getTarget()
    {
        return $this->to;
    }
}