Skip to content

Commit 41247e6

Browse files
committed
- Some changes for best practices
- corrected typos - removed redundant escape from regex
1 parent d3fcab1 commit 41247e6

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

lib/ArangoDBClient/Batch.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -339,7 +339,7 @@ public function append($method, $request)
339339
}
340340

341341
if (null === $this->_nextBatchPartId) {
342-
if (is_a($this->_batchParts, 'SplFixedArray')) {
342+
if (is_a($this->_batchParts, \SplFixedArray::class)) {
343343
$nextNumeric = $this->_nextId;
344344
$this->_nextId++;
345345
} else {

lib/ArangoDBClient/Document.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -636,7 +636,7 @@ public function setInternalId($id)
636636
}
637637

638638

639-
if (!preg_match('/^[a-zA-Z0-9_-]{1,64}\/[a-zA-Z0-9_:\.@\-()+,=;$!*\'%]{1,254}$/', $id)) {
639+
if (!preg_match('/^[a-zA-Z0-9_-]{1,64}\/[a-zA-Z0-9_:.@\-()+,=;$!*\'%]{1,254}$/', $id)) {
640640
throw new ClientException('Invalid format for document id');
641641
}
642642

@@ -660,7 +660,7 @@ public function setInternalKey($key)
660660
throw new ClientException('Should not update the key of an existing document');
661661
}
662662

663-
if (!preg_match('/^[a-zA-Z0-9_:\.@\-()+,=;$!*\'%]{1,254}$/', $key)) {
663+
if (!preg_match('/^[a-zA-Z0-9_:.@\-()+,=;$!*\'%]{1,254}$/', $key)) {
664664
throw new ClientException('Invalid format for document key');
665665
}
666666

lib/ArangoDBClient/FoxxHandler.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,14 +24,14 @@ class FoxxHandler extends Handler
2424
* @throws ClientException
2525
*
2626
* @param string $localZip - the path to the local foxx-app zip-archive to upload/install
27-
* @param string $mountPoint - the mountpoint for the app, must begin with a '/'
27+
* @param string $mountPoint - the mount-point for the app, must begin with a '/'
2828
* @param array $options - for future usage
2929
*
3030
* @return array - the server response
3131
*
3232
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
3333
*/
34-
public function installFoxxZip($localZip, $mountPoint, $options = [])
34+
public function installFoxxZip($localZip, $mountPoint, array $options = [])
3535
{
3636
if (!file_exists($localZip)) {
3737
throw new ClientException("Foxx-Zip {$localZip} does not exist (or file is unreadable).");
@@ -68,7 +68,7 @@ public function installFoxxZip($localZip, $mountPoint, $options = [])
6868
*
6969
* @SuppressWarnings(PHPMD.UnusedFormalParameter)
7070
*/
71-
public function removeFoxxApp($mountPoint, $options = [])
71+
public function removeFoxxApp($mountPoint, array $options = [])
7272
{
7373
try {
7474
$response = $this->getConnection()->put(Urls::URL_FOXX_UNINSTALL, json_encode(['mount' => $mountPoint]));

lib/ArangoDBClient/GraphHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ public function properties($graph)
250250
* @throws Exception
251251
*
252252
* @param mixed $graph - graph name as a string or instance of Graph
253-
* @param bool $dropCollections - if set to false the graphs collections will not be droped.
253+
* @param bool $dropCollections - if set to false the graphs collections will not be dropped.
254254
*
255255
* @return bool - always true, will throw if there is an error
256256
* @since 1.2

0 commit comments

Comments
 (0)