Skip to content

Commit c4ff9d6

Browse files
committed
make api compatible with 5.3
1 parent 8a7bcf2 commit c4ff9d6

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

lib/triagens/ArangoDb/Graph.php

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,8 @@ public function getVerticesCollection()
120120
return null;
121121
}
122122
$this->addEdgeDefinition($edgeDefinition);
123-
return $edgeDefinition->getFromCollections()[0];
123+
$fc = $edgeDefinition->getFromCollections();
124+
return $fc[0];
124125
}
125126

126127
/**
@@ -260,21 +261,22 @@ public function set($key, $value)
260261
* @return EdgeDefinition
261262
*/
262263
private function getSingleUndirectedRelation() {
263-
if (count($this->getEdgeDefinitions()) > 1 ||
264+
$ed = $this->getEdgeDefinitions();
265+
if (count($ed) > 1 ||
264266
(
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]
270272

271273
)
272274
)
273275
) {
274276
throw new ClientException('This operation only supports graphs with one undirected single collection relation');
275277
}
276-
if (count($this->getEdgeDefinitions()) === 1) {
277-
$eD = $this->getEdgeDefinitions()[0];
278+
if (count($ed) === 1) {
279+
$eD = $ed[0];
278280
$this->_edgeDefinitions = array();
279281
} else {
280282
$eD = new EdgeDefinition();

0 commit comments

Comments
 (0)