Skip to content

Commit fc3f7d4

Browse files
committed
Merge pull request arangodb#83 from F21/psr2
Fixed formatting to psr2 standards.
2 parents 8e35197 + c7ca119 commit fc3f7d4

25 files changed

+294
-305
lines changed

examples/collection.php

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -7,45 +7,42 @@
77
try {
88
$connection = new Connection($connectionOptions);
99
$handler = new CollectionHandler($connection);
10-
10+
1111
// create a new collection
1212
$col = new Collection();
1313
$col->setName("hihi");
1414
$result = $handler->add($col);
1515
var_dump($result);
16-
16+
1717
// get an existing collection
1818
$result = $handler->get("hihi");
1919
var_dump($result);
2020

2121
// get an existing collection
2222
$result = $handler->get("hihi");
2323
var_dump($result);
24-
24+
2525
// get number of documents from an existing collection
2626
$result = $handler->getCount("hihi");
2727
var_dump($result);
28-
28+
2929
// get figures for an existing collection
3030
$result = $handler->getFigures("hihi");
3131
var_dump($result);
32-
32+
3333
// delete the collection
3434
$result = $handler->delete("hihi");
3535
var_dump($result);
36-
36+
3737
// rename a collection
3838
// $handler->rename($col, "hihi30");
39-
39+
4040
// truncate an existing collection
4141
// $result = $handler->truncate("hihi");
42-
}
43-
catch (ConnectException $e) {
42+
} catch (ConnectException $e) {
4443
print $e . PHP_EOL;
45-
}
46-
catch (ServerException $e) {
44+
} catch (ServerException $e) {
4745
print $e . PHP_EOL;
48-
}
49-
catch (ClientException $e) {
46+
} catch (ClientException $e) {
5047
print $e . PHP_EOL;
5148
}

examples/document.php

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@
4242
unset($userFromServer->name);
4343
$result = $handler->update($userFromServer);
4444
var_dump($result);
45-
45+
4646
// get the updated document back
4747
$result = $handler->get("users", $id);
4848
var_dump($result);
@@ -51,13 +51,10 @@
5151
$result = $handler->deleteById("users", $id);
5252
var_dump($result);
5353

54-
}
55-
catch (ConnectException $e) {
54+
} catch (ConnectException $e) {
5655
print $e . PHP_EOL;
57-
}
58-
catch (ServerException $e) {
56+
} catch (ServerException $e) {
5957
print $e . PHP_EOL;
60-
}
61-
catch (ClientException $e) {
58+
} catch (ClientException $e) {
6259
print $e . PHP_EOL;
6360
}

examples/graph.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,8 @@
5454
$result1 = $graphHandler->removeEdge('Graph', 'edge1');
5555
} catch (ConnectException $e) {
5656
print $e . PHP_EOL;
57-
}
58-
catch (ServerException $e) {
57+
} catch (ServerException $e) {
5958
print $e . PHP_EOL;
60-
}
61-
catch (ClientException $e) {
59+
} catch (ClientException $e) {
6260
print $e . PHP_EOL;
6361
}

examples/init.php

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,3 @@
2626
ConnectionOptions::OPTION_CREATE => false, // do not create unknown collections automatically
2727
ConnectionOptions::OPTION_UPDATE_POLICY => UpdatePolicy::LAST, // last update wins
2828
);
29-

examples/select.php

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@
1818

1919
foreach ($statements as $query => $bindVars) {
2020
$statement = new Statement($connection, array(
21-
"query" => $query,
22-
"count" => true,
23-
"batchSize" => 1000,
24-
"bindVars" => $bindVars,
21+
"query" => $query,
22+
"count" => true,
23+
"batchSize" => 1000,
24+
"bindVars" => $bindVars,
2525
"sanitize" => true,
2626
));
2727

@@ -30,13 +30,10 @@
3030
$cursor = $statement->execute();
3131
var_dump($cursor->getAll());
3232
}
33-
}
34-
catch (ConnectException $e) {
33+
} catch (ConnectException $e) {
3534
print $e . PHP_EOL;
36-
}
37-
catch (ServerException $e) {
35+
} catch (ServerException $e) {
3836
print $e . PHP_EOL;
39-
}
40-
catch (ClientException $e) {
37+
} catch (ClientException $e) {
4138
print $e . PHP_EOL;
4239
}

lib/triagens/ArangoDb/AdminHandler.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,4 +222,4 @@ public function getServerRequestStatistics($options = array())
222222

223223
return $data;
224224
}
225-
}
225+
}

lib/triagens/ArangoDb/Autoloader.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public static function init()
4242
self::checkEnvironment();
4343

4444
self::$libDir = dirname(__FILE__) . DIRECTORY_SEPARATOR;
45-
45+
4646
spl_autoload_register(__NAMESPACE__ . '\Autoloader::load');
4747
}
4848

lib/triagens/ArangoDb/BatchPart.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ public function getProcessedResponse()
260260
$json = $response->getJson();
261261
$id = $json[Edge::ENTRY_ID];
262262
$response = $json;
263-
$options = $this->getCursorOptions();
263+
$options = $this->getCursorOptions();
264264
$options['isNew'] = false;
265265
$response = Edge::createFromArray($json, $options);
266266
break;
@@ -275,7 +275,7 @@ public function getProcessedResponse()
275275
$json = $response->getJson();
276276
$id = $json[Collection::ENTRY_ID];
277277
$response = $json;
278-
$options = $this->getCursorOptions();
278+
$options = $this->getCursorOptions();
279279
$options['isNew'] = false;
280280
$response = Collection::createFromArray($json, $options);
281281
break;
@@ -287,7 +287,7 @@ public function getProcessedResponse()
287287
}
288288
break;
289289
case 'cursor':
290-
$options = $this->getCursorOptions();
290+
$options = $this->getCursorOptions();
291291
$options['isNew'] = false;
292292
$response = new Cursor($this->_batch->getConnection(), $response->getJson(), $options);
293293
break;
@@ -309,4 +309,4 @@ private function getCursorOptions()
309309
{
310310
return $this->_cursorOptions;
311311
}
312-
}
312+
}

lib/triagens/ArangoDb/Connection.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ private function executeRequest($method, $url, $data)
367367
// call tracer func
368368
$traceFunc('receive', $result);
369369
}
370-
370+
371371
if ($status['timed_out']) {
372372
throw new ClientException('Got a timeout when waiting on the server\'s response');
373373
}

lib/triagens/ArangoDb/Document.php

Lines changed: 39 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ class Document
5151
* @var bool
5252
*/
5353
protected $_changed;
54-
55-
/**
56-
* Flag to indicate whether document is a new document (never been saved to the server)
57-
*
58-
* @var bool
59-
*/
54+
55+
/**
56+
* Flag to indicate whether document is a new document (never been saved to the server)
57+
*
58+
* @var bool
59+
*/
6060
protected $_isNew = true;
6161

6262
/**
@@ -80,10 +80,10 @@ class Document
8080
* Revision id index
8181
*/
8282
const ENTRY_REV = '_rev';
83-
84-
/**
85-
* isNew id index
86-
*/
83+
84+
/**
85+
* isNew id index
86+
*/
8787
const ENTRY_ISNEW = '_isNew';
8888

8989
/**
@@ -123,10 +123,10 @@ public function __construct(array $options = array())
123123
if (array_key_exists('_hiddenAttributes', $options)) {
124124
$this->setHiddenAttributes($options['_hiddenAttributes']);
125125
}
126-
126+
127127
if (array_key_exists('_isNew', $options)) {
128128
$this->setIsNew($options['_isNew']);
129-
}
129+
}
130130
}
131131

132132
/**
@@ -277,11 +277,11 @@ public function set($key, $value)
277277

278278
return;
279279
}
280-
281-
if ($key === self::ENTRY_ISNEW) {
282-
$this->setIsNew($value);
283-
284-
return;
280+
281+
if ($key === self::ENTRY_ISNEW) {
282+
$this->setIsNew($value);
283+
284+
return;
285285
}
286286

287287
if (!$this->_changed) {
@@ -452,28 +452,28 @@ public function getChanged()
452452
{
453453
return $this->_changed;
454454
}
455-
456-
/**
457-
* Set the isNew flag
458-
*
459-
* @param bool $isNew - flags if new or existing doc
460-
*
461-
* @return void
462-
*/
463-
public function setIsNew($isNew)
464-
{
465-
$this->_isNew = (bool)$isNew;
466-
}
467-
468-
/**
469-
* Get the isNew flag
470-
*
471-
* @return bool $isNew - flags if new or existing doc
472-
*/
473-
public function getIsNew()
474-
{
475-
return $this->_isNew;
476-
}
455+
456+
/**
457+
* Set the isNew flag
458+
*
459+
* @param bool $isNew - flags if new or existing doc
460+
*
461+
* @return void
462+
*/
463+
public function setIsNew($isNew)
464+
{
465+
$this->_isNew = (bool)$isNew;
466+
}
467+
468+
/**
469+
* Get the isNew flag
470+
*
471+
* @return bool $isNew - flags if new or existing doc
472+
*/
473+
public function getIsNew()
474+
{
475+
return $this->_isNew;
476+
}
477477

478478
/**
479479
* Set the internal document id

0 commit comments

Comments
 (0)