Skip to content

Commit d570f3d

Browse files
committed
Code reformatting
1 parent 8663169 commit d570f3d

17 files changed

+782
-754
lines changed

lib/triagens/ArangoDb/ConnectionOptions.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,7 +310,7 @@ private static function getDefaults()
310310
self::OPTION_RECONNECT => false,
311311
self::OPTION_BATCH => false,
312312
self::OPTION_BATCHPART => false,
313-
self::OPTION_DATABASE => '_system',
313+
self::OPTION_DATABASE => '_system',
314314
self::OPTION_CHECK_UTF8_CONFORM => DefaultValues::DEFAULT_CHECK_UTF8_CONFORM,
315315
);
316316
}

lib/triagens/ArangoDb/Cursor.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ class Cursor implements
7474
* @var int
7575
*/
7676
private $_length;
77-
77+
7878
/**
7979
* full count of the result set (ignoring the outermost LIMIT)
8080
*
@@ -96,7 +96,7 @@ class Cursor implements
9696
* result entry for result documents
9797
*/
9898
const ENTRY_RESULT = 'result';
99-
99+
100100
/**
101101
* result entry for the full count (ignoring the outermost LIMIT)
102102
*/
@@ -129,9 +129,9 @@ public function __construct(Connection $connection, array $data, array $options)
129129
if (isset($data[self::ENTRY_ID])) {
130130
$this->_id = $data[self::ENTRY_ID];
131131
}
132-
132+
133133
if (isset($data['extra'][self::FULL_COUNT])) {
134-
$this->_fullCount = $data['extra'][self::FULL_COUNT];
134+
$this->_fullCount = $data['extra'][self::FULL_COUNT];
135135
}
136136

137137
// attribute must be there
@@ -189,15 +189,15 @@ public function getCount()
189189

190190
return $this->_length;
191191
}
192-
192+
193193
/**
194194
* Get the full count of the cursor (ignoring the outermost LIMIT)
195-
*
195+
*
196196
* @return int - total number of results
197197
*/
198198
public function getFullCount()
199199
{
200-
return $this->_fullCount;
200+
return $this->_fullCount;
201201
}
202202

203203

lib/triagens/ArangoDb/Statement.php

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ class Statement
7676
* @var bool
7777
*/
7878
private $_doCount = false;
79-
79+
8080
/**
8181
* The count flag (should server return total number of results ignoring the limit)
8282
* Be careful! This option also prevents ArangoDB from using some server side optimizations!
@@ -125,7 +125,7 @@ class Statement
125125
* Bind variables index
126126
*/
127127
const ENTRY_BINDVARS = 'bindVars';
128-
128+
129129
/**
130130
* Full count option index
131131
*/
@@ -169,9 +169,9 @@ public function __construct(Connection $connection, array $data)
169169
if (isset($data[self::ENTRY_BINDVARS])) {
170170
$this->_bindVars->set($data[self::ENTRY_BINDVARS]);
171171
}
172-
172+
173173
if (isset($data[self::FULL_COUNT])) {
174-
$this->_fullCount = (bool) $data[Cursor::FULL_COUNT];
174+
$this->_fullCount = (bool) $data[Cursor::FULL_COUNT];
175175
}
176176

177177
if (isset($data[Cursor::ENTRY_SANITIZE])) {
@@ -353,7 +353,7 @@ public function getCount()
353353
{
354354
return $this->_doCount;
355355
}
356-
356+
357357
/**
358358
* Set the full count option for the statement
359359
*
@@ -363,17 +363,17 @@ public function getCount()
363363
*/
364364
public function setFullCount($value)
365365
{
366-
$this->_fullCount = (bool) $value;
366+
$this->_fullCount = (bool) $value;
367367
}
368-
368+
369369
/**
370370
* Get the full count option value of the statement
371371
*
372372
* @return bool - current value of full count option
373373
*/
374374
public function getFullCount()
375375
{
376-
return $this->_fullCount;
376+
return $this->_fullCount;
377377
}
378378

379379
/**
@@ -421,10 +421,9 @@ private function buildData()
421421
$data = array(
422422
self::ENTRY_QUERY => $this->_query,
423423
self::ENTRY_COUNT => $this->_doCount,
424-
425-
'options' => array(
426-
self::FULL_COUNT => $this->_fullCount
427-
)
424+
'options' => array(
425+
self::FULL_COUNT => $this->_fullCount
426+
)
428427
);
429428

430429
if ($this->_bindVars->getCount() > 0) {

lib/triagens/ArangoDb/Traversal.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* The object requires the connection object, the startVertex, the edgeCollection and the optional parameters.<br>
1919
* <br>
2020
*
21-
* @link http://www.arangodb.org/manuals/1.4/HttpTraversals.html
21+
* @link http://www.arangodb.org/manuals/1.4/HttpTraversals.html
2222
*
2323
* @package triagens\ArangoDb
2424
* @since 1.4

tests/BatchTest.php

Lines changed: 22 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -142,14 +142,14 @@ public function testCreateDocumentBatch()
142142
$documentHandler = $this->documentHandler;
143143

144144
$document = Document::createFromArray(
145-
array('someAttribute' => 'someValue', 'someOtherAttribute' => 'someOtherValue')
145+
array('someAttribute' => 'someValue', 'someOtherAttribute' => 'someOtherValue')
146146
);
147147
$documentId = $documentHandler->add($this->collection->getId(), $document);
148148

149149
$this->assertTrue(is_numeric($documentId), 'Did not return an id!');
150150

151151
$document = Document::createFromArray(
152-
array('someAttribute' => 'someValue2', 'someOtherAttribute' => 'someOtherValue2')
152+
array('someAttribute' => 'someValue2', 'someOtherAttribute' => 'someOtherValue2')
153153
);
154154
$documentId = $documentHandler->add($this->collection->getId(), $document);
155155

@@ -192,8 +192,8 @@ public function testCreateMixedBatchWithPartIds()
192192

193193
$resultingAttribute = $resultingCollection->getName();
194194
$this->assertTrue(
195-
$name === $resultingAttribute,
196-
'The created collection name and resulting collection name do not match!'
195+
$name === $resultingAttribute,
196+
'The created collection name and resulting collection name do not match!'
197197
);
198198

199199
$this->assertEquals(Collection::getDefaultType(), $resultingCollection->getType());
@@ -205,15 +205,18 @@ public function testCreateMixedBatchWithPartIds()
205205
$documentHandler = $this->documentHandler;
206206
$batch->nextBatchPartId('doc1');
207207
$document = Document::createFromArray(
208-
array('someAttribute' => 'someValue', 'someOtherAttribute' => 'someOtherValue')
208+
array('someAttribute' => 'someValue', 'someOtherAttribute' => 'someOtherValue')
209209
);
210210
$documentId = $documentHandler->add($resultingCollectionId, $document);
211211

212212
$this->assertTrue(is_numeric($documentId), 'Did not return a fake numeric id!');
213213

214214
for ($i = 0; $i <= 10; ++$i) {
215215
$document = Document::createFromArray(
216-
array('someAttribute' => 'someValue' . $i, 'someOtherAttribute' => 'someOtherValue2' . $i)
216+
array(
217+
'someAttribute' => 'someValue' . $i,
218+
'someOtherAttribute' => 'someOtherValue2' . $i
219+
)
217220
);
218221
$documentId = $documentHandler->add($resultingCollectionId, $document);
219222
}
@@ -246,10 +249,10 @@ public function testCreateMixedBatchWithPartIds()
246249
$edgeDocumentHandler = new EdgeHandler($connection);
247250
$edgeDocument->set('label', 'knows');
248251
$edgeDocumentHandler->saveEdge(
249-
$edgeCollection->getName(),
250-
$document1->getHandle(),
251-
$document2->getHandle(),
252-
$edgeDocument
252+
$edgeCollection->getName(),
253+
$document1->getHandle(),
254+
$document2->getHandle(),
255+
$edgeDocument
253256
);
254257

255258
$batch->process();
@@ -258,8 +261,8 @@ public function testCreateMixedBatchWithPartIds()
258261

259262

260263
$this->assertFalse(
261-
is_a($edge, 'triagens\ArangoDb\HttpResponse'),
262-
'Edge batch creation did return an error: ' . print_r($edge, true)
264+
is_a($edge, 'triagens\ArangoDb\HttpResponse'),
265+
'Edge batch creation did return an error: ' . print_r($edge, true)
263266
);
264267
$this->assertTrue($edge == !'', 'Edge batch creation did return empty string: ' . print_r($edge, true));
265268

@@ -276,9 +279,9 @@ public function testCreateMixedBatchWithPartIds()
276279
$batch->nextBatchPartId('myBatchPart');
277280
// set cursor options for the next batchpart
278281
$batch->nextBatchPartCursorOptions(
279-
array(
280-
"sanitize" => true,
281-
)
282+
array(
283+
"sanitize" => true,
284+
)
282285
);
283286

284287

@@ -305,10 +308,10 @@ public function testCreateMixedBatchWithPartIds()
305308
$stmtCursor = $batch->getProcessedPartResponse('myBatchPart');
306309

307310
$this->assertTrue(
308-
count($stmtCursor->getAll()) == 13,
309-
'At the time of statement execution there should be 13 documents found! Found: ' . count(
310-
$stmtCursor->getAll()
311-
)
311+
count($stmtCursor->getAll()) == 13,
312+
'At the time of statement execution there should be 13 documents found! Found: ' . count(
313+
$stmtCursor->getAll()
314+
)
312315
);
313316

314317
// This fails but we'll just make a note because such a query is not needed to be batched.

0 commit comments

Comments
 (0)