You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
While registering a node type, you no longer have to supply a node type
name to the function. Instead you'll have to supply from within the node
type object itself. This will cause less problems when working with the
library
if (method_exists($object, $getAttributeMethod)) {
309
309
$attributeValue = $object->$getAttributeMethod();
310
310
} else {
311
-
thrownewEncoderException(sprintf('Getter method "%s" does not exist in object "%s" for node type "%s" (%s) and variable with id "%s".', $getAttributeMethod, get_class($object), $node->getTypeName(), get_class($node), $variableId));
311
+
thrownewEncoderException(sprintf('Getter method "%s" does not exist in object "%s" for node type "%s" (%s) and variable with id "%s".', $getAttributeMethod, get_class($object), $node->getNodeTypeName(), get_class($node), $variableId));
thrownewEncoderNodeException('The node type you\'re trying to add seems to be a regular node because it has a no type name. Make sure you try to add an EncoderNode with a type name');
175
+
}
168
176
$nodeName = $nodeType->getNodeName();
177
+
$nodeTypeName = $nodeType->getNodeTypeName();
169
178
if (self::nodeTypeExists($nodeName, $nodeTypeName)) {
170
179
thrownewEncoderNodeException(sprintf('Node type with name "%s" and node type name "%s" already exists', $nodeName, $nodeTypeName));
171
180
}
@@ -335,7 +344,7 @@ public function getNodeNameSingle() {
335
344
return$this->nodeNameSingle;
336
345
}
337
346
338
-
publicfunctiongetTypeName() {
347
+
publicfunctiongetNodeTypeName() {
339
348
return$this->typeName;
340
349
}
341
350
@@ -385,10 +394,6 @@ public function loadPlugin($pluginName) {
385
394
thrownewEncoderNodeException('Must be overwritten by subclasses');
@@ -52,6 +62,10 @@ public function testStaticAddNodeWithNonStringNodeName() {
52
62
$this->setExpectedException('\\PE\\Exceptions\\EncoderNodeException', 'Node without a name has been added. It must be a string and it cannot be empty.');
53
63
EncoderNode::addNode($this->node(null));
54
64
}
65
+
publicfunctiontestStaticAddNodeWithNodeType() {
66
+
$this->setExpectedException('\\PE\\Exceptions\\EncoderNodeException', 'The node you\'re trying to add seems to be a node type because it has a type name');
$this->setExpectedException('\\PE\\Exceptions\\EncoderNodeException', 'Node without a name has been added. It must be a string and it cannot be empty.');
57
71
EncoderNode::addNode($this->node(''));
@@ -103,10 +117,14 @@ public function testStaticNodeExists() {
$this->setExpectedException('\\PE\\Exceptions\\EncoderNodeException', 'The node type you\'re trying to add seems to be a regular node because it has a no type name. Make sure you try to add an EncoderNode with a type name');
0 commit comments