Skip to content

Commit 23bb977

Browse files
committed
Refactored code to use list instead of multiple assignments from array
1 parent 360304e commit 23bb977

File tree

1 file changed

+8
-16
lines changed

1 file changed

+8
-16
lines changed

lib/triagens/ArangoDb/GraphHandler.php

Lines changed: 8 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -708,8 +708,7 @@ public function getVertex($graph, $vertexId, array $options = [], $collection =
708708
}
709709
$parts = explode('/', $vertexId);
710710
if (count($parts) === 2) {
711-
$vertexId = $parts[1];
712-
$collection = $parts[0];
711+
list($collection, $vertexId) = $parts;
713712
}
714713

715714
if ($collection === null) {
@@ -799,8 +798,7 @@ public function replaceVertex($graph, $vertexId, Document $document, array $opti
799798

800799
$parts = explode('/', $vertexId);
801800
if (count($parts) === 2) {
802-
$vertexId = $parts[1];
803-
$collection = $parts[0];
801+
list($collection, $vertexId) = $parts;
804802
}
805803

806804
if ($collection === null) {
@@ -893,8 +891,7 @@ public function updateVertex($graph, $vertexId, Document $document, array $optio
893891
}
894892
$parts = explode('/', $vertexId);
895893
if (count($parts) === 2) {
896-
$vertexId = $parts[1];
897-
$collection = $parts[0];
894+
list($collection, $vertexId) = $parts;
898895
}
899896

900897
if ($collection === null) {
@@ -972,8 +969,7 @@ public function removeVertex($graph, $vertexId, $revision = null, array $options
972969
}
973970
$parts = explode('/', $vertexId);
974971
if (count($parts) === 2) {
975-
$vertexId = $parts[1];
976-
$collection = $parts[0];
972+
list($collection, $vertexId) = $parts;
977973
}
978974

979975
if ($collection === null) {
@@ -1105,8 +1101,7 @@ public function getEdge($graph, $edgeId, array $options = [], $collection = null
11051101
}
11061102
$parts = explode('/', $edgeId);
11071103
if (count($parts) === 2) {
1108-
$edgeId = $parts[1];
1109-
$collection = $parts[0];
1104+
list($collection, $edgeId) = $parts;
11101105
}
11111106

11121107
if ($collection === null) {
@@ -1197,8 +1192,7 @@ public function replaceEdge($graph, $edgeId, $label, Edge $document, array $opti
11971192
}
11981193
$parts = explode('/', $edgeId);
11991194
if (count($parts) === 2) {
1200-
$edgeId = $parts[1];
1201-
$collection = $parts[0];
1195+
list($collection, $edgeId) = $parts;
12021196
}
12031197

12041198
if ($collection === null) {
@@ -1300,8 +1294,7 @@ public function updateEdge($graph, $edgeId, $label, Edge $document, array $optio
13001294
}
13011295
$parts = explode('/', $edgeId);
13021296
if (count($parts) === 2) {
1303-
$edgeId = $parts[1];
1304-
$collection = $parts[0];
1297+
list($collection, $edgeId) = $parts;
13051298
}
13061299

13071300
if ($collection === null) {
@@ -1384,8 +1377,7 @@ public function removeEdge($graph, $edgeId, $revision = null, array $options = [
13841377
}
13851378
$parts = explode('/', $edgeId);
13861379
if (count($parts) === 2) {
1387-
$edgeId = $parts[1];
1388-
$collection = $parts[0];
1380+
list($collection, $edgeId) = $parts;
13891381
}
13901382

13911383
if ($collection === null) {

0 commit comments

Comments
 (0)