@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | $ret = $this->modelType(); |
58 | 58 | |
59 | 59 | if (!is_null($suffix)) { |
60 | - $ret .= '_' . $suffix; |
|
60 | + $ret .= '_'.$suffix; |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | return $ret; |
@@ -176,8 +176,8 @@ discard block |
||
176 | 176 | $this->viewport('listing_fields', $listing_fields); |
177 | 177 | $this->viewport('listing_template', $listing_template); |
178 | 178 | |
179 | - $this->viewport('route_new', $this->router()->hyp($class_name::model_type() . '_new')); |
|
180 | - $this->viewport('route_export', $this->router()->hyp($class_name::model_type() . '_export')); |
|
179 | + $this->viewport('route_new', $this->router()->hyp($class_name::model_type().'_new')); |
|
180 | + $this->viewport('route_export', $this->router()->hyp($class_name::model_type().'_export')); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | public function copy() |
@@ -208,7 +208,7 @@ discard block |
||
208 | 208 | { |
209 | 209 | $this->errors = $model->save($this->operator()->operator_id()); // returns [errors] |
210 | 210 | if (empty($this->errors())) { |
211 | - $this->logger()->nice($this->l('CRUDITES_INSTANCE_ALTERED', [$this->l('MODEL_' . get_class($model)::model_type() . '_INSTANCE')])); |
|
211 | + $this->logger()->nice($this->l('CRUDITES_INSTANCE_ALTERED', [$this->l('MODEL_'.get_class($model)::model_type().'_INSTANCE')])); |
|
212 | 212 | return $model; |
213 | 213 | } |
214 | 214 | foreach ($this->errors() as $field => $error_msg) { |
@@ -221,7 +221,7 @@ discard block |
||
221 | 221 | public function before_edit() |
222 | 222 | { |
223 | 223 | if (!is_null($this->router()->params('id')) && is_null($this->load_model)) { |
224 | - $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_' . $this->modelClassName()::model_type() . '_INSTANCE')])); |
|
224 | + $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_'.$this->modelClassName()::model_type().'_INSTANCE')])); |
|
225 | 225 | $this->router()->hop($this->modelClassName()::model_type()); |
226 | 226 | } |
227 | 227 | } |
@@ -240,7 +240,7 @@ discard block |
||
240 | 240 | public function destroy_confirm() |
241 | 241 | { |
242 | 242 | if (is_null($this->load_model)) { |
243 | - $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_' . $this->model_type . '_INSTANCE')])); |
|
243 | + $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_'.$this->model_type.'_INSTANCE')])); |
|
244 | 244 | $this->router()->hop($this->model_type); |
245 | 245 | } |
246 | 246 | |
@@ -252,10 +252,10 @@ discard block |
||
252 | 252 | public function before_destroy() // default: checks for load_model and immortality, hops back to object on failure |
253 | 253 | { |
254 | 254 | if (is_null($this->load_model)) { |
255 | - $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_' . $this->model_type . '_INSTANCE')])); |
|
255 | + $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_NOT_FOUND', [$this->l('MODEL_'.$this->model_type.'_INSTANCE')])); |
|
256 | 256 | $this->router()->hop($this->model_type); |
257 | 257 | } elseif ($this->load_model->immortal()) { |
258 | - $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_IS_IMMORTAL', [$this->l('MODEL_' . $this->model_type . '_INSTANCE')])); |
|
258 | + $this->logger()->warning($this->l('CRUDITES_ERR_INSTANCE_IS_IMMORTAL', [$this->l('MODEL_'.$this->model_type.'_INSTANCE')])); |
|
259 | 259 | $this->router()->hop($this->route_model($this->load_model)); |
260 | 260 | } |
261 | 261 | } |
@@ -267,10 +267,10 @@ discard block |
||
267 | 267 | } |
268 | 268 | |
269 | 269 | if ($this->load_model->destroy($this->operator()->operator_id()) === false) { |
270 | - $this->logger()->info($this->l('CRUDITES_ERR_INSTANCE_IS_UNDELETABLE', ['' . $this->load_model])); |
|
270 | + $this->logger()->info($this->l('CRUDITES_ERR_INSTANCE_IS_UNDELETABLE', [''.$this->load_model])); |
|
271 | 271 | $this->route_back($this->load_model); |
272 | 272 | } else { |
273 | - $this->logger()->nice($this->l('CRUDITES_INSTANCE_DESTROYED', [$this->l('MODEL_' . $this->model_type . '_INSTANCE')])); |
|
273 | + $this->logger()->nice($this->l('CRUDITES_INSTANCE_DESTROYED', [$this->l('MODEL_'.$this->model_type.'_INSTANCE')])); |
|
274 | 274 | $this->route_back($this->model_type); |
275 | 275 | } |
276 | 276 | } |
@@ -294,7 +294,7 @@ discard block |
||
294 | 294 | public function collection_to_csv($collection, $filename) |
295 | 295 | { |
296 | 296 | // TODO use Format/File/CSV class to generate file |
297 | - $file_path = $this->get('settings.export.directory') . $filename . '.csv'; |
|
297 | + $file_path = $this->get('settings.export.directory').$filename.'.csv'; |
|
298 | 298 | $fp = fopen($file_path, 'w'); |
299 | 299 | |
300 | 300 | $header = false; |
@@ -331,7 +331,7 @@ discard block |
||
331 | 331 | |
332 | 332 | public function route_new(ModelInterface $model): string |
333 | 333 | { |
334 | - return $this->router()->hyp(get_class($model)::model_type() . '_new'); |
|
334 | + return $this->router()->hyp(get_class($model)::model_type().'_new'); |
|
335 | 335 | } |
336 | 336 | |
337 | 337 | public function route_list(ModelInterface $model): string |
@@ -343,7 +343,7 @@ discard block |
||
343 | 343 | { |
344 | 344 | $route_params = []; |
345 | 345 | |
346 | - $route_name = get_class($model)::model_type() . '_'; |
|
346 | + $route_name = get_class($model)::model_type().'_'; |
|
347 | 347 | if ($model->is_new()) { |
348 | 348 | $route_name .= 'new'; |
349 | 349 | } else { |
@@ -2,8 +2,8 @@ discard block |
||
2 | 2 | |
3 | 3 | namespace HexMakina\kadro\Controllers; |
4 | 4 | |
5 | -use HexMakina\kadro\Auth\{Operator,Permission,ACL}; |
|
6 | -use HexMakina\kadro\Auth\{OperatorInterface,AccessRefusedException}; |
|
5 | +use HexMakina\kadro\Auth\{Operator, Permission, ACL}; |
|
6 | +use HexMakina\kadro\Auth\{OperatorInterface, AccessRefusedException}; |
|
7 | 7 | use HexMakina\LeMarchand\LeMarchand; |
8 | 8 | |
9 | 9 | class Reception extends Kadro |
@@ -71,7 +71,7 @@ discard block |
||
71 | 71 | $this->logger()->nice($this->l('PAGE_CHECKIN_WELCOME', [$operator->name()])); |
72 | 72 | $this->router()->hop(); |
73 | 73 | } catch (\Exception $e) { |
74 | - $this->logger()->warning($this->l('KADRO_operator_' . $e->getMessage())); |
|
74 | + $this->logger()->warning($this->l('KADRO_operator_'.$e->getMessage())); |
|
75 | 75 | $this->router()->hop('checkin'); |
76 | 76 | } |
77 | 77 | } |
@@ -13,7 +13,7 @@ discard block |
||
13 | 13 | namespace HexMakina\kadro\Controllers; |
14 | 14 | |
15 | 15 | use HexMakina\Crudites\Crudites; |
16 | -use HexMakina\kadro\Auth\{Operator,OperatorInterface,ACL,AccessRefusedException}; |
|
16 | +use HexMakina\kadro\Auth\{Operator, OperatorInterface, ACL, AccessRefusedException}; |
|
17 | 17 | |
18 | 18 | class Operator extends \HexMakina\kadro\Controllers\ORM |
19 | 19 | { |
@@ -56,7 +56,7 @@ discard block |
||
56 | 56 | public function dashboard() |
57 | 57 | { |
58 | 58 | $real_operator_class = get_class($this->operator()); |
59 | - $this->viewport('users', $real_operator_class::filter([], ['order_by' => [null,'username', 'ASC']])); |
|
59 | + $this->viewport('users', $real_operator_class::filter([], ['order_by' => [null, 'username', 'ASC']])); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | public function destroy() |