Skip to content

Commit c8f2a5a

Browse files
committed
Some more types and annotations cleanup and additions of @throws annotations
1 parent 3f79ac4 commit c8f2a5a

File tree

7 files changed

+17
-12
lines changed

7 files changed

+17
-12
lines changed

lib/triagens/ArangoDb/AqlUserFunction.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ class AqlUserFunction
9797
* @param Connection $connection - the connection to be used
9898
* @param array $attributesArray - user function initialization data
9999
*
100+
* @throws \triagens\ArangoDb\ClientException
100101
*/
101102
public function __construct(Connection $connection, array $attributesArray = null)
102103
{

lib/triagens/ArangoDb/Cursor.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,6 +172,7 @@ class Cursor implements
172172
* @param array $data - initial result data as returned by the server
173173
* @param array $options - cursor options
174174
*
175+
* @throws \triagens\ArangoDb\ClientException
175176
*/
176177
public function __construct(Connection $connection, array $data, array $options)
177178
{

lib/triagens/ArangoDb/DocumentHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -314,7 +314,7 @@ public function store(Document $document, $collection = null, array $options = [
314314
* @return mixed - id of document created
315315
* @since 1.0
316316
*/
317-
public function save($collection, $document, $options = [])
317+
public function save($collection, $document, array $options = [])
318318
{
319319
$collection = $this->makeCollection($collection);
320320

lib/triagens/ArangoDb/EdgeDefinition.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,9 +48,9 @@ class EdgeDefinition
4848
/**
4949
* Constructs an new edge definition
5050
*
51-
* @param string $relation - name of the relation (the underlying edge collection).
52-
* @param array $fromCollections - a list of collections providing the edges start vertices.
53-
* @param array $toCollections - a list of collections providing the edges end vertices.
51+
* @param string $relation - name of the relation (the underlying edge collection).
52+
* @param array|string $fromCollections - a list of collections providing the edges start vertices or a string holding a single collection name.
53+
* @param array|string $toCollections - a list of collections providing the edges end vertices or a string holding a single collection name.
5454
*
5555
* @since 2.2
5656
*
@@ -193,9 +193,9 @@ public static function createUndirectedRelation($relation, $vertexCollections)
193193
* Constructs a directed relation. This relation is an edge definition where the edges can start only in the
194194
* vertices defined in 'fromCollections' and end in vertices defined in 'toCollections'.
195195
*
196-
* @param string $relation - name of the relation (the underlying edge collection).
197-
* @param array $fromCollections - a list of collections providing the edges start vertices.
198-
* @param array $toCollections - a list of collections providing the edges end vertices.
196+
* @param string $relation - name of the relation (the underlying edge collection).
197+
* @param array|string $fromCollections - a list of collections providing the edges start vertices or a string holding a single collection name.
198+
* @param array|string $toCollections - a list of collections providing the edges end vertices or a string holding a single collection name.
199199
*
200200
* @return EdgeDefinition
201201
* @since 2.2

lib/triagens/ArangoDb/EdgeHandler.php

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,17 +85,18 @@ public function createFromArrayWithContext($data, $options)
8585
* Just throw an exception if save() is called on edges.
8686
*
8787
* @internal
88-
* @throws Exception
8988
*
9089
* @param mixed $collection - collection id as string or number
9190
* @param Document $document - the document to be added
92-
* @param bool $create - create the collection if it does not yet exist
93-
*
94-
* @see EdgeHandler::saveEdge()
91+
* @param array $options
9592
*
9693
* @return mixed|void
94+
* @throws ClientException
95+
*
96+
* @see EdgeHandler::saveEdge()
97+
*
9798
*/
98-
public function save($collection, $document, $create = null)
99+
public function save($collection, $document, array $options = [])
99100
{
100101
throw new ClientException("Edges don't have a save() method. Please use saveEdge()");
101102
}

lib/triagens/ArangoDb/Handler.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ protected function json_encode_wrapper($body)
8888
* @param array $includeArray - The array that defines which options are allowed to be included, and what their default value is. for example: 'waitForSync'=>true
8989
*
9090
* @return array $params - array of parameters for use in a url
91+
* @throws \triagens\ArangoDb\ClientException
9192
* @internal param array $params - The parameters into which the options will be included.
9293
*/
9394
protected function includeOptionsInParams($options, array $includeArray = [])

lib/triagens/ArangoDb/Transaction.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ class Transaction
132132
* @param Connection $connection - the connection to be used
133133
* @param array $transactionArray - transaction initialization data
134134
*
135+
* @throws \triagens\ArangoDb\ClientException
135136
*/
136137
public function __construct(Connection $connection, array $transactionArray = null)
137138
{

0 commit comments

Comments
 (0)