Skip to content

Commit 360304e

Browse files
committed
Project-wide code reformat according to PSR-2 + some more intuitive styling
1 parent 2c37cb6 commit 360304e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+3874
-3978
lines changed

lib/triagens/ArangoDb/AdminHandler.php

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,7 @@ public function getServerVersion($details = false)
5555

5656
if ($details) {
5757
return $data;
58-
}
59-
else {
58+
} else {
6059
return $data['version'];
6160
}
6261
}
@@ -133,6 +132,7 @@ public function getServerLog($options = [])
133132
{
134133
$url = UrlHelper::appendParamsUrl(Urls::URL_ADMIN_LOG, $options);
135134
$response = $this->getConnection()->get($url);
135+
136136
return $response->getJson();
137137
}
138138

@@ -148,7 +148,7 @@ public function getServerLog($options = [])
148148
* @return bool
149149
* @since 1.2
150150
* @deprecated
151-
* @todo remove in version 3.1
151+
* @todo remove in version 3.1
152152
*/
153153
public function flushServerModuleCache()
154154
{
@@ -201,6 +201,7 @@ public function getServerStatistics()
201201
{
202202
$url = UrlHelper::appendParamsUrl(Urls::URL_ADMIN_STATISTICS, []);
203203
$response = $this->getConnection()->get($url);
204+
204205
return $response->getJson();
205206
}
206207

@@ -234,6 +235,7 @@ public function getServerStatisticsDescription($options = [])
234235
{
235236
$url = UrlHelper::appendParamsUrl(Urls::URL_ADMIN_STATISTICS_DESCRIPTION, $options);
236237
$response = $this->getConnection()->get($url);
238+
237239
return $response->getJson();
238240
}
239241
}

lib/triagens/ArangoDb/AqlUserFunction.php

Lines changed: 39 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,8 @@ class AqlUserFunction
9494
* )
9595
*
9696
*
97-
* @param Connection $connection - the connection to be used
98-
* @param array $attributesArray - user function initialization data
97+
* @param Connection $connection - the connection to be used
98+
* @param array $attributesArray - user function initialization data
9999
*
100100
*/
101101
public function __construct(Connection $connection, array $attributesArray = null)
@@ -138,6 +138,7 @@ public function register($name = null, $code = null)
138138
Urls::URL_AQL_USER_FUNCTION,
139139
$this->getConnection()->json_encode_wrapper($attributes)
140140
);
141+
141142
return $response->getJson();
142143
}
143144

@@ -149,7 +150,7 @@ public function register($name = null, $code = null)
149150
*
150151
* If $name is passed, it will override the object's property with the passed one
151152
*
152-
* @param string $name
153+
* @param string $name
153154
* @param boolean $namespace
154155
*
155156
* @throws Exception throw exception if the request fails
@@ -169,6 +170,7 @@ public function unregister($name = null, $namespace = false)
169170
}
170171

171172
$response = $this->_connection->delete($url);
173+
172174
return $response->getJson();
173175
}
174176

@@ -207,20 +209,20 @@ protected function getConnection()
207209
}
208210

209211

210-
/**
211-
* Set name of the user function. It must have at least one namespace, but also can have sub-namespaces.
212-
* correct:
213-
* 'myNamespace:myFunction'
214-
* 'myRootNamespace:mySubNamespace:myFunction'
215-
*
216-
* wrong:
217-
* 'myFunction'
218-
*
219-
*
220-
* @param string $value
221-
*
222-
* @throws \triagens\ArangoDb\ClientException
223-
*/
212+
/**
213+
* Set name of the user function. It must have at least one namespace, but also can have sub-namespaces.
214+
* correct:
215+
* 'myNamespace:myFunction'
216+
* 'myRootNamespace:mySubNamespace:myFunction'
217+
*
218+
* wrong:
219+
* 'myFunction'
220+
*
221+
*
222+
* @param string $value
223+
*
224+
* @throws \triagens\ArangoDb\ClientException
225+
*/
224226
public function setName($value)
225227
{
226228
$this->set(self::ENTRY_NAME, (string) $value);
@@ -237,13 +239,13 @@ public function getName()
237239
return $this->get(self::ENTRY_NAME);
238240
}
239241

240-
/**
241-
* Set user function code
242-
*
243-
* @param string $value
244-
*
245-
* @throws \triagens\ArangoDb\ClientException
246-
*/
242+
/**
243+
* Set user function code
244+
*
245+
* @param string $value
246+
*
247+
* @throws \triagens\ArangoDb\ClientException
248+
*/
247249
public function setCode($value)
248250
{
249251
$this->set(self::ENTRY_CODE, (string) $value);
@@ -261,22 +263,23 @@ public function getCode()
261263
}
262264

263265

264-
/**
265-
* Set an attribute
266-
*
267-
* @param $key
268-
* @param $value
269-
*
270-
* @return $this
271-
* @throws ClientException
272-
*/
266+
/**
267+
* Set an attribute
268+
*
269+
* @param $key
270+
* @param $value
271+
*
272+
* @return $this
273+
* @throws ClientException
274+
*/
273275
public function set($key, $value)
274276
{
275277
if (!is_string($key)) {
276278
throw new ClientException('Invalid attribute key');
277279
}
278280

279281
$this->attributes[$key] = $value;
282+
280283
return $this;
281284
}
282285

@@ -291,8 +294,8 @@ public function set($key, $value)
291294
*
292295
* @magic
293296
*
294-
* @param string $key - attribute name
295-
* @param mixed $value - value for attribute
297+
* @param string $key - attribute name
298+
* @param mixed $value - value for attribute
296299
*/
297300
public function __set($key, $value)
298301
{
@@ -321,6 +324,7 @@ public function get($key)
321324
if (isset($this->attributes[$key])) {
322325
return $this->attributes[$key];
323326
}
327+
324328
return null;
325329
}
326330

0 commit comments

Comments
 (0)