Commit 5ba5f85 1 parent 6215ceb commit 5ba5f85 Copy full SHA for 5ba5f85
File tree 3 files changed +27
-7
lines changed
3 files changed +27
-7
lines changed Original file line number Diff line number Diff line change @@ -58,7 +58,7 @@ public function export(NodeInterface $node): string
58
58
protected function getNodeRepresentation (NodeInterface $ node ): string
59
59
{
60
60
if ($ node instanceof ValueNodeInterface) {
61
- return $ node ->getValue ();
61
+ return ( string ) $ node ->getValue ();
62
62
}
63
63
64
64
return \sha1 (\spl_object_hash ($ node ));
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ public function __construct(
33
33
/**
34
34
* {@inheritdoc}
35
35
*/
36
- public function getAttribute ($ key )
36
+ public function getAttribute (string $ key )
37
37
{
38
38
return $ this ->getAttributes ()[$ key ] ?? null ;
39
39
}
Original file line number Diff line number Diff line change 10
10
interface AttributeNodeInterface extends NaryNodeInterface
11
11
{
12
12
/**
13
- * {@inheritdoc}
13
+ * Get an attribute.
14
+ *
15
+ * @return mixed
16
+ * The value of the attribute.
14
17
*/
15
- public function getAttribute ($ key );
18
+ public function getAttribute (string $ key );
16
19
17
20
/**
18
- * {@inheritdoc}
21
+ * Get the attributes.
22
+ *
23
+ * @return \Traversable
24
+ * The attributes.
19
25
*/
20
26
public function getAttributes (): \Traversable ;
21
27
22
28
/**
23
- * {@inheritdoc}
29
+ * Set an attribute.
30
+ *
31
+ * @param string $key
32
+ * The attribute key.
33
+ * @param mixed $value
34
+ * The attribute value.
35
+ *
36
+ * @return \drupol\phptree\Node\AttributeNodeInterface
37
+ * The node.
24
38
*/
25
39
public function setAttribute (string $ key , $ value ): AttributeNodeInterface ;
26
40
27
41
/**
28
- * {@inheritdoc}
42
+ * Set the attributes.
43
+ *
44
+ * @param \Traversable $attributes
45
+ * The attributes.
46
+ *
47
+ * @return \drupol\phptree\Node\AttributeNodeInterface
48
+ * The node.
29
49
*/
30
50
public function setAttributes (\Traversable $ attributes ): AttributeNodeInterface ;
31
51
}
You can’t perform that action at this time.
0 commit comments