Skip to content

Commit e515b50

Browse files
committed
try to fix parse error
1 parent 3d9fedd commit e515b50

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

lib/ArangoDBClient/GraphHandler.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1020,7 +1020,7 @@ public function removeVertex($graph, $vertexId, $revision = null, array $options
10201020
* @return mixed - id of edge created
10211021
* @since 1.2
10221022
*/
1023-
public function saveEdge($graph, $from, $to, $label = null, $document, $collection = null)
1023+
public function saveEdge($graph, $from, $to, $label = null, $document = null, $collection = null)
10241024
{
10251025
if ($graph instanceof Graph) {
10261026
$graph = $graph->getKey();
@@ -1037,6 +1037,9 @@ public function saveEdge($graph, $from, $to, $label = null, $document, $collecti
10371037
$collection = $edgeCollections[0];
10381038
}
10391039
}
1040+
if (!is_array($document) && !is_object($document)) {
1041+
throw new ClientException('Invalid document type.');
1042+
}
10401043

10411044
if (is_array($document)) {
10421045
$_edgeClass = $this->_edgeClass;

0 commit comments

Comments
 (0)