@@ -552,7 +552,8 @@ public function saveVertex($graph, $document ,$collection = null)
552
552
if (count ($ this ->getVertexCollections ($ graph )) !== 1 && $ collection === null ) {
553
553
throw new ClientException ('A collection must be provided. ' );
554
554
} else if (count ($ this ->getVertexCollections ($ graph )) === 1 && $ collection === null ) {
555
- $ collection = $ this ->getVertexCollections ($ graph )[0 ];
555
+ $ collection = $ this ->getVertexCollections ($ graph );
556
+ $ collection = $ collection [0 ];
556
557
}
557
558
558
559
$ data = $ document ->getAll ();
@@ -608,7 +609,8 @@ public function getVertex($graph, $vertexId, array $options = array(), $collecti
608
609
if (count ($ this ->getVertexCollections ($ graph )) !== 1 && $ collection === null ) {
609
610
throw new ClientException ('A collection must be provided. ' );
610
611
} else if (count ($ this ->getVertexCollections ($ graph )) === 1 && $ collection === null ) {
611
- $ collection = $ this ->getVertexCollections ($ graph )[0 ];
612
+ $ collection = $ this ->getVertexCollections ($ graph );
613
+ $ collection = $ collection [0 ];
612
614
}
613
615
614
616
$ url = UrlHelper::buildUrl (Urls::URL_GRAPH , array ($ graph , Urls::URLPART_VERTEX , $ collection , $ vertexId ));
@@ -662,7 +664,8 @@ public function replaceVertex($graph, $vertexId, Document $document, $options =
662
664
if (count ($ this ->getVertexCollections ($ graph )) !== 1 && $ collection === null ) {
663
665
throw new ClientException ('A collection must be provided. ' );
664
666
} else if (count ($ this ->getVertexCollections ($ graph )) === 1 && $ collection === null ) {
665
- $ collection = $ this ->getVertexCollections ($ graph )[0 ];
667
+ $ collection = $ this ->getVertexCollections ($ graph );
668
+ $ collection = $ collection [0 ];
666
669
}
667
670
668
671
$ options = array_merge (array (self ::OPTION_REVISION => false ), $ options );
@@ -751,7 +754,8 @@ public function updateVertex($graph, $vertexId, Document $document, $options = a
751
754
if (count ($ this ->getVertexCollections ($ graph )) !== 1 && $ collection === null ) {
752
755
throw new ClientException ('A collection must be provided. ' );
753
756
} else if (count ($ this ->getVertexCollections ($ graph )) === 1 && $ collection === null ) {
754
- $ collection = $ this ->getVertexCollections ($ graph )[0 ];
757
+ $ collection = $ this ->getVertexCollections ($ graph );
758
+ $ collection = $ collection [0 ];
755
759
}
756
760
757
761
$ options = array_merge (array (self ::OPTION_REVISION => false ), $ options );
@@ -825,7 +829,8 @@ public function removeVertex($graph, $vertexId, $revision = null, $options = arr
825
829
if (count ($ this ->getVertexCollections ($ graph )) !== 1 && $ collection === null ) {
826
830
throw new ClientException ('A collection must be provided. ' );
827
831
} else if (count ($ this ->getVertexCollections ($ graph )) === 1 && $ collection === null ) {
828
- $ collection = $ this ->getVertexCollections ($ graph )[0 ];
832
+ $ collection = $ this ->getVertexCollections ($ graph );
833
+ $ collection = $ collection [0 ];
829
834
}
830
835
831
836
// This preserves compatibility for the old policy parameter.
@@ -883,7 +888,8 @@ public function saveEdge($graph, $from, $to, $label = null, $document, $collecti
883
888
if (count ($ this ->getEdgeCollections ($ graph )) !== 1 && $ collection === null ) {
884
889
throw new ClientException ('A collection must be provided. ' );
885
890
} else if (count ($ this ->getEdgeCollections ($ graph )) === 1 && $ collection === null ) {
886
- $ collection = $ this ->getEdgeCollections ($ graph )[0 ];
891
+ $ collection = $ this ->getEdgeCollections ($ graph );
892
+ $ collection = $ collection [0 ];
887
893
}
888
894
889
895
@@ -949,7 +955,8 @@ public function getEdge($graph, $edgeId, array $options = array(), $collection =
949
955
if (count ($ this ->getEdgeCollections ($ graph )) !== 1 && $ collection === null ) {
950
956
throw new ClientException ('A collection must be provided. ' );
951
957
} else if (count ($ this ->getEdgeCollections ($ graph )) === 1 && $ collection === null ) {
952
- $ collection = $ this ->getEdgeCollections ($ graph )[0 ];
958
+ $ collection = $ this ->getEdgeCollections ($ graph );
959
+ $ collection = $ collection [0 ];
953
960
}
954
961
955
962
$ url = UrlHelper::buildUrl (Urls::URL_GRAPH , array ($ graph , Urls::URLPART_EDGE , $ collection , $ edgeId ));
@@ -1004,7 +1011,8 @@ public function replaceEdge($graph, $edgeId, $label, Edge $document, $options =
1004
1011
if (count ($ this ->getEdgeCollections ($ graph )) !== 1 && $ collection === null ) {
1005
1012
throw new ClientException ('A collection must be provided. ' );
1006
1013
} else if (count ($ this ->getEdgeCollections ($ graph )) === 1 && $ collection === null ) {
1007
- $ collection = $ this ->getEdgeCollections ($ graph )[0 ];
1014
+ $ collection = $ this ->getEdgeCollections ($ graph );
1015
+ $ collection = $ collection [0 ];
1008
1016
}
1009
1017
1010
1018
$ options = array_merge (array (self ::OPTION_REVISION => false ), $ options );
@@ -1097,7 +1105,8 @@ public function updateEdge($graph, $edgeId, $label, Edge $document, $options = a
1097
1105
if (count ($ this ->getEdgeCollections ($ graph )) !== 1 && $ collection === null ) {
1098
1106
throw new ClientException ('A collection must be provided. ' );
1099
1107
} else if (count ($ this ->getEdgeCollections ($ graph )) === 1 && $ collection === null ) {
1100
- $ collection = $ this ->getEdgeCollections ($ graph )[0 ];
1108
+ $ collection = $ this ->getEdgeCollections ($ graph );
1109
+ $ collection = $ collection [0 ];
1101
1110
}
1102
1111
1103
1112
$ options = array_merge (array (self ::OPTION_REVISION => false ), $ options );
@@ -1177,7 +1186,8 @@ public function removeEdge($graph, $edgeId, $revision = null, $options = array()
1177
1186
if (count ($ this ->getEdgeCollections ($ graph )) !== 1 && $ collection === null ) {
1178
1187
throw new ClientException ('A collection must be provided. ' );
1179
1188
} else if (count ($ this ->getEdgeCollections ($ graph )) === 1 && $ collection === null ) {
1180
- $ collection = $ this ->getEdgeCollections ($ graph )[0 ];
1189
+ $ collection = $ this ->getEdgeCollections ($ graph );
1190
+ $ collection = $ collection [0 ];
1181
1191
}
1182
1192
1183
1193
// This preserves compatibility for the old policy parameter.
@@ -2496,7 +2506,8 @@ public function getRadius($graph,
2496
2506
$ statement ->bind ('options ' , $ options );
2497
2507
2498
2508
$ statement ->setQuery ($ aql );
2499
- return $ statement ->execute ()->getAll ()[0 ];
2509
+ $ a = $ statement ->execute ()->getAll ();
2510
+ return $ a [0 ];
2500
2511
}
2501
2512
2502
2513
/**
@@ -2552,7 +2563,8 @@ public function getDiameter($graph,
2552
2563
$ statement ->bind ('options ' , $ options );
2553
2564
2554
2565
$ statement ->setQuery ($ aql );
2555
- return $ statement ->execute ()->getAll ()[0 ];
2566
+ $ a = $ statement ->execute ()->getAll ();
2567
+ return $ a [0 ];
2556
2568
}
2557
2569
2558
2570
}
0 commit comments