@@ -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 |
@@ -8,18 +8,18 @@ discard block |
||
8 | 8 | { |
9 | 9 | |
10 | 10 | /** |
11 | - * An associative array where the key is a namespace prefix and the value |
|
12 | - * is an array of base directories for classes in that namespace. |
|
13 | - * |
|
14 | - * @var array |
|
15 | - */ |
|
11 | + * An associative array where the key is a namespace prefix and the value |
|
12 | + * is an array of base directories for classes in that namespace. |
|
13 | + * |
|
14 | + * @var array |
|
15 | + */ |
|
16 | 16 | protected $prefixes = []; |
17 | 17 | |
18 | 18 | /** |
19 | - * Register loader with SPL autoloader stack. |
|
20 | - * |
|
21 | - * @return void |
|
22 | - */ |
|
19 | + * Register loader with SPL autoloader stack. |
|
20 | + * |
|
21 | + * @return void |
|
22 | + */ |
|
23 | 23 | |
24 | 24 | public function register() |
25 | 25 | { |
@@ -27,16 +27,16 @@ discard block |
||
27 | 27 | } |
28 | 28 | |
29 | 29 | /** |
30 | - * Adds a base directory for a namespace prefix. |
|
31 | - * |
|
32 | - * @param string $prefix The namespace prefix. |
|
33 | - * @param string $base_dir A base directory for class files in the |
|
34 | - * namespace. |
|
35 | - * @param bool $prepend If true, prepend the base directory to the stack |
|
36 | - * instead of appending it; this causes it to be searched first rather |
|
37 | - * than last. |
|
38 | - * @return void |
|
39 | - */ |
|
30 | + * Adds a base directory for a namespace prefix. |
|
31 | + * |
|
32 | + * @param string $prefix The namespace prefix. |
|
33 | + * @param string $base_dir A base directory for class files in the |
|
34 | + * namespace. |
|
35 | + * @param bool $prepend If true, prepend the base directory to the stack |
|
36 | + * instead of appending it; this causes it to be searched first rather |
|
37 | + * than last. |
|
38 | + * @return void |
|
39 | + */ |
|
40 | 40 | public function addNamespaceTree($base_dir, $prepend = false) |
41 | 41 | { |
42 | 42 | $dir_content = FileSystem::preg_scandir($base_dir, '/^[A-Z]{1}[A-Za-z]+(?!\.class.\.php)$/'); |
@@ -72,12 +72,12 @@ discard block |
||
72 | 72 | } |
73 | 73 | |
74 | 74 | /** |
75 | - * Loads the class file for a given class name. |
|
76 | - * |
|
77 | - * @param string $class The fully-qualified class name. |
|
78 | - * @return mixed The mapped file name on success, or boolean false on |
|
79 | - * failure. |
|
80 | - */ |
|
75 | + * Loads the class file for a given class name. |
|
76 | + * |
|
77 | + * @param string $class The fully-qualified class name. |
|
78 | + * @return mixed The mapped file name on success, or boolean false on |
|
79 | + * failure. |
|
80 | + */ |
|
81 | 81 | public function loadClass($class) |
82 | 82 | { |
83 | 83 | // var_dump(__FUNCTION__."($class)"); |
@@ -108,13 +108,13 @@ discard block |
||
108 | 108 | } |
109 | 109 | |
110 | 110 | /** |
111 | - * Load the mapped file for a namespace prefix and relative class. |
|
112 | - * |
|
113 | - * @param string $prefix The namespace prefix. |
|
114 | - * @param string $relative_class The relative class name. |
|
115 | - * @return mixed Boolean false if no mapped file can be loaded, or the |
|
116 | - * name of the mapped file that was loaded. |
|
117 | - */ |
|
111 | + * Load the mapped file for a namespace prefix and relative class. |
|
112 | + * |
|
113 | + * @param string $prefix The namespace prefix. |
|
114 | + * @param string $relative_class The relative class name. |
|
115 | + * @return mixed Boolean false if no mapped file can be loaded, or the |
|
116 | + * name of the mapped file that was loaded. |
|
117 | + */ |
|
118 | 118 | protected function loadMappedFile($prefix, $relative_class) |
119 | 119 | { |
120 | 120 | // are there any base directories for this namespace prefix? |
@@ -143,11 +143,11 @@ discard block |
||
143 | 143 | } |
144 | 144 | |
145 | 145 | /** |
146 | - * If a file exists, require it from the file system. |
|
147 | - * |
|
148 | - * @param string $file The file to require. |
|
149 | - * @return bool True if the file exists, false if not. |
|
150 | - */ |
|
146 | + * If a file exists, require it from the file system. |
|
147 | + * |
|
148 | + * @param string $file The file to require. |
|
149 | + * @return bool True if the file exists, false if not. |
|
150 | + */ |
|
151 | 151 | protected function requireFile($file) |
152 | 152 | { |
153 | 153 | // var_dump(__FUNCTION__."($file)"); |
@@ -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() |
@@ -5,7 +5,7 @@ |
||
5 | 5 | interface DisplayControllerInterface extends BaseControllerInterface |
6 | 6 | { |
7 | 7 | |
8 | - /* |
|
8 | + /* |
|
9 | 9 | The viewport is an associative array of values to be exported as variables in the view |
10 | 10 | the assoc keys will be the variable names |
11 | 11 |
@@ -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 |
@@ -22,7 +22,7 @@ |
||
22 | 22 | |
23 | 23 | public function event_label() |
24 | 24 | { |
25 | - return '' . $this; |
|
25 | + return ''.$this; |
|
26 | 26 | } |
27 | 27 | |
28 | 28 | public static function today($format = Dato::FORMAT) |