@@ -120,7 +120,8 @@ public function getVerticesCollection()
120
120
return null ;
121
121
}
122
122
$ this ->addEdgeDefinition ($ edgeDefinition );
123
- return $ edgeDefinition ->getFromCollections ()[0 ];
123
+ $ fc = $ edgeDefinition ->getFromCollections ();
124
+ return $ fc [0 ];
124
125
}
125
126
126
127
/**
@@ -260,21 +261,22 @@ public function set($key, $value)
260
261
* @return EdgeDefinition
261
262
*/
262
263
private function getSingleUndirectedRelation () {
263
- if (count ($ this ->getEdgeDefinitions ()) > 1 ||
264
+ $ ed = $ this ->getEdgeDefinitions ();
265
+ if (count ($ ed ) > 1 ||
264
266
(
265
- count ($ this -> getEdgeDefinitions () ) === 1 && (
266
- count ($ this -> getEdgeDefinitions () [0 ]->getFromCollections ()) > 1 ||
267
- count ($ this -> getEdgeDefinitions () [0 ]->getToCollections ()) > 1 ||
268
- $ this -> getEdgeDefinitions () [0 ]->getFromCollections ()[0 ] !==
269
- $ this -> getEdgeDefinitions () [0 ]->getToCollections ()[0 ]
267
+ count ($ ed ) === 1 && (
268
+ count ($ ed [0 ]->getFromCollections ()) > 1 ||
269
+ count ($ ed [0 ]->getToCollections ()) > 1 ||
270
+ $ ed [0 ]->getFromCollections ()[0 ] !==
271
+ $ ed [0 ]->getToCollections ()[0 ]
270
272
271
273
)
272
274
)
273
275
) {
274
276
throw new ClientException ('This operation only supports graphs with one undirected single collection relation ' );
275
277
}
276
- if (count ($ this -> getEdgeDefinitions () ) === 1 ) {
277
- $ eD = $ this -> getEdgeDefinitions () [0 ];
278
+ if (count ($ ed ) === 1 ) {
279
+ $ eD = $ ed [0 ];
278
280
$ this ->_edgeDefinitions = array ();
279
281
} else {
280
282
$ eD = new EdgeDefinition ();
0 commit comments