@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | public function __toString() |
30 | 30 | { |
31 | - return $this->iso_name() . ' (' . $this->get(self::ISO_3) . ')'; |
|
31 | + return $this->iso_name().' ('.$this->get(self::ISO_3).')'; |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | public function traceable(): bool |
@@ -74,11 +74,11 @@ discard block |
||
74 | 74 | } |
75 | 75 | |
76 | 76 | if (isset($filter['types'])) { |
77 | - $wc = sprintf("AND " . self::ISO_TYPE . " IN ('%s') ", implode('\', \'', array_keys(self::ISO_TYPES))); |
|
77 | + $wc = sprintf("AND ".self::ISO_TYPE." IN ('%s') ", implode('\', \'', array_keys(self::ISO_TYPES))); |
|
78 | 78 | $Query->and_where($wc); |
79 | 79 | } |
80 | 80 | if (isset($filter['scopes'])) { |
81 | - $wc = sprintf("AND " . self::ISO_SCOPE . " IN ('%s') ", implode('\', \'', array_keys(self::ISO_SCOPES))); |
|
81 | + $wc = sprintf("AND ".self::ISO_SCOPE." IN ('%s') ", implode('\', \'', array_keys(self::ISO_SCOPES))); |
|
82 | 82 | $Query->and_where($wc); |
83 | 83 | } |
84 | 84 |
@@ -42,8 +42,8 @@ discard block |
||
42 | 42 | $dir_content = FileSystem::preg_scandir($base_dir, '/^[A-Z]{1}[A-Za-z]+(?!\.class.\.php)$/'); |
43 | 43 | |
44 | 44 | foreach ($dir_content as $res) { |
45 | - if (is_dir($fullpath = $base_dir . '/' . $res)) { |
|
46 | - $this->addNamespace('HexMakina\kadro\\' . $res, $fullpath, $prepend); |
|
45 | + if (is_dir($fullpath = $base_dir.'/'.$res)) { |
|
46 | + $this->addNamespace('HexMakina\kadro\\'.$res, $fullpath, $prepend); |
|
47 | 47 | $this->addNamespaceTree($fullpath); |
48 | 48 | } |
49 | 49 | } |
@@ -53,10 +53,10 @@ discard block |
||
53 | 53 | { |
54 | 54 | |
55 | 55 | // normalize namespace prefix |
56 | - $prefix = trim($prefix, '\\') . '\\'; |
|
56 | + $prefix = trim($prefix, '\\').'\\'; |
|
57 | 57 | |
58 | 58 | // normalize the base directory with a trailing separator |
59 | - $base_dir = rtrim($base_dir, DIRECTORY_SEPARATOR) . '/'; |
|
59 | + $base_dir = rtrim($base_dir, DIRECTORY_SEPARATOR).'/'; |
|
60 | 60 | |
61 | 61 | // initialize the namespace prefix array |
62 | 62 | if (isset($this->prefixes[$prefix]) === false) { |
@@ -88,10 +88,10 @@ discard block |
||
88 | 88 | // class name to find a mapped file name |
89 | 89 | while (false !== $pos = strrpos($prefix, '\\')) { |
90 | 90 | // retain the trailing namespace separator in the prefix |
91 | - $prefix = substr($class, 0, $pos + 1); |
|
91 | + $prefix = substr($class, 0, $pos+1); |
|
92 | 92 | // var_dump("prefix: $prefix"); |
93 | 93 | // the rest is the relative class name |
94 | - $relative_class = substr($class, $pos + 1); |
|
94 | + $relative_class = substr($class, $pos+1); |
|
95 | 95 | // try to load a mapped file for the prefix and relative class |
96 | 96 | |
97 | 97 | $mapped_file = $this->loadMappedFile($prefix, $relative_class); |
@@ -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 OperatorController extends \HexMakina\kadro\Controllers\ORMController |
19 | 19 | { |
@@ -59,7 +59,7 @@ discard block |
||
59 | 59 | public function dashboard() |
60 | 60 | { |
61 | 61 | $real_operator_class = get_class($this->operator()); |
62 | - $this->viewport('users', $real_operator_class::filter([], ['order_by' => [null,'username', 'ASC']])); |
|
62 | + $this->viewport('users', $real_operator_class::filter([], ['order_by' => [null, 'username', 'ASC']])); |
|
63 | 63 | } |
64 | 64 | |
65 | 65 | public function destroy() |
@@ -50,10 +50,10 @@ discard block |
||
50 | 50 | |
51 | 51 | |
52 | 52 | $this->viewport('file_root', $this->router()->file_root()); |
53 | - $this->viewport('view_path', $this->router()->file_root() . $this->box('settings.smarty.template_path') . 'app/'); |
|
53 | + $this->viewport('view_path', $this->router()->file_root().$this->box('settings.smarty.template_path').'app/'); |
|
54 | 54 | $this->viewport('web_root', $this->router()->web_root()); |
55 | - $this->viewport('view_url', $this->router()->web_root() . $this->box('settings.smarty.template_path')); |
|
56 | - $this->viewport('images_url', $this->router()->web_root() . $this->box('settings.smarty.template_path') . 'images/'); |
|
55 | + $this->viewport('view_url', $this->router()->web_root().$this->box('settings.smarty.template_path')); |
|
56 | + $this->viewport('images_url', $this->router()->web_root().$this->box('settings.smarty.template_path').'images/'); |
|
57 | 57 | |
58 | 58 | foreach ($this->viewport() as $template_var_name => $value) { |
59 | 59 | $smarty->assign($template_var_name, $value); |
@@ -83,8 +83,8 @@ discard block |
||
83 | 83 | // 1. check for custom template in the current controller directory |
84 | 84 | $templates ['custom_3'] = sprintf('%s/%s.html', $controller_template_path, $custom_template); |
85 | 85 | // 2. check for custom template formatted as controller/view |
86 | - $templates ['custom_2'] = $custom_template . '.html'; |
|
87 | - $templates ['custom_1'] = '_layouts/' . $custom_template . '.html'; |
|
86 | + $templates ['custom_2'] = $custom_template.'.html'; |
|
87 | + $templates ['custom_1'] = '_layouts/'.$custom_template.'.html'; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | if (!empty($this->router()->target_method())) { |
@@ -58,15 +58,15 @@ |
||
58 | 58 | |
59 | 59 | private function trim_request_data() |
60 | 60 | { |
61 | - array_walk_recursive($_GET, function (&$value) { |
|
61 | + array_walk_recursive($_GET, function(&$value) { |
|
62 | 62 | $value = trim($value); |
63 | 63 | }); |
64 | - array_walk_recursive($_REQUEST, function (&$value) { |
|
64 | + array_walk_recursive($_REQUEST, function(&$value) { |
|
65 | 65 | $value = trim($value); |
66 | 66 | }); |
67 | 67 | |
68 | 68 | if ($this->router()->submits()) { |
69 | - array_walk_recursive($_POST, function (&$value) { |
|
69 | + array_walk_recursive($_POST, function(&$value) { |
|
70 | 70 | $value = trim($value); |
71 | 71 | }); |
72 | 72 | } |
@@ -2,7 +2,7 @@ |
||
2 | 2 | |
3 | 3 | namespace HexMakina\kadro\Controllers; |
4 | 4 | |
5 | -use Psr\Container\{ContainerInterface,ContainerExceptionInterface,NotFoundExceptionInterface}; |
|
5 | +use Psr\Container\{ContainerInterface, ContainerExceptionInterface, NotFoundExceptionInterface}; |
|
6 | 6 | use HexMakina\kadro\Auth\{OperatorInterface, AccessRefusedException}; |
7 | 7 | use HexMakina\Hopper\RouterInterface; |
8 | 8 | use HexMakina\LogLaddy\LoggerInterface; |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | namespace HexMakina\kadro; |
4 | 4 | |
5 | 5 | use HexMakina\TightORM\Interfaces\ModelInterface; |
6 | -use HexMakina\Marker\{Form,Element}; |
|
6 | +use HexMakina\Marker\{Form, Element}; |
|
7 | 7 | |
8 | 8 | class TableToForm |
9 | 9 | { |
@@ -137,7 +137,7 @@ discard block |
||
137 | 137 | $form_field = new Element('div', $form_field, ['class' => $group_class]); |
138 | 138 | } |
139 | 139 | } |
140 | - $ret .= PHP_EOL . $form_field; |
|
140 | + $ret .= PHP_EOL.$form_field; |
|
141 | 141 | } |
142 | 142 | |
143 | 143 | return $ret; |
@@ -3,7 +3,7 @@ discard block |
||
3 | 3 | namespace HexMakina\kadro\Auth; |
4 | 4 | |
5 | 5 | use HexMakina\Crudites\Interfaces\SelectInterface; |
6 | -use HexMakina\TightORM\{TightModel,RelationManyToMany}; |
|
6 | +use HexMakina\TightORM\{TightModel, RelationManyToMany}; |
|
7 | 7 | |
8 | 8 | class Operator extends TightModel implements OperatorInterface |
9 | 9 | { |
@@ -81,7 +81,7 @@ discard block |
||
81 | 81 | } |
82 | 82 | |
83 | 83 | if (isset($filters['model']) && !empty($filters['model'])) { |
84 | - $Query->join([static::otm('t'), static::otm('a')], [[static::otm('a'),static::otm('k'), 't_from','id']], 'INNER'); |
|
84 | + $Query->join([static::otm('t'), static::otm('a')], [[static::otm('a'), static::otm('k'), 't_from', 'id']], 'INNER'); |
|
85 | 85 | $Query->aw_fields_eq(['model_id' => $filters['model']->get_id(), 'model_type' => get_class($filters['model'])::model_type()], static::otm('a')); |
86 | 86 | } |
87 | 87 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | public function has_permission($p): bool |
137 | 137 | { |
138 | 138 | // new instances or inactive operators, none shall pass |
139 | - if ($this->is_new() === true || $this->is_active() === false) { |
|
139 | + if ($this->is_new() === true || $this->is_active() === false) { |
|
140 | 140 | return false; |
141 | 141 | } |
142 | 142 |
@@ -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 | |
8 | 8 | class ReceptionController extends KadroController |
9 | 9 | { |
@@ -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 | } |