@@ -20,7 +20,7 @@ |
||
20 | 20 | { |
21 | 21 | $query = Query::getInstance() |
22 | 22 | ->table('dummy') |
23 | - ->where('dummy.field like :field', ['field' => "%$field%"]); |
|
23 | + ->where('dummy.field like :field', [ 'field' => "%$field%" ]); |
|
24 | 24 | |
25 | 25 | $result = $this->repository->getByQuery($query); |
26 | 26 | if (is_null($result)) { |
@@ -44,13 +44,13 @@ |
||
44 | 44 | |
45 | 45 | if (!empty($orderBy)) { |
46 | 46 | if (!is_array($orderBy)) { |
47 | - $orderBy = [$orderBy]; |
|
47 | + $orderBy = [ $orderBy ]; |
|
48 | 48 | } |
49 | 49 | $query->orderBy($orderBy); |
50 | 50 | } |
51 | 51 | |
52 | 52 | foreach ((array)$filter as $item) { |
53 | - $query->where($item[0], $item[1]); |
|
53 | + $query->where($item[ 0 ], $item[ 1 ]); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | return $this->repository |
@@ -48,15 +48,15 @@ discard block |
||
48 | 48 | // get exit status |
49 | 49 | preg_match('/[0-9]+$/', $completeOutput, $matches); |
50 | 50 | |
51 | - $exitStatus = intval($matches[0]); |
|
51 | + $exitStatus = intval($matches[ 0 ]); |
|
52 | 52 | // if ($exitStatus !== 0) { |
53 | 53 | // exit($exitStatus); |
54 | 54 | // } |
55 | 55 | |
56 | 56 | // return exit status and intended output |
57 | - return array ( |
|
57 | + return array( |
|
58 | 58 | 'exit_status' => $exitStatus, |
59 | - 'output' => str_replace("Exit status : " . $matches[0], '', $completeOutput) |
|
59 | + 'output' => str_replace("Exit status : " . $matches[ 0 ], '', $completeOutput) |
|
60 | 60 | ); |
61 | 61 | } |
62 | 62 | |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | // Get User Variables |
74 | 74 | $variables = Psr11::container()->get('BUILDER_VARIABLES'); |
75 | 75 | foreach ((array)$variables as $variable => $value) { |
76 | - $this->dockerVariables["%$variable%"] = $this->replaceVariables($value); |
|
76 | + $this->dockerVariables[ "%$variable%" ] = $this->replaceVariables($value); |
|
77 | 77 | } |
78 | 78 | } |
79 | 79 |
@@ -9,9 +9,9 @@ |
||
9 | 9 | public function execute($workdir, $namespace, $composerName) |
10 | 10 | { |
11 | 11 | $directory = new \RecursiveDirectoryIterator($workdir); |
12 | - $filter = new \RecursiveCallbackFilterIterator($directory, function ($current/*, $key, $iterator*/) { |
|
12 | + $filter = new \RecursiveCallbackFilterIterator($directory, function($current/*, $key, $iterator*/) { |
|
13 | 13 | // Skip hidden files and directories. |
14 | - if ($current->getFilename()[0] === '.') { |
|
14 | + if ($current->getFilename()[ 0 ] === '.') { |
|
15 | 15 | return false; |
16 | 16 | } |
17 | 17 | if ($current->isDir()) { |
@@ -73,7 +73,7 @@ |
||
73 | 73 | $token = $this->createToken($metadata); |
74 | 74 | |
75 | 75 | $response->getResponseBag()->serializationRule(ResponseBag::SINGLE_OBJECT); |
76 | - $response->write(['token' => $token]); |
|
77 | - $response->write(['data' => $metadata]); |
|
76 | + $response->write([ 'token' => $token ]); |
|
77 | + $response->write([ 'data' => $metadata ]); |
|
78 | 78 | } |
79 | 79 | } |
@@ -17,7 +17,7 @@ discard block |
||
17 | 17 | * @throws \ByJG\Config\Exception\KeyNotFoundException |
18 | 18 | * @throws \Psr\SimpleCache\InvalidArgumentException |
19 | 19 | */ |
20 | - public function createToken($properties = []) |
|
20 | + public function createToken($properties = [ ]) |
|
21 | 21 | { |
22 | 22 | $jwt = new JwtWrapper(Psr11::container()->get('API_SERVER'), Psr11::container()->get('JWT_SECRET')); |
23 | 23 | $jwtData = $jwt->createJwtData($properties, 1800); |
@@ -35,7 +35,7 @@ discard block |
||
35 | 35 | try { |
36 | 36 | $jwt = new JwtWrapper(Psr11::container()->get('API_SERVER'), Psr11::container()->get('JWT_SECRET')); |
37 | 37 | $tokenInfo = json_decode(json_encode($jwt->extractData($token)), true); |
38 | - return $tokenInfo['data']; |
|
38 | + return $tokenInfo[ 'data' ]; |
|
39 | 39 | } catch (\Exception $ex) { |
40 | 40 | throw new Error401Exception($ex->getMessage()); |
41 | 41 | } |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | public function requireRole($role, $token = null) |
52 | 52 | { |
53 | 53 | $data = $this->requireAuthenticated($token); |
54 | - if ($data['role'] !== $role) { |
|
54 | + if ($data[ 'role' ] !== $role) { |
|
55 | 55 | throw new Error401Exception('Insufficient privileges - ' . print_r($data, true)); |
56 | 56 | } |
57 | 57 | return $data; |
@@ -123,14 +123,14 @@ discard block |
||
123 | 123 | |
124 | 124 | $migration = new Migration(new Uri($dbConnection), $this->workdir . "/db"); |
125 | 125 | $migration->registerDatabase("mysql", MySqlDatabase::class); |
126 | - $migration->addCallbackProgress(function ($cmd, $version) { |
|
126 | + $migration->addCallbackProgress(function($cmd, $version) { |
|
127 | 127 | echo "Doing $cmd, $version\n"; |
128 | 128 | }); |
129 | 129 | |
130 | 130 | $argumentList = $this->extractArguments($arguments); |
131 | 131 | |
132 | - $exec['reset'] = function () use ($migration, $argumentList) { |
|
133 | - if (!$argumentList["--yes"]) { |
|
132 | + $exec[ 'reset' ] = function() use ($migration, $argumentList) { |
|
133 | + if (!$argumentList[ "--yes" ]) { |
|
134 | 134 | throw new \Exception("Reset require the argument --yes"); |
135 | 135 | } |
136 | 136 | $migration->prepareEnvironment(); |
@@ -138,12 +138,12 @@ discard block |
||
138 | 138 | }; |
139 | 139 | |
140 | 140 | |
141 | - $exec["update"] = function () use ($migration, $argumentList) { |
|
142 | - $migration->update($argumentList["--up-to"], $argumentList["--force"]); |
|
141 | + $exec[ "update" ] = function() use ($migration, $argumentList) { |
|
142 | + $migration->update($argumentList[ "--up-to" ], $argumentList[ "--force" ]); |
|
143 | 143 | }; |
144 | 144 | |
145 | - if (isset($exec[$argumentList['command']])) { |
|
146 | - $exec[$argumentList['command']](); |
|
145 | + if (isset($exec[ $argumentList[ 'command' ] ])) { |
|
146 | + $exec[ $argumentList[ 'command' ] ](); |
|
147 | 147 | } |
148 | 148 | } |
149 | 149 | |
@@ -158,11 +158,11 @@ discard block |
||
158 | 158 | '--force' => false, |
159 | 159 | ]; |
160 | 160 | |
161 | - $ret['command'] = isset($arguments[0]) ? $arguments[0] : null; |
|
161 | + $ret[ 'command' ] = isset($arguments[ 0 ]) ? $arguments[ 0 ] : null; |
|
162 | 162 | |
163 | - for ($i=1; $i < count($arguments); $i++) { |
|
164 | - $args = explode("=", $arguments[$i]); |
|
165 | - $ret[$args[0]] = isset($args[1]) ? $args[1] : true; |
|
163 | + for ($i = 1; $i < count($arguments); $i++) { |
|
164 | + $args = explode("=", $arguments[ $i ]); |
|
165 | + $ret[ $args[ 0 ] ] = isset($args[ 1 ]) ? $args[ 1 ] : true; |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | return $ret; |