From 0af1d304af81590ccb6cd589cee056d571c954c3 Mon Sep 17 00:00:00 2001
From: "Lucas S. Vieira" Returns all registered AQL user functions. Get a value by it's key Get a value by its key Key to verify on list. Represents an user defined aql function on server. Represents a user defined AQL function on server. AQLFunction constructor. Removes an AQL function from server, if possible Returns the AQL function code. If the object has performed a delete operation, this method will return the deletion data. Returns the AQL function name. If this AQL function has a connection set or not. True if has a connection object. False otherwise. True if it has a connection object. False otherwise. Indicates if the function results are deterministic. <br> If the AQLFunction object is a new created AQLFunction (and not exists on server) <br>
@@ -800,9 +800,9 @@ Return a JSON representation of AQL function object. Saves the AQL function on server. Sets a connection to use. Returns a array representation of AQL function object. Flushes the <b>write-ahead log</b>. By flushing the currently active write-ahead
@@ -552,9 +552,9 @@ Returns all tasks of server information. Returns the system time. Retrieves the configuration of the <b>write-ahead log</b>. Returns information about the currently running transactions. Checks if the Arango server is available for arbitrary operations.<br>
@@ -526,9 +526,9 @@ Returns the server's current log level settings. Returns the role of a server in a cluster. Removes a task from server, if possible. Return a JSON representation of Task object. User constructor. Proper debug dump for User objects. Get some attribute. String representation of User object. Removes an user from server. Returns extra data about user. Returns the username. Get the activation status of the user. Returns true if is a new user. Return a JSON representation of list. Saves (or update) a user on server Set the activation status of the user. Set extra data for user. Returns a array representation of user Connection constructor. Proper debug dump for connection objects. Makes a custom HTTP request. Executes a DELETE request on server. Executes a GET request on server. Return the base endpoint URI. Return the database object for this connection Return the name of database handled Return the connection default headers. Returns the name of user on server If connection is authenticated. Executes a PATCH request on server. Executes a POST request on server. Executes a PUT request on server. Set the connection default headers. Get a value by it's key Get a value by its key Key to verify on list. Document constructor. Get some attribute. Verifies if an attribute is set on document Set a attribute Return an string representation of document. Return a string representation of document. Unset the given attribute of document Removes a document on server, if possible Returns the document collection Returns the document Id Returns the document key Returns the document revision Returns true if is a new object Save or update the document, if possible Sets the collection to add this document Returns a array representation of document Get some attribute. Verifies if an attribute is set on document Set a attribute Return an string representation of document. Return a string representation of document. Unset the given attribute of document Removes a document on server, if possible Returns the document collection Returns the document Id Returns the document key Returns the document revision Returns true if is a new object Save or update the document, if possible Sets the collection to add this document Returns a array representation of document Document constructor. Get some attribute. Verifies if an attribute is set on document Set a attribute Return an string representation of document. Return a string representation of document. Unset the given attribute of document Removes a document on server, if possible Returns the document collection Returns the document Id Returns the document key Returns the document revision Returns true if is a new object Save or update the document, if possible Sets the collection to add this document Returns a array representation of document Graph constructor. Returns a string representation of graph object. Creates a new edge in the collection.<br>
@@ -771,9 +771,9 @@ Adds an edge definition to graph. Adds a vertex to graph. Adds a vertex collection to the set of orphan collections of the graph. Removes a graph from server, if possible. Drops an edge from graph. Remove one edge definition from the graph.<br>
@@ -1264,9 +1264,9 @@ Drops a vertex from graph. Removes a vertex collection from the graph and optionally deletes the collection, if it is not used in any other graph.<br>
@@ -1435,9 +1435,9 @@ Returns an edge document. Return all edge definitions of graph. Returns the graph ID. Returns the graph key. Returns the minimal replication factor used for every new collection in the graph. Gets the graph name. Returns the number of shards that is used for every collection within this graph. Returns the orphan collections in the graph. Returns the replication factor used when initially creating collections for this graph. Gets the graph revision. Gets a vertex from the given collection. Lists all vertex collections within this graph. Returns true if is a new graph. If this graph is a smartGraph. Return a JSON representation of graph attributes. Save the Graph on server, if possible. Returns a array representation of graph. Returns a graph traversal. RestClient constructor. Makes a custom HTTP request. Body to sent. Body to be sent. Performs a DELETE request. Performs a GET request. Performs a PATCH request Performs a POST request. Performs a PUT request. Abort transaction View constructor. Returns true if is a new object Represents an ArangoDB Graph. Graph constructor. Returns a string representation of graph object. Creates a new edge in the collection.<br>
-Within the attributes the edge has to contain a _from and _to value referencing to valid vertices in the graph.
* (function return value solely depends on the input value and return value is the same for repeated calls with same input)
- *
- * @var bool
*/
- protected $isDeterministic;
+ protected bool $isDeterministic;
/**
- * If the entity is not an representation of a existing user function on server,
+ * If the entity is not a representation of an existing user function on server,
* this property is true.
- *
- * @var bool
*/
- protected $isNew;
+ protected bool $isNew;
/**
* Connection object.
- *
- * @var Connection
*/
- protected $connection;
+ protected Connection $connection;
/**
* Stores the deletion data for an AQLFunction object.
- *
- * @var array
*/
- protected $deletion = [];
+ protected array $deletion = [];
/**
* AQLFunction constructor.
*
- * @param string $name The AQL function name.
- * @param string $code The AQL function code.
- * @param Connection|null $connection Connection object to use.
- * @param bool $isDeterministic Indicates if the function results are deterministic.
- * @param bool $isNew Indicates if the function object is a new one or not.
+ * @param string $name The AQL function name.
+ * @param string $code The AQL function code.
+ * @param Connection|null $connection Connection object to use.
+ * @param bool $isDeterministic Indicates if the function results are deterministic.
+ * @param bool $isNew Indicates if the function object is a new one or not.
*/
public function __construct(string $name, string $code, Connection $connection = null, bool $isDeterministic = true, bool $isNew = true)
{
@@ -134,7 +122,7 @@ public function getDeletionData(): array
/**
* If this AQL function has a connection set or not.
*
- * @return bool True if has a connection object. False otherwise.
+ * @return bool True if it has a connection object. False otherwise.
*/
public function hasConnection(): bool
{
@@ -171,8 +159,7 @@ public function save(): bool
} catch (ClientException $exception) {
// Unknown error.
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $serverException = new ServerException($response['errorMessage'], $exception, $response['errorNum']);
- throw $serverException;
+ throw new ServerException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -197,8 +184,7 @@ public function delete(): bool
} catch (ClientException $exception) {
// Unknown error.
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $serverException = new ServerException($response['errorMessage'], $exception, $response['errorNum']);
- throw $serverException;
+ throw new ServerException($response['errorMessage'], $exception, $response['errorNum']);
}
}
diff --git a/src/AQL/Statement.php b/src/AQL/Statement.php
index 6dfbf53..c75728b 100644
--- a/src/AQL/Statement.php
+++ b/src/AQL/Statement.php
@@ -169,7 +169,7 @@ public function toAql(): string
*
* @return string
*/
- private function output(string $parameter)
+ private function output(string $parameter): string
{
$value = $this->container->get($parameter);
$format = $this->formats[gettype($value)];
From 47daffb55e739c6fc01841b751928751f61df06e Mon Sep 17 00:00:00 2001
From: "Lucas S. Vieira"
+ - Run the command below on your project root.
`composer require lvieira/arangodb-php-odm`
## Usage
@@ -27,7 +27,7 @@ $connection = new Connection([
'database' => 'YourDatabase',
]);
-// Alternatively, you can set an host and a port to connect
+// Alternatively, you can set a host and a port to connect
$connection = new Connection([
'host' => 'http://yourarangohost',
'port' => 8529,
@@ -68,25 +68,25 @@ $connection = new Connection([
$database = $connection->getDatabase();
-// With database object, we can retrive informations about it.
+// With a database object, we can retrieve information about it.
$infoAboutCurrentDatabase = $database->getInfo();
-// Check if database has a collection
+// Check if the database has a collection
if($database->hasCollection('my_collection_name')){
echo "Collection exists!";
} else {
- echo "Collection doesn't exists";
+ echo "Collection doesn't exist";
}
-// We can also create collections in database
+// We can also create collections in the database
$collection = $database->createCollection('my_new_colletion');
// Or retrieve existing collections
$collection = $database->getCollection('my_existing_collection');
-// With Database class we can create and drop databases
+// With the Database class we can create and drop databases
-// Lists the databases on server
+// Lists the databases on the server
$dbList = Database::list($connection);
// You can create a new database using the existing connection
@@ -116,13 +116,13 @@ $connection = new Connection([
$database = $connection->getDatabase();
-// If collection exists on database, the object will be a representation of it.
+// If a collection exists on a database, the object will represent it.
$collection = new Collection('my_collection_name', $database);
-// If collection not exists, you can create it with method 'save'
+// If the collection does not exist, you can create it with the method 'save'
$collection->save();
-// Get all documents from collection
+// Get all documents from the collection
foreach ($collection->all() as $document){
// Do something.
}
@@ -175,7 +175,7 @@ $document->save();
$document->status = 'active';
$document->save(); // Will update your document on server;
-// Delete the document from collection.
+// Delete the document from the collection.
$document->delete();
```
@@ -206,7 +206,7 @@ try {
$transaction = new JavascriptTransaction($this->getConnectionObject(), $action, $options);
$result = $transaction->execute(); // Will return 1.
} catch (TransactionException $transactionException) {
- // Throws an TransactionException in case of error.
+ // Throws a TransactionException in case of error.
return $transactionException->getMessage();
}
```
@@ -265,8 +265,8 @@ try {
## Documentation
-Check the [full documentation](https://lucassouzavieira.github.io/arangodb-php-odm/v1.0.0/index.html) of project:
+Check the [API Reference](https://lucassouzavieira.github.io/arangodb-php-odm/).
## Contributing
-[Check how contribute in this project](CONTRIBUTING.md)
+[Check how to contribute to this project](CONTRIBUTING.md)
From 1ceeb36ad7368098a57b19d89593fc3b18fcefde Mon Sep 17 00:00:00 2001
From: "Lucas S. Vieira"
@@ -25,14 +25,14 @@ class EdgeDefinition
*
* @var array
*/
- protected $from = [];
+ protected array $from = [];
/**
* Name of the edge collection.
*
* @var string
*/
- protected $collection;
+ protected string $collection;
/**
* EdgeDefinition constructor.
diff --git a/src/Graph/Graph.php b/src/Graph/Graph.php
index 0370677..ef37515 100644
--- a/src/Graph/Graph.php
+++ b/src/Graph/Graph.php
@@ -29,69 +29,51 @@ class Graph implements \JsonSerializable
{
/**
* The internal id of this graph.
- *
- * @var string
*/
- protected $id;
+ protected string $id;
/**
* The name of graph.
- *
- * @var string
*/
- protected $key;
+ protected string $key;
/**
* If this graph is a new one or a representation of existing document.
- *
- * @var bool
*/
- protected $isNew;
+ protected bool $isNew;
/**
* Graph name.
- *
- * @var string
*/
- protected $name;
+ protected string $name;
/**
* Flag if the graph is a smart graph.
- *
- * @var bool
*/
- protected $isSmart;
+ protected bool $isSmart;
/**
* The revision of graph.
* Can be used to make sure to not override concurrent modifications to this graph.
- *
- * @var string
*/
- protected $revision;
+ protected string $revision;
/**
* Number of shards created for every new collection in the graph.
- *
- * @var int
*/
- protected $numberOfShards;
+ protected int $numberOfShards;
/**
* The replication factor used for every new collection in the graph.
- *
- * @var int
*/
- protected $replicationFactor;
+ protected int $replicationFactor;
/**
* The minimal replication factor used for every new collection in the graph.
* If one shard has less than minReplicationFactor copies,
* we cannot write to this shard, but to all others.
- *
- * @var int
*/
- protected $minReplicationFactor;
+ protected int $minReplicationFactor;
/**
* An array of definitions for the relations of graph.
@@ -106,7 +88,7 @@ class Graph implements \JsonSerializable
*
* @var array
*/
- protected $orphanCollections = [];
+ protected array $orphanCollections = [];
/**
* Database object of graph
@@ -307,8 +289,7 @@ public function save(): bool
return false;
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -342,8 +323,7 @@ public function delete($dropCollections = false): bool
return true;
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -418,8 +398,7 @@ public function addEdgeDefinition(string $collection, array $from, array $to): b
return true;
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -470,8 +449,7 @@ public function dropEdgeDefinition(string $collection, bool $dropCollection = fa
return true;
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -502,8 +480,7 @@ public function getVertexCollections(): ArrayList
return new ArrayList($data['collections']);
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -539,8 +516,7 @@ public function addVertexCollection(string $collection): bool
return true;
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -579,8 +555,7 @@ public function dropVertexCollection(string $collection, bool $dropCollection =
return true;
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -620,8 +595,7 @@ public function getVertex(string $collection, string $vertex)
return false;
}
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -663,8 +637,7 @@ public function addVertex(string $collection, array $attributes = [], bool $wait
return false;
}
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -708,8 +681,7 @@ public function dropVertex(string $collection, string $vertex, bool $waitForSync
return false;
}
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -749,8 +721,7 @@ public function getEdge(string $collection, string $edge)
return false;
}
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -794,8 +765,7 @@ public function addEdge(string $collection, array $attributes = [], bool $waitFo
return false;
}
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -839,8 +809,7 @@ public function dropEdge(string $collection, string $edge, bool $waitForSync = t
return false;
}
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
diff --git a/src/View/View.php b/src/View/View.php
index 31a9c5d..fbe1ad3 100644
--- a/src/View/View.php
+++ b/src/View/View.php
@@ -13,38 +13,28 @@ class View
{
/**
* View ID.
- *
- * @var string
*/
- protected $id;
+ protected string $id;
/**
* Globally unique ID.
- *
- * @var string
*/
- protected $globallyUniqueId;
+ protected string $globallyUniqueId;
/**
* The name of the View.
- *
- * @var string
*/
- protected $name;
+ protected string $name;
/**
* The type of View
- *
- * @var string
*/
- protected $type;
+ protected string $type;
/**
* If the View is a new one or a representation of an existing view on server.
- *
- * @var bool
*/
- protected $isNew;
+ protected bool $isNew;
/**
* The view links
@@ -58,19 +48,17 @@ class View
* View properties.
* Check ArangoDB Server documentation for more details.
*
- * @var array
* @see https://www.arangodb.com/docs/stable/arangosearch-views.html#view-properties
*/
- protected $attributes = [];
+ protected array $attributes = [];
/**
* View properties default values.
* Check ArangoDB Server documentation for more details.
*
- * @var array
* @see https://www.arangodb.com/docs/stable/arangosearch-views.html#view-properties
*/
- protected $defaults = [
+ protected array $defaults = [
'writebufferActive' => 0,
'writebufferSizeMax' => 33554432,
'writebufferIdle' => 64,
From afd77a3753e9c88ca3925b28fbe619881c30edf1 Mon Sep 17 00:00:00 2001
From: "Lucas S. Vieira"
: mixed
-
-
public
- get( $key) : mixed
+ get(int|string $key) : mixed
Parameters
diff --git a/docs/packages/ArangoDB-AQL-Functions.html b/docs/packages/ArangoDB-AQL-Functions.html
index a01d83e..7ab9184 100644
--- a/docs/packages/ArangoDB-AQL-Functions.html
+++ b/docs/packages/ArangoDB-AQL-Functions.html
@@ -256,7 +256,7 @@
-
Return values
bool
—
-
public
- __toString() : false|mixed|string
+ __toString() : string
Return values
- false|mixed|string
+ string
: mixed
-
-
public
- get( $key) : mixed
+ get(int|string $key) : mixed
Parameters
diff --git a/docs/files/src/AQL/AQL.php.txt b/docs/files/src/AQL/AQL.php.txt
index f216920..bb560c8 100644
--- a/docs/files/src/AQL/AQL.php.txt
+++ b/docs/files/src/AQL/AQL.php.txt
@@ -45,8 +45,7 @@ abstract class AQL
// Unknown error.
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $aqlException = new AQLException($response['errorMessage'], $exception, $response['errorNum']);
- throw $aqlException;
+ throw new AQLException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -76,8 +75,7 @@ abstract class AQL
} catch (ClientException $exception) {
// Unknown error.
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $serverException = new ServerException($response['errorMessage'], $exception, $response['errorNum']);
- throw $serverException;
+ throw new ServerException($response['errorMessage'], $exception, $response['errorNum']);
}
}
}
diff --git a/docs/files/src/AQL/Functions/AQLFunction.php.txt b/docs/files/src/AQL/Functions/AQLFunction.php.txt
index f806fbf..4a01eb8 100644
--- a/docs/files/src/AQL/Functions/AQLFunction.php.txt
+++ b/docs/files/src/AQL/Functions/AQLFunction.php.txt
@@ -11,7 +11,7 @@ use GuzzleHttp\Exception\GuzzleException;
use ArangoDB\Entity\Contracts\EntityInterface;
/**
- * Represents an user defined aql function on server.
+ * Represents a user defined AQL function on server.
*
* @package ArangoDB\AQL\Functions
* @author Lucas S. Vieira
@@ -20,56 +20,44 @@ class AQLFunction implements EntityInterface
{
/**
* Fully qualified name of user function.
- *
- * @var string
*/
- protected $name;
+ protected string $name;
/**
* String representation of function body.
- *
- * @var string
*/
- protected $code;
+ protected string $code;
/**
* An optional boolean value to indicate whether the function results are fully deterministic.
: string
-
-
public
@@ -731,9 +731,9 @@
@@ -1082,9 +1082,9 @@
: string
-
public
@@ -734,9 +734,9 @@
@@ -1137,9 +1137,9 @@
: string
-
public
@@ -724,9 +724,9 @@
@@ -1075,9 +1075,9 @@
Parameters
: string
= ""
public
- delete(string $url[, mixed $data = [] ][, array<string|int, mixed> $headers = [] ]) : mixed|ResponseInterface
+ delete(string $url[, mixed $data = [] ][, array<string|int, mixed> $headers = [] ]) : ResponseInterface
Return values
- mixed|ResponseInterface
+ ResponseInterface
public
- get(string $url[, mixed $data = [] ][, array<string|int, mixed> $headers = [] ]) : mixed|ResponseInterface
+ get(string $url[, mixed $data = [] ][, array<string|int, mixed> $headers = [] ]) : ResponseInterface
Return values
- mixed|ResponseInterface
+ ResponseInterface
public
- patch(string $url[, mixed $data = [] ][, array<string|int, mixed> $headers = [] ]) : mixed|ResponseInterface
+ patch(string $url[, mixed $data = [] ][, array<string|int, mixed> $headers = [] ]) : ResponseInterface
Return values
- mixed|ResponseInterface
+ ResponseInterface
public
- post(string $url[, mixed $data = [] ][, array<string|int, mixed> $headers = [] ]) : mixed|ResponseInterface
+ post(string $url[, mixed $data = [] ][, array<string|int, mixed> $headers = [] ]) : ResponseInterface
Return values
- mixed|ResponseInterface
+ ResponseInterface
-
+
* (function return value solely depends on the input value and return value is the same for repeated calls with same input)
- *
- * @var bool
*/
- protected $isDeterministic;
+ protected bool $isDeterministic;
/**
- * If the entity is not an representation of a existing user function on server,
+ * If the entity is not a representation of an existing user function on server,
* this property is true.
- *
- * @var bool
*/
- protected $isNew;
+ protected bool $isNew;
/**
* Connection object.
- *
- * @var Connection
*/
- protected $connection;
+ protected Connection|null $connection;
/**
* Stores the deletion data for an AQLFunction object.
- *
- * @var array
*/
- protected $deletion = [];
+ protected array $deletion = [];
/**
* AQLFunction constructor.
*
- * @param string $name The AQL function name.
- * @param string $code The AQL function code.
- * @param Connection|null $connection Connection object to use.
- * @param bool $isDeterministic Indicates if the function results are deterministic.
- * @param bool $isNew Indicates if the function object is a new one or not.
+ * @param string $name The AQL function name.
+ * @param string $code The AQL function code.
+ * @param Connection|null $connection Connection object to use.
+ * @param bool $isDeterministic Indicates if the function results are deterministic.
+ * @param bool $isNew Indicates if the function object is a new one or not.
*/
public function __construct(string $name, string $code, Connection $connection = null, bool $isDeterministic = true, bool $isNew = true)
{
@@ -134,7 +122,7 @@ class AQLFunction implements EntityInterface
/**
* If this AQL function has a connection set or not.
*
- * @return bool True if has a connection object. False otherwise.
+ * @return bool True if it has a connection object. False otherwise.
*/
public function hasConnection(): bool
{
@@ -171,8 +159,7 @@ class AQLFunction implements EntityInterface
} catch (ClientException $exception) {
// Unknown error.
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $serverException = new ServerException($response['errorMessage'], $exception, $response['errorNum']);
- throw $serverException;
+ throw new ServerException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -197,8 +184,7 @@ class AQLFunction implements EntityInterface
} catch (ClientException $exception) {
// Unknown error.
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $serverException = new ServerException($response['errorMessage'], $exception, $response['errorNum']);
- throw $serverException;
+ throw new ServerException($response['errorMessage'], $exception, $response['errorNum']);
}
}
diff --git a/docs/files/src/AQL/Statement.php.txt b/docs/files/src/AQL/Statement.php.txt
index 6dfbf53..c75728b 100644
--- a/docs/files/src/AQL/Statement.php.txt
+++ b/docs/files/src/AQL/Statement.php.txt
@@ -169,7 +169,7 @@ class Statement implements StatementInterface
*
* @return string
*/
- private function output(string $parameter)
+ private function output(string $parameter): string
{
$value = $this->container->get($parameter);
$format = $this->formats[gettype($value)];
diff --git a/docs/files/src/Admin/Admin.php.txt b/docs/files/src/Admin/Admin.php.txt
index 543c800..6888505 100644
--- a/docs/files/src/Admin/Admin.php.txt
+++ b/docs/files/src/Admin/Admin.php.txt
@@ -74,8 +74,7 @@ abstract class Admin
} catch (ClientException $exception) {
// Unknown error.
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $serverException = new ServerException($response['errorMessage'], $exception, $response['errorNum']);
- throw $serverException;
+ throw new ServerException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -97,8 +96,7 @@ abstract class Admin
} catch (ClientException $exception) {
// Unknown error.
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $serverException = new ServerException($response['errorMessage'], $exception, $response['errorNum']);
- throw $serverException;
+ throw new ServerException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -127,8 +125,7 @@ abstract class Admin
} catch (ClientException $exception) {
// Unknown error.
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $serverException = new ServerException($response['errorMessage'], $exception, $response['errorNum']);
- throw $serverException;
+ throw new ServerException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -160,8 +157,7 @@ abstract class Admin
} catch (ClientException $exception) {
// Unknown error.
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $serverException = new ServerException($response['errorMessage'], $exception, $response['errorNum']);
- throw $serverException;
+ throw new ServerException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -200,8 +196,7 @@ abstract class Admin
$message = "Not Implemented";
}
- $serverException = new ServerException($message, $exception, $code);
- throw $serverException;
+ throw new ServerException($message, $exception, $code);
}
}
@@ -226,8 +221,7 @@ abstract class Admin
$response = json_decode((string)$exception->getResponse()->getBody(), true);
$message = isset($response['errorMessage']) ? $response['errorMessage'] : "Unknown error";
$code = isset($response['errorNum']) ? $response['errorNum'] : $exception->getResponse()->getStatusCode();
- $serverException = new ServerException($message, $exception, $code);
- throw $serverException;
+ throw new ServerException($message, $exception, $code);
}
}
}
diff --git a/docs/files/src/Admin/Server.php.txt b/docs/files/src/Admin/Server.php.txt
index 15b827c..6b10256 100644
--- a/docs/files/src/Admin/Server.php.txt
+++ b/docs/files/src/Admin/Server.php.txt
@@ -60,8 +60,7 @@ abstract class Server
return $data['name'];
} catch (\Exception $exception) {
// Unknown error.
- $serverException = new ServerException($exception->getMessage(), $exception, $exception->getCode());
- throw $serverException;
+ throw new ServerException($exception->getMessage(), $exception, $exception->getCode());
}
}
@@ -88,8 +87,7 @@ abstract class Server
return strtolower($data['role']);
} catch (\Exception $exception) {
// Unknown error.
- $serverException = new ServerException($exception->getMessage(), $exception, $exception->getCode());
- throw $serverException;
+ throw new ServerException($exception->getMessage(), $exception, $exception->getCode());
}
}
@@ -117,8 +115,7 @@ abstract class Server
// Unknown error.
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $serverException = new ServerException($response['errorMessage'], $exception, $response['errorNum']);
- throw $serverException;
+ throw new ServerException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -139,8 +136,7 @@ abstract class Server
return $data;
} catch (BadResponseException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $serverException = new ServerException($response['errorMessage'], $exception, $response['errorNum']);
- throw $serverException;
+ throw new ServerException($response['errorMessage'], $exception, $response['errorNum']);
}
}
}
diff --git a/docs/files/src/Admin/Task/Task.php.txt b/docs/files/src/Admin/Task/Task.php.txt
index 447cdf3..3ba1be9 100644
--- a/docs/files/src/Admin/Task/Task.php.txt
+++ b/docs/files/src/Admin/Task/Task.php.txt
@@ -224,8 +224,7 @@ class Task implements EntityInterface
} catch (ClientException $exception) {
// Unknown error.
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $serverException = new ServerException($response['errorMessage'], $exception, $response['errorNum']);
- throw $serverException;
+ throw new ServerException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -253,8 +252,7 @@ class Task implements EntityInterface
// Unknown error.
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $serverException = new ServerException($response['errorMessage'], $exception, $response['errorNum']);
- throw $serverException;
+ throw new ServerException($response['errorMessage'], $exception, $response['errorNum']);
}
}
diff --git a/docs/files/src/Auth/Authenticable.php.txt b/docs/files/src/Auth/Authenticable.php.txt
index c7eff7d..5f7ac40 100644
--- a/docs/files/src/Auth/Authenticable.php.txt
+++ b/docs/files/src/Auth/Authenticable.php.txt
@@ -24,17 +24,17 @@ abstract class Authenticable
/**
* @var array
*/
- protected $options;
+ protected array $options;
/**
* @var array JWT token
*/
- protected $authToken;
+ protected array $authToken;
/**
* @var RestClient
*/
- protected $restClient;
+ protected RestClient $restClient;
/**
* Authenticable constructor.
@@ -62,11 +62,9 @@ abstract class Authenticable
$this->authToken = json_decode((string)$response->getBody(), true);
} catch (BadResponseException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $authException = new AuthException($response['errorMessage'], $exception, $response['errorNum']);
- throw $authException;
+ throw new AuthException($response['errorMessage'], $exception, $response['errorNum']);
} catch (ConnectException $exception) {
- $connectionException = new ConnectionException($exception->getMessage(), $exception);
- throw $connectionException;
+ throw new ConnectionException($exception->getMessage(), $exception);
}
}
diff --git a/docs/files/src/Auth/Exceptions/AuthException.php.txt b/docs/files/src/Auth/Exceptions/AuthException.php.txt
index c509cad..7c0d2b2 100644
--- a/docs/files/src/Auth/Exceptions/AuthException.php.txt
+++ b/docs/files/src/Auth/Exceptions/AuthException.php.txt
@@ -17,11 +17,11 @@ class AuthException extends BaseException
/**
* AuthException constructor.
*
- * @param $message
+ * @param string $message
* @param Throwable|null $previous
* @param int $code
*/
- public function __construct($message, Throwable $previous = null, $code = 0)
+ public function __construct(string $message, Throwable $previous = null, $code = 0)
{
parent::__construct($message, $previous, $code);
}
diff --git a/docs/files/src/Auth/Exceptions/UserException.php.txt b/docs/files/src/Auth/Exceptions/UserException.php.txt
index 4988d9a..ad285ca 100644
--- a/docs/files/src/Auth/Exceptions/UserException.php.txt
+++ b/docs/files/src/Auth/Exceptions/UserException.php.txt
@@ -17,11 +17,11 @@ class UserException extends BaseException
/**
* UserException constructor.
*
- * @param $message
+ * @param string $message
* @param Throwable|null $previous
* @param int $code
*/
- public function __construct($message, Throwable $previous = null, $code = 0)
+ public function __construct(string $message, Throwable $previous = null, int $code = 0)
{
parent::__construct($message, $previous, $code);
}
diff --git a/docs/files/src/Auth/User.php.txt b/docs/files/src/Auth/User.php.txt
index dfc55be..1af674e 100644
--- a/docs/files/src/Auth/User.php.txt
+++ b/docs/files/src/Auth/User.php.txt
@@ -23,46 +23,34 @@ class User implements EntityInterface
{
/**
* Name of user on server.
- *
- * @var string
*/
- protected $user;
+ protected string $user;
/**
* Password of user.
* Used only of new users that will be created on server.
- *
- * @var string
*/
- protected $password = '';
+ protected string $password = '';
/**
* If user is active or not on database.
- *
- * @var bool
*/
- protected $active;
+ protected bool $active;
/**
* Extra data about the user.
- *
- * @var array|null
*/
- protected $extra = null;
+ protected array|null $extra = null;
/**
* If user is a new User or an existing one.
- *
- * @var bool
*/
- protected $isNew;
+ protected bool $isNew;
/**
* Connection object to use.
- *
- * @var Connection
*/
- protected $connection;
+ protected Connection|null $connection;
/**
* User constructor.
@@ -105,7 +93,7 @@ class User implements EntityInterface
/**
* String representation of User object.
*
- * @return false|mixed|string
+ * @return string
*/
public function __toString()
{
@@ -119,7 +107,7 @@ class User implements EntityInterface
*
* @return mixed|null Attribute value.
*/
- public function __get($name)
+ public function __get(string $name)
{
if (in_array($name, ['extra', 'user', 'active'])) {
return $this->{$name};
@@ -173,7 +161,7 @@ class User implements EntityInterface
*
* @return array|null
*/
- public function getExtra()
+ public function getExtra(): array|null
{
return $this->extra;
}
@@ -221,13 +209,12 @@ class User implements EntityInterface
$this->connection->$method($uri, $data);
$this->isNew = false;
- $this->password = null;
+ $this->password = '';
return true;
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $duplicatedException = new UserException($response['errorMessage'], $exception, $response['errorNum']);
- throw $duplicatedException;
+ throw new UserException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -246,7 +233,7 @@ class User implements EntityInterface
$response = $this->connection->delete($uri);
$this->isNew = false;
- $this->password = null;
+ $this->password = '';
return true;
} catch (ClientException $exception) {
diff --git a/docs/files/src/Batch/Import.php.txt b/docs/files/src/Batch/Import.php.txt
index feeae35..99165d4 100644
--- a/docs/files/src/Batch/Import.php.txt
+++ b/docs/files/src/Batch/Import.php.txt
@@ -80,11 +80,9 @@ abstract class Import
} catch (ClientException $exception) {
// Unknown error.
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $serverException = new ServerException($response['errorMessage'], $exception, $response['errorNum']);
- throw $serverException;
+ throw new ServerException($response['errorMessage'], $exception, $response['errorNum']);
} catch (DatabaseException $exception) {
- $serverException = new ServerException($exception->getMessage(), $exception, $exception->getCode());
- throw $serverException;
+ throw new ServerException($exception->getMessage(), $exception, $exception->getCode());
}
}
}
diff --git a/docs/files/src/Connection/Connection.php.txt b/docs/files/src/Connection/Connection.php.txt
index 97e044e..69984e5 100644
--- a/docs/files/src/Connection/Connection.php.txt
+++ b/docs/files/src/Connection/Connection.php.txt
@@ -24,10 +24,8 @@ class Connection extends Authenticable
{
/**
* Default headers to send to server.
- *
- * @var array
*/
- protected $defaultHeaders = [];
+ protected array $defaultHeaders = [];
/**
* Connection constructor.
diff --git a/docs/files/src/DataStructures/ArrayList.php.txt b/docs/files/src/DataStructures/ArrayList.php.txt
index 5c21f0e..dbd9d67 100644
--- a/docs/files/src/DataStructures/ArrayList.php.txt
+++ b/docs/files/src/DataStructures/ArrayList.php.txt
@@ -68,9 +68,9 @@ class ArrayList implements ListInterface
}
/**
- * Get a value by it's key
+ * Get a value by its key
*
- * @param $key Key to verify on list.
+ * @param int|string $key Key to verify on list.
* @return mixed
*/
public function get($key)
diff --git a/docs/files/src/Database/Database.php.txt b/docs/files/src/Database/Database.php.txt
index 593a3d3..f9b4e93 100644
--- a/docs/files/src/Database/Database.php.txt
+++ b/docs/files/src/Database/Database.php.txt
@@ -282,8 +282,7 @@ class Database extends DatabaseHandler
return $collectionList;
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
}
diff --git a/docs/files/src/Document/Document.php.txt b/docs/files/src/Document/Document.php.txt
index cecf8a4..9401e6d 100644
--- a/docs/files/src/Document/Document.php.txt
+++ b/docs/files/src/Document/Document.php.txt
@@ -82,10 +82,8 @@ class Document implements EntityInterface
/**
* Default patch options
- *
- * @var array
*/
- protected $patchDefaultOptions = [
+ protected array $patchDefaultOptions = [
'keepNull' => false,
'mergeObjects' => true,
'waitForSync' => true,
@@ -96,10 +94,8 @@ class Document implements EntityInterface
/**
* Default update options
- *
- * @var array
*/
- protected $updateDefaultOptions = [
+ protected array $updateDefaultOptions = [
'waitForSync' => true,
'ignoreRevs' => true,
'returnOld' => false,
@@ -140,7 +136,7 @@ class Document implements EntityInterface
}
/**
- * Return an string representation of document.
+ * Return a string representation of document.
*
* @return string
*/
@@ -291,8 +287,7 @@ class Document implements EntityInterface
return $this->update($options);
} catch (GuzzleException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -315,8 +310,7 @@ class Document implements EntityInterface
return true;
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -338,8 +332,7 @@ class Document implements EntityInterface
return true;
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
diff --git a/docs/files/src/Exceptions/Factory.php.txt b/docs/files/src/Exceptions/Factory.php.txt
index 3b49328..39a257e 100644
--- a/docs/files/src/Exceptions/Factory.php.txt
+++ b/docs/files/src/Exceptions/Factory.php.txt
@@ -12,7 +12,7 @@ use ArangoDB\Exceptions\Storage\DataSourceNotFoundException;
*/
abstract class Factory
{
- protected static $exceptions = [
+ protected static array $exceptions = [
1203 => DataSourceNotFoundException::class
];
diff --git a/docs/files/src/Graph/EdgeDefinition.php.txt b/docs/files/src/Graph/EdgeDefinition.php.txt
index 9f74af8..46de29f 100644
--- a/docs/files/src/Graph/EdgeDefinition.php.txt
+++ b/docs/files/src/Graph/EdgeDefinition.php.txt
@@ -17,7 +17,7 @@ class EdgeDefinition
*
* @var array
*/
- protected $to = [];
+ protected array $to = [];
/**
* List of vertex collection names.
@@ -25,14 +25,14 @@ class EdgeDefinition
*
* @var array
*/
- protected $from = [];
+ protected array $from = [];
/**
* Name of the edge collection.
*
* @var string
*/
- protected $collection;
+ protected string $collection;
/**
* EdgeDefinition constructor.
diff --git a/docs/files/src/Graph/Graph.php.txt b/docs/files/src/Graph/Graph.php.txt
index 0370677..ef37515 100644
--- a/docs/files/src/Graph/Graph.php.txt
+++ b/docs/files/src/Graph/Graph.php.txt
@@ -29,69 +29,51 @@ class Graph implements \JsonSerializable
{
/**
* The internal id of this graph.
- *
- * @var string
*/
- protected $id;
+ protected string $id;
/**
* The name of graph.
- *
- * @var string
*/
- protected $key;
+ protected string $key;
/**
* If this graph is a new one or a representation of existing document.
- *
- * @var bool
*/
- protected $isNew;
+ protected bool $isNew;
/**
* Graph name.
- *
- * @var string
*/
- protected $name;
+ protected string $name;
/**
* Flag if the graph is a smart graph.
- *
- * @var bool
*/
- protected $isSmart;
+ protected bool $isSmart;
/**
* The revision of graph.
* Can be used to make sure to not override concurrent modifications to this graph.
- *
- * @var string
*/
- protected $revision;
+ protected string $revision;
/**
* Number of shards created for every new collection in the graph.
- *
- * @var int
*/
- protected $numberOfShards;
+ protected int $numberOfShards;
/**
* The replication factor used for every new collection in the graph.
- *
- * @var int
*/
- protected $replicationFactor;
+ protected int $replicationFactor;
/**
* The minimal replication factor used for every new collection in the graph.
* If one shard has less than minReplicationFactor copies,
* we cannot write to this shard, but to all others.
- *
- * @var int
*/
- protected $minReplicationFactor;
+ protected int $minReplicationFactor;
/**
* An array of definitions for the relations of graph.
@@ -106,7 +88,7 @@ class Graph implements \JsonSerializable
*
* @var array
*/
- protected $orphanCollections = [];
+ protected array $orphanCollections = [];
/**
* Database object of graph
@@ -307,8 +289,7 @@ class Graph implements \JsonSerializable
return false;
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -342,8 +323,7 @@ class Graph implements \JsonSerializable
return true;
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -418,8 +398,7 @@ class Graph implements \JsonSerializable
return true;
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -470,8 +449,7 @@ class Graph implements \JsonSerializable
return true;
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -502,8 +480,7 @@ class Graph implements \JsonSerializable
return new ArrayList($data['collections']);
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -539,8 +516,7 @@ class Graph implements \JsonSerializable
return true;
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -579,8 +555,7 @@ class Graph implements \JsonSerializable
return true;
} catch (ClientException $exception) {
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -620,8 +595,7 @@ class Graph implements \JsonSerializable
return false;
}
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -663,8 +637,7 @@ class Graph implements \JsonSerializable
return false;
}
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -708,8 +681,7 @@ class Graph implements \JsonSerializable
return false;
}
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -749,8 +721,7 @@ class Graph implements \JsonSerializable
return false;
}
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -794,8 +765,7 @@ class Graph implements \JsonSerializable
return false;
}
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -839,8 +809,7 @@ class Graph implements \JsonSerializable
return false;
}
- $databaseException = new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
- throw $databaseException;
+ throw new DatabaseException($response['errorMessage'], $exception, $response['errorNum']);
}
}
diff --git a/docs/files/src/Http/RestClient.php.txt b/docs/files/src/Http/RestClient.php.txt
index d7cb6ff..ab91a7b 100644
--- a/docs/files/src/Http/RestClient.php.txt
+++ b/docs/files/src/Http/RestClient.php.txt
@@ -20,17 +20,13 @@ class RestClient
{
/**
* Base URI string.
- *
- * @var string
*/
- protected $baseUri;
+ protected string $baseUri;
/**
* Guzzle HTTP client.
- *
- * @var Client
*/
- protected $httpClient;
+ protected Client $httpClient;
/**
* RestClient constructor.
@@ -59,11 +55,11 @@ class RestClient
* @param mixed $data Data to send.
* @param array $headers Additional headers.
*
- * @return mixed|ResponseInterface
+ * @return ResponseInterface
*
* @throws GuzzleException
*/
- public function get($url, $data = [], $headers = []): ResponseInterface
+ public function get(string $url, array $data = [], array $headers = []): ResponseInterface
{
$request = new Request('GET', $url, $headers, json_encode($data));
return $this->httpClient->send($request->withoutHeader('content-length'));
@@ -76,11 +72,11 @@ class RestClient
* @param mixed $data Data to send.
* @param array $headers Additional headers.
*
- * @return mixed|ResponseInterface
+ * @return ResponseInterface
*
* @throws GuzzleException
*/
- public function post($url, $data = [], $headers = []): ResponseInterface
+ public function post(string $url, array $data = [], array $headers = []): ResponseInterface
{
$request = new Request('POST', $url, $headers, json_encode($data));
return $this->httpClient->send($request);
@@ -97,7 +93,7 @@ class RestClient
*
* @throws GuzzleException
*/
- public function put($url, $data = [], $headers = []): ResponseInterface
+ public function put(string $url, array $data = [], array $headers = []): ResponseInterface
{
$request = new Request('PUT', $url, $headers, json_encode($data));
return $this->httpClient->send($request);
@@ -110,11 +106,11 @@ class RestClient
* @param mixed $data Data to send
* @param array $headers Additional headers.
*
- * @return mixed|ResponseInterface
+ * @return ResponseInterface
*
* @throws GuzzleException
*/
- public function patch($url, $data = [], $headers = []): ResponseInterface
+ public function patch(string $url, array $data = [], array $headers = []): ResponseInterface
{
$request = new Request('PATCH', $url, $headers, json_encode($data));
return $this->httpClient->send($request);
@@ -127,11 +123,11 @@ class RestClient
* @param mixed $data Data to send.
* @param array $headers Additional headers.
*
- * @return mixed|ResponseInterface
+ * @return ResponseInterface
*
* @throws GuzzleException
*/
- public function delete($url, $data = [], $headers = []): ResponseInterface
+ public function delete(string $url, array $data = [], array $headers = []): ResponseInterface
{
$request = new Request('DELETE', $url, $headers, json_encode($data));
return $this->httpClient->send($request);
@@ -142,7 +138,7 @@ class RestClient
*
* @param string $method HTTP method to use.
* @param string $url URL to request.
- * @param string $body Body to sent.
+ * @param string $body Body to be sent.
* @param array $headers Additional headers.
*
* @return ResponseInterface
diff --git a/docs/files/src/Transaction/JavascriptTransaction.php.txt b/docs/files/src/Transaction/JavascriptTransaction.php.txt
index 5224200..d6c0b6a 100644
--- a/docs/files/src/Transaction/JavascriptTransaction.php.txt
+++ b/docs/files/src/Transaction/JavascriptTransaction.php.txt
@@ -59,8 +59,7 @@ final class JavascriptTransaction extends Transaction
} catch (BadResponseException $exception) {
// An error was returned from server.
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $transactionException = new TransactionException($response['errorMessage'], $exception, $response['errorNum']);
- throw $transactionException;
+ throw new TransactionException($response['errorMessage'], $exception, $response['errorNum']);
}
}
}
diff --git a/docs/files/src/Transaction/StreamTransaction.php.txt b/docs/files/src/Transaction/StreamTransaction.php.txt
index e95ed90..77120e0 100644
--- a/docs/files/src/Transaction/StreamTransaction.php.txt
+++ b/docs/files/src/Transaction/StreamTransaction.php.txt
@@ -117,8 +117,7 @@ final class StreamTransaction extends Transaction
} catch (BadResponseException $exception) {
// An error was returned from server.
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $transactionException = new TransactionException($response['errorMessage'], $exception, $response['errorNum']);
- throw $transactionException;
+ throw new TransactionException($response['errorMessage'], $exception, $response['errorNum']);
}
}
@@ -144,8 +143,7 @@ final class StreamTransaction extends Transaction
} catch (BadResponseException $exception) {
// An error was returned from server.
$response = json_decode((string)$exception->getResponse()->getBody(), true);
- $transactionException = new TransactionException($response['errorMessage'], $exception, $response['errorNum']);
- throw $transactionException;
+ throw new TransactionException($response['errorMessage'], $exception, $response['errorNum']);
}
}
}
diff --git a/docs/files/src/View/View.php.txt b/docs/files/src/View/View.php.txt
index 31a9c5d..fbe1ad3 100644
--- a/docs/files/src/View/View.php.txt
+++ b/docs/files/src/View/View.php.txt
@@ -13,38 +13,28 @@ class View
{
/**
* View ID.
- *
- * @var string
*/
- protected $id;
+ protected string $id;
/**
* Globally unique ID.
- *
- * @var string
*/
- protected $globallyUniqueId;
+ protected string $globallyUniqueId;
/**
* The name of the View.
- *
- * @var string
*/
- protected $name;
+ protected string $name;
/**
* The type of View
- *
- * @var string
*/
- protected $type;
+ protected string $type;
/**
* If the View is a new one or a representation of an existing view on server.
- *
- * @var bool
*/
- protected $isNew;
+ protected bool $isNew;
/**
* The view links
@@ -58,19 +48,17 @@ class View
* View properties.
* Check ArangoDB Server documentation for more details.
*
- * @var array
* @see https://www.arangodb.com/docs/stable/arangosearch-views.html#view-properties
*/
- protected $attributes = [];
+ protected array $attributes = [];
/**
* View properties default values.
* Check ArangoDB Server documentation for more details.
*
- * @var array
* @see https://www.arangodb.com/docs/stable/arangosearch-views.html#view-properties
*/
- protected $defaults = [
+ protected array $defaults = [
'writebufferActive' => 0,
'writebufferSizeMax' => 33554432,
'writebufferIdle' => 64,
diff --git a/docs/js/searchIndex.js b/docs/js/searchIndex.js
index 4ef918d..85aab65 100644
--- a/docs/js/searchIndex.js
+++ b/docs/js/searchIndex.js
@@ -238,7 +238,7 @@ Search.appendIndex(
}, {
"fqsen": "\\ArangoDB\\AQL\\Functions\\AQLFunction",
"name": "AQLFunction",
- "summary": "Represents\u0020an\u0020user\u0020defined\u0020aql\u0020function\u0020on\u0020server.",
+ "summary": "Represents\u0020a\u0020user\u0020defined\u0020AQL\u0020function\u0020on\u0020server.",
"url": "classes/ArangoDB-AQL-Functions-AQLFunction.html"
}, {
"fqsen": "\\ArangoDB\\AQL\\Functions\\AQLFunction\u003A\u003A__construct\u0028\u0029",
@@ -1243,7 +1243,7 @@ Search.appendIndex(
}, {
"fqsen": "\\ArangoDB\\DataStructures\\ArrayList\u003A\u003Aget\u0028\u0029",
"name": "get",
- "summary": "Get\u0020a\u0020value\u0020by\u0020it\u0027s\u0020key",
+ "summary": "Get\u0020a\u0020value\u0020by\u0020its\u0020key",
"url": "classes/ArangoDB-DataStructures-ArrayList.html#method_get"
}, {
"fqsen": "\\ArangoDB\\DataStructures\\ArrayList\u003A\u003Apush\u0028\u0029",
@@ -1383,7 +1383,7 @@ Search.appendIndex(
}, {
"fqsen": "\\ArangoDB\\Document\\Document\u003A\u003A__toString\u0028\u0029",
"name": "__toString",
- "summary": "Return\u0020an\u0020string\u0020representation\u0020of\u0020document.",
+ "summary": "Return\u0020a\u0020string\u0020representation\u0020of\u0020document.",
"url": "classes/ArangoDB-Document-Document.html#method___toString"
}, {
"fqsen": "\\ArangoDB\\Document\\Document\u003A\u003A__get\u0028\u0029",
diff --git a/docs/namespaces/arangodb-aql-functions.html b/docs/namespaces/arangodb-aql-functions.html
index 9f9c687..d8b4b2c 100644
--- a/docs/namespaces/arangodb-aql-functions.html
+++ b/docs/namespaces/arangodb-aql-functions.html
@@ -256,7 +256,7 @@
-
+
-
+
+ * Remove one edge definition from the graph
* This will only remove the edge collection,
* the vertex collections remain untouched and can still be used in your queries.
*
@@ -521,7 +520,7 @@ public function addVertexCollection(string $collection): bool
}
/**
- * Removes a vertex collection from the graph and optionally deletes the collection, if it is not used in any other graph.
+ * Removes a vertex collection from the graph and optionally deletes the collection, if it is not used in any other graph
* It can only remove vertex collections that are no longer part of edge definitions,
* if they are used in edge definitions you are required to modify those first.
*
@@ -727,15 +726,15 @@ public function getEdge(string $collection, string $edge)
/**
* Creates a new edge in the collection.
- * Within the attributes the edge has to contain a _from and _to value referencing to valid vertices in the graph.
- * Furthermore the edge has to be valid in the definition of the used.
+ * Within the attributes the edge has to contain a _from and _to value referencing to valid vertices in the graph
+ * Furthermore, the edge has to be valid in the definition of the used.
*
* @param string $collection The name of the edge collection the edge belongs to.
- * @param array $attributes The object attributes to be stored. Must contains '_to' and '_from' keys.
+ * @param array $attributes The object attributes to be stored. Must contain '_to' and '_from' keys.
* @param bool $waitForSync Define if the request should wait until synced to disk. Default is true.
* @param bool $returnNew Define if the response should contain the complete new version of the document. Default is false.
*
- * @return Edge|false A Edge object if edge exists. False if no graph with this name could be found
+ * @return bool True if Edge object exists. False if no graph with this name could be found
* or this collection is not part of the graph or one of the vertices ('_to' or '_from') does not exist.
*
* @throws DatabaseException|GuzzleException|ArangoException
@@ -820,7 +819,7 @@ public function dropEdge(string $collection, string $edge, bool $waitForSync = t
* @param int $depth Visits only nodes in at least the given depth.
* @param string $direction Direction for traversal. Must be either "outbound", "inbound", or "any".
*
- * @return TraversalCursor
+ * @return Traversal
*
* @throws CursorException|GuzzleException|ArangoException
*/
From 6bc51625b717bc16a6bedf06c96600cae1642352 Mon Sep 17 00:00:00 2001
From: "Lucas S. Vieira"
: bool
: bool
-
public
- addEdge(string $collection[, array<string|int, mixed> $attributes = [] ][, bool $waitForSync = true ][, bool $returnNew = false ]) : Edge|false
+ addEdge(string $collection[, array<string|int, mixed> $attributes = [] ][, bool $waitForSync = true ][, bool $returnNew = false ]) : bool
Furthermore the edge has to be valid in the definition of the used.
-The object attributes to be stored. Must contains '_to' and '_from' keys.
+The object attributes to be stored. Must contain '_to' and '_from' keys.
A Edge object if edge exists. False if no graph with this name could be found True if Edge object exists. False if no graph with this name could be found
+
or this collection is not part of the graph or one of the vertices ('_to' or '_from') does not exist.
Adds an edge definition to graph.
@@ -853,9 +853,9 @@Adds a vertex to graph.
@@ -949,9 +949,9 @@Adds a vertex collection to the set of orphan collections of the graph.
@@ -1015,9 +1015,9 @@Removes a graph from server, if possible.
@@ -1084,9 +1084,9 @@Drops an edge from graph.
@@ -1180,12 +1180,12 @@Remove one edge definition from the graph.<br> +
Remove one edge definition from the graph<br> This will only remove the edge collection, the vertex collections remain untouched and can still be used in your queries.
@@ -1264,9 +1264,9 @@Drops a vertex from graph.
@@ -1360,12 +1360,12 @@Removes a vertex collection from the graph and optionally deletes the collection, if it is not used in any other graph.<br> +
Removes a vertex collection from the graph and optionally deletes the collection, if it is not used in any other graph<br> It can only remove vertex collections that are no longer part of edge definitions,<br> if they are used in edge definitions you are required to modify those first.
@@ -1435,9 +1435,9 @@Returns an edge document.
@@ -1513,9 +1513,9 @@Return all edge definitions of graph.
@@ -1550,9 +1550,9 @@Returns the graph ID.
@@ -1587,9 +1587,9 @@Returns the graph key.
@@ -1624,9 +1624,9 @@Returns the minimal replication factor used for every new collection in the graph.
@@ -1661,9 +1661,9 @@Gets the graph name.
@@ -1698,9 +1698,9 @@Returns the number of shards that is used for every collection within this graph.
@@ -1735,9 +1735,9 @@Returns the orphan collections in the graph.
@@ -1772,9 +1772,9 @@Returns the replication factor used when initially creating collections for this graph.
@@ -1809,9 +1809,9 @@Gets the graph revision.
@@ -1846,9 +1846,9 @@Gets a vertex from the given collection.
@@ -1924,9 +1924,9 @@Lists all vertex collections within this graph.
@@ -1976,9 +1976,9 @@Returns true if is a new graph.
@@ -2013,9 +2013,9 @@If this graph is a smartGraph.
@@ -2050,9 +2050,9 @@Return a JSON representation of graph attributes.
@@ -2087,9 +2087,9 @@Save the Graph on server, if possible.
@@ -2143,9 +2143,9 @@Returns a array representation of graph.
@@ -2180,16 +2180,16 @@Returns a graph traversal.
public
- traversal(Vertex $vertex[, string $direction = Traversal::GRAPH_DIRECTION_ANY ][, int $depth = 0 ]) : TraversalCursor
+ traversal(Vertex $vertex[, string $direction = Traversal::GRAPH_DIRECTION_ANY ][, int $depth = 0 ]) : Traversal