@@ -9,8 +9,8 @@ |
||
9 | 9 | * file that was distributed with this source code. |
10 | 10 | */ |
11 | 11 | |
12 | -if (file_exists(__DIR__.'/../vendor/autoload.php')) { |
|
13 | - require_once __DIR__.'/../vendor/autoload.php'; |
|
12 | +if (file_exists(__DIR__ . '/../vendor/autoload.php')) { |
|
13 | + require_once __DIR__ . '/../vendor/autoload.php'; |
|
14 | 14 | } else { |
15 | 15 | die('The test environment requires composer to install vendors, have you run composer?'); |
16 | 16 | } |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | |
126 | 126 | // Get filter1 ... filterN |
127 | 127 | while (true) { |
128 | - $filterURLName = $this->filterKey."$i"; |
|
128 | + $filterURLName = $this->filterKey . "$i"; |
|
129 | 129 | $filterStr = $this->request->query->filter( |
130 | 130 | $filterURLName, |
131 | 131 | '', |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | if (!isset($this->filter) || empty($this->filter)) { |
154 | 154 | $filter = $this->getFiltersFromInput(); |
155 | 155 | if (is_array($filter) && count($filter) > 0) { |
156 | - $this->filter = "(".implode(')*(', $filter).")"; |
|
156 | + $this->filter = "(" . implode(')*(', $filter) . ")"; |
|
157 | 157 | } |
158 | 158 | } |
159 | 159 | |
@@ -174,7 +174,7 @@ discard block |
||
174 | 174 | public function setFilter($filter) |
175 | 175 | { |
176 | 176 | if (is_array($filter)) { |
177 | - $this->filter = "(".implode(')*(', $filter).")"; |
|
177 | + $this->filter = "(" . implode(')*(', $filter) . ")"; |
|
178 | 178 | } else { |
179 | 179 | $this->filter = $filter; |
180 | 180 | } |
@@ -221,9 +221,9 @@ discard block |
||
221 | 221 | } elseif (substr($filter, 0, 1) == ',') { |
222 | 222 | $this->filter .= $filter; |
223 | 223 | } elseif (substr($filter, 0, 1) == '*') { |
224 | - $this->filter .= ','.(substr($filter, 1)); |
|
224 | + $this->filter .= ',' . (substr($filter, 1)); |
|
225 | 225 | } else { |
226 | - $this->filter .= ','.($filter); |
|
226 | + $this->filter .= ',' . ($filter); |
|
227 | 227 | } |
228 | 228 | } |
229 | 229 | |
@@ -243,9 +243,9 @@ discard block |
||
243 | 243 | } elseif (substr($filter, 0, 1) == '*') { |
244 | 244 | $this->filter .= $filter; |
245 | 245 | } elseif (substr($filter, 0, 1) == ',') { |
246 | - $this->filter .= '*'.(substr($filter, 1)); |
|
246 | + $this->filter .= '*' . (substr($filter, 1)); |
|
247 | 247 | } else { |
248 | - $this->filter .= '*'.($filter); |
|
248 | + $this->filter .= '*' . ($filter); |
|
249 | 249 | } |
250 | 250 | } |
251 | 251 |
@@ -349,9 +349,11 @@ |
||
349 | 349 | break; |
350 | 350 | } |
351 | 351 | } |
352 | - if (null === $or) { // make new or Object |
|
352 | + if (null === $or) { |
|
353 | +// make new or Object |
|
353 | 354 | $or = new Orx(); |
354 | - if (null !== $and) { // add existing and |
|
355 | + if (null !== $and) { |
|
356 | +// add existing and |
|
355 | 357 | $this->addBtoA($or, $and); |
356 | 358 | } |
357 | 359 | } |
@@ -78,16 +78,16 @@ |
||
78 | 78 | return $expr->gte($column, $config->toParam($value, 'compare', $field)); |
79 | 79 | |
80 | 80 | case 'search': |
81 | - return $expr->like($column, $config->toParam('%'.$value.'%', 'compare', $field)); |
|
81 | + return $expr->like($column, $config->toParam('%' . $value . '%', 'compare', $field)); |
|
82 | 82 | |
83 | 83 | case 'like': |
84 | 84 | return $expr->like($column, $config->toParam($value, 'compare', $field)); |
85 | 85 | |
86 | 86 | case 'likefirst': |
87 | - return $expr->like($column, $config->toParam('%'.$value, 'compare', $field)); |
|
87 | + return $expr->like($column, $config->toParam('%' . $value, 'compare', $field)); |
|
88 | 88 | |
89 | 89 | case 'likelast': |
90 | - return $expr->like($column, $config->toParam($value.'%', 'compare', $field)); |
|
90 | + return $expr->like($column, $config->toParam($value . '%', 'compare', $field)); |
|
91 | 91 | |
92 | 92 | case 'null': |
93 | 93 | return $expr->orX($expr->isNull($column), $expr->eq($column, '')); |
@@ -176,7 +176,7 @@ |
||
176 | 176 | if (preg_match('~^(year|month|week|day|hour|min):\s*(.*)$~i', $value, $res)) { |
177 | 177 | $type = strtolower($res[1]); |
178 | 178 | if (strlen($res[2]) == 4) { |
179 | - $res[2] = "01.01.".$res[2]; |
|
179 | + $res[2] = "01.01." . $res[2]; |
|
180 | 180 | } |
181 | 181 | $time = strtotime($res[2]); |
182 | 182 | } elseif (preg_match('~(year|month|week|day|hour|min|tomorrow)~', $value, $res)) { |
@@ -161,7 +161,7 @@ |
||
161 | 161 | { |
162 | 162 | foreach ($restrictions as $field => $ops) { |
163 | 163 | // accept registered operators only |
164 | - $ops = array_filter(array_intersect((array) $ops, array_keys($this->ops))); |
|
164 | + $ops = array_filter(array_intersect((array)$ops, array_keys($this->ops))); |
|
165 | 165 | if (!empty($ops)) { |
166 | 166 | $this->restrictions[$field] = $ops; |
167 | 167 | } |
@@ -128,7 +128,7 @@ |
||
128 | 128 | return $getMethod; |
129 | 129 | } |
130 | 130 | |
131 | - $isMethod = 'is' . ucfirst($name); |
|
131 | + $isMethod = 'is' . ucfirst($name); |
|
132 | 132 | if (method_exists($this, $isMethod)) { |
133 | 133 | return $isMethod; |
134 | 134 | } |
@@ -73,7 +73,8 @@ discard block |
||
73 | 73 | |
74 | 74 | if (isset($config['update'])) { |
75 | 75 | foreach ($config['update'] as $field) { |
76 | - if (!isset($changeSet[$field])) { // let manual values |
|
76 | + if (!isset($changeSet[$field])) { |
|
77 | +// let manual values |
|
77 | 78 | $needChanges = true; |
78 | 79 | $meta->getReflectionProperty($field)->setValue($object, $ea->getUserIdValue($meta, $field)); |
79 | 80 | } |
@@ -143,7 +144,8 @@ discard block |
||
143 | 144 | if ($config = $this->getConfiguration($om, $meta->name)) { |
144 | 145 | if (isset($config['update'])) { |
145 | 146 | foreach ($config['update'] as $field) { |
146 | - if ($meta->getReflectionProperty($field)->getValue($object) === null) { // let manual values |
|
147 | + if ($meta->getReflectionProperty($field)->getValue($object) === null) { |
|
148 | +// let manual values |
|
147 | 149 | $meta->getReflectionProperty($field)->setValue($object, $ea->getUserIdValue($meta, $field)); |
148 | 150 | } |
149 | 151 | } |
@@ -151,7 +153,8 @@ discard block |
||
151 | 153 | |
152 | 154 | if (isset($config['create'])) { |
153 | 155 | foreach ($config['create'] as $field) { |
154 | - if ($meta->getReflectionProperty($field)->getValue($object) === null) { // let manual values |
|
156 | + if ($meta->getReflectionProperty($field)->getValue($object) === null) { |
|
157 | +// let manual values |
|
155 | 158 | $meta->getReflectionProperty($field)->setValue($object, $ea->getUserIdValue($meta, $field)); |
156 | 159 | } |
157 | 160 | } |
@@ -33,7 +33,7 @@ |
||
33 | 33 | } |
34 | 34 | |
35 | 35 | if (!isset($event['method'])) { |
36 | - $event['method'] = 'on'.preg_replace([ |
|
36 | + $event['method'] = 'on' . preg_replace([ |
|
37 | 37 | '/(?<=\b)[a-z]/ie', |
38 | 38 | '/[^a-z0-9]/i' |
39 | 39 | ], ['strtoupper("\\0")', ''], $event['event']); |
@@ -29,7 +29,7 @@ discard block |
||
29 | 29 | */ |
30 | 30 | public function __construct($debug) |
31 | 31 | { |
32 | - $this->debug = (bool) $debug; |
|
32 | + $this->debug = (bool)$debug; |
|
33 | 33 | } |
34 | 34 | |
35 | 35 | /** |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | ->fixXmlConfig('fallback') |
57 | 57 | ->children() |
58 | 58 | ->arrayNode('fallbacks') |
59 | - ->beforeNormalization()->ifString()->then(function ($v) { |
|
59 | + ->beforeNormalization()->ifString()->then(function($v) { |
|
60 | 60 | return [$v]; |
61 | 61 | })->end() |
62 | 62 | ->prototype('scalar')->end() |