11<?php
2+ declare (strict_types=1 );
3+
24/**
35 * phpDocumentor
46 *
2224 */
2325class Edge
2426{
25- /** @var \phpDocumentor\GraphViz\ Node Node from where to link */
27+ /** @var Node Node from where to link */
2628 protected $ from = null ;
2729
28- /** @var \phpDocumentor\GraphViz\ Node Node where to to link */
30+ /** @var Node Node where to to link */
2931 protected $ to = null ;
3032
31- /** @var \phpDocumentor\GraphViz\ Attribute[] List of attributes for this edge */
33+ /** @var Attribute[] List of attributes for this edge */
3234 protected $ attributes = [];
3335
3436 /**
3537 * Creates a new Edge / Link between the given nodes.
3638 *
37- * @param \phpDocumentor\GraphViz\ Node $from Starting node to create an Edge from.
38- * @param \phpDocumentor\GraphViz\ Node $to Destination node where to create and
39+ * @param Node $from Starting node to create an Edge from.
40+ * @param Node $to Destination node where to create and
3941 * edge to.
4042 */
4143 public function __construct (Node $ from , Node $ to )
@@ -49,33 +51,27 @@ public function __construct(Node $from, Node $to)
4951 *
5052 * See the examples for more details.
5153 *
52- * @param \phpDocumentor\GraphViz\Node $from Starting node to create an Edge from.
53- * @param \phpDocumentor\GraphViz\Node $to Destination node where to create and
54- * edge to.
55- *
56- * @return \phpDocumentor\GraphViz\Edge
54+ * @param Node $from Starting node to create an Edge from.
55+ * @param Node $to Destination node where to create and
56+ * edge to.
5757 */
58- public static function create (Node $ from , Node $ to )
58+ public static function create (Node $ from , Node $ to ): self
5959 {
6060 return new self ($ from , $ to );
6161 }
6262
6363 /**
6464 * Returns the source Node for this Edge.
65- *
66- * @return \phpDocumentor\GraphViz\Node
6765 */
68- public function getFrom ()
66+ public function getFrom (): Node
6967 {
7068 return $ this ->from ;
7169 }
7270
7371 /**
7472 * Returns the destination Node for this Edge.
75- *
76- * @return \phpDocumentor\GraphViz\Node
7773 */
78- public function getTo ()
74+ public function getTo (): Node
7975 {
8076 return $ this ->to ;
8177 }
@@ -94,13 +90,13 @@ public function getTo()
9490 * setX or getX.
9591 * @param mixed[] $arguments Arguments for the setter, only 1 is expected: value
9692 *
97- * @return \phpDocumentor\GraphViz\ Attribute|\phpDocumentor\GraphViz\ Edge|null
93+ * @return Attribute|Edge|null
9894 */
99- public function __call ($ name , $ arguments )
95+ public function __call (string $ name , array $ arguments )
10096 {
10197 $ key = strtolower (substr ($ name , 3 ));
10298 if (strtolower (substr ($ name , 0 , 3 )) === 'set ' ) {
103- $ this ->attributes [$ key ] = new Attribute ($ key , $ arguments [0 ]);
99+ $ this ->attributes [$ key ] = new Attribute ($ key , ( string ) $ arguments [0 ]);
104100
105101 return $ this ;
106102 }
@@ -114,10 +110,8 @@ public function __call($name, $arguments)
114110
115111 /**
116112 * Returns the edge definition as is requested by GraphViz.
117- *
118- * @return string
119113 */
120- public function __toString ()
114+ public function __toString (): string
121115 {
122116 $ attributes = [];
123117 foreach ($ this ->attributes as $ value ) {
0 commit comments