1 | <?php |
||
28 | class Edge extends AbstractElement { |
||
29 | |||
30 | /** |
||
31 | * @var Node |
||
32 | */ |
||
33 | public $sourceNode; |
||
34 | |||
35 | /** |
||
36 | * @var Node |
||
37 | */ |
||
38 | public $destinationNode; |
||
39 | |||
40 | /** |
||
41 | * Optional port name on source Node. |
||
42 | * |
||
43 | * @var string |
||
44 | */ |
||
45 | public $sourcePort = null; |
||
46 | |||
47 | /** |
||
48 | * Optional port name on destination Node. |
||
49 | * |
||
50 | * @var string |
||
51 | */ |
||
52 | public $destinationPort = null; |
||
53 | |||
54 | /** |
||
55 | * Edge need a unique id. |
||
56 | * |
||
57 | * This is because, multiple edges may exist between the same vertices, |
||
58 | * port included. |
||
59 | * |
||
60 | * @var int |
||
61 | */ |
||
62 | public static $sequence = 0; |
||
63 | |||
64 | /** |
||
65 | * @var boolean |
||
66 | */ |
||
67 | public $fDirected = true; |
||
68 | |||
69 | /** |
||
70 | * @param \Pimple\Container $dic |
||
71 | * @param \Grafizzi\Graph\Node $source |
||
72 | * @param \Grafizzi\Graph\Node $destination |
||
73 | * @param array $attributes |
||
74 | * @param string $sourcePort |
||
75 | * @param string $destinationPort |
||
76 | * |
||
77 | * @throws \InvalidArgumentException |
||
78 | */ |
||
79 | 26 | public function __construct(Container $dic, Node $source, Node $destination, |
|
95 | |||
96 | /** |
||
97 | * @param boolean $directed |
||
98 | * |
||
99 | * @return string |
||
100 | */ |
||
101 | 23 | public function build($directed = null) { |
|
122 | |||
123 | 1 | public static function getAllowedChildTypes() { |
|
126 | |||
127 | 26 | public function getType() { |
|
131 | } |
||
132 |
In PHP, under loose comparison (like
==
, or!=
, orswitch
conditions), values of different types might be equal.For
string
values, the empty string''
is a special case, in particular the following results might be unexpected: