@@ -38,14 +38,14 @@ discard block |
||
38 | 38 | |
39 | 39 | //-------------------------------------------------------------------- |
40 | 40 | |
41 | - public function __construct( $ci=null ) |
|
41 | + public function __construct($ci = null) |
|
42 | 42 | { |
43 | 43 | if (is_object($ci)) |
44 | 44 | { |
45 | - $this->ci =& $ci; |
|
45 | + $this->ci = & $ci; |
|
46 | 46 | } |
47 | 47 | else { |
48 | - $this->ci =& get_instance(); |
|
48 | + $this->ci = & get_instance(); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | // Ensure that the database is loaded. |
@@ -65,7 +65,7 @@ discard block |
||
65 | 65 | * @param string $group |
66 | 66 | * @return bool |
67 | 67 | */ |
68 | - public function save($key, $value=null, $group='app') |
|
68 | + public function save($key, $value = null, $group = 'app') |
|
69 | 69 | { |
70 | 70 | if (empty($this->ci->db) || ! is_object($this->ci->db)) |
71 | 71 | { |
@@ -100,7 +100,7 @@ discard block |
||
100 | 100 | * @param string $group |
101 | 101 | * @return mixed |
102 | 102 | */ |
103 | - public function get($key, $group='app') |
|
103 | + public function get($key, $group = 'app') |
|
104 | 104 | { |
105 | 105 | if (empty($this->ci->db) || ! is_object($this->ci->db)) |
106 | 106 | { |
@@ -115,7 +115,7 @@ discard block |
||
115 | 115 | $query = $this->ci->db->where($where) |
116 | 116 | ->get('settings'); |
117 | 117 | |
118 | - if (! $query->num_rows()) |
|
118 | + if ( ! $query->num_rows()) |
|
119 | 119 | { |
120 | 120 | return false; |
121 | 121 | } |
@@ -123,7 +123,7 @@ discard block |
||
123 | 123 | $value = $query->row()->value; |
124 | 124 | |
125 | 125 | // Check to see if it needs to be unserialized |
126 | - $data = @unserialize($value); // We don't need to issue an E_NOTICE here... |
|
126 | + $data = @unserialize($value); // We don't need to issue an E_NOTICE here... |
|
127 | 127 | |
128 | 128 | // Check for a value of false or |
129 | 129 | if ($value === 'b:0;' || $data !== false) |
@@ -143,7 +143,7 @@ discard block |
||
143 | 143 | * @param $group |
144 | 144 | * @return mixed |
145 | 145 | */ |
146 | - public function delete($key, $group='app') |
|
146 | + public function delete($key, $group = 'app') |
|
147 | 147 | { |
148 | 148 | if (empty($this->ci->db) || ! is_object($this->ci->db)) |
149 | 149 | { |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | $query = $this->ci->db->where($field, $value) |
178 | 178 | ->get('settings'); |
179 | 179 | |
180 | - if (! $query->num_rows()) |
|
180 | + if ( ! $query->num_rows()) |
|
181 | 181 | { |
182 | 182 | return false; |
183 | 183 | } |
@@ -193,7 +193,7 @@ discard block |
||
193 | 193 | * @param string $group |
194 | 194 | * @return mixed |
195 | 195 | */ |
196 | - public function all($group=null) |
|
196 | + public function all($group = null) |
|
197 | 197 | { |
198 | 198 | if (empty($this->ci->db) || ! is_object($this->ci->db)) |
199 | 199 | { |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | |
203 | 203 | $query = $this->ci->db->get('settings'); |
204 | 204 | |
205 | - if (! $query->num_rows()) |
|
205 | + if ( ! $query->num_rows()) |
|
206 | 206 | { |
207 | 207 | return false; |
208 | 208 | } |
@@ -70,15 +70,15 @@ discard block |
||
70 | 70 | { |
71 | 71 | foreach ($user_stores as $alias => $class) |
72 | 72 | { |
73 | - self::$stores[ strtolower($alias) ] = new $class(); |
|
73 | + self::$stores[strtolower($alias)] = new $class(); |
|
74 | 74 | } |
75 | 75 | } |
76 | 76 | |
77 | 77 | self::$default_store = config_item('settings.default_store'); |
78 | 78 | |
79 | - if (empty(self::$stores[ self::$default_store ])) |
|
79 | + if (empty(self::$stores[self::$default_store])) |
|
80 | 80 | { |
81 | - show_error( lang('settings.bad_default') ); |
|
81 | + show_error(lang('settings.bad_default')); |
|
82 | 82 | } |
83 | 83 | } |
84 | 84 | |
@@ -92,7 +92,7 @@ discard block |
||
92 | 92 | * @param string $group |
93 | 93 | * @param string $store |
94 | 94 | */ |
95 | - public static function save($key, $value=null, $group='app', $store=null) |
|
95 | + public static function save($key, $value = null, $group = 'app', $store = null) |
|
96 | 96 | { |
97 | 97 | self::init(); |
98 | 98 | |
@@ -103,7 +103,7 @@ discard block |
||
103 | 103 | $store = self::$default_store; |
104 | 104 | } |
105 | 105 | |
106 | - return self::$stores[ $store ]->save($key, $value, $group); |
|
106 | + return self::$stores[$store]->save($key, $value, $group); |
|
107 | 107 | } |
108 | 108 | |
109 | 109 | //-------------------------------------------------------------------- |
@@ -118,7 +118,7 @@ discard block |
||
118 | 118 | * @param string $store |
119 | 119 | * @return mixed |
120 | 120 | */ |
121 | - public static function get($key, $group='app', $store=null) |
|
121 | + public static function get($key, $group = 'app', $store = null) |
|
122 | 122 | { |
123 | 123 | self::init(); |
124 | 124 | |
@@ -126,13 +126,13 @@ discard block |
||
126 | 126 | |
127 | 127 | // If the store is specified but doesn't exist, crap out |
128 | 128 | // so that they developer has a chance to fix it. |
129 | - if (! is_null($store) && empty(self::$stores[$store])) |
|
129 | + if ( ! is_null($store) && empty(self::$stores[$store])) |
|
130 | 130 | { |
131 | - show_error( sprintf( lang('settings.cant_retrieve'), $store ) ); |
|
131 | + show_error(sprintf(lang('settings.cant_retrieve'), $store)); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | // If $store is set, get the value from that store only. |
135 | - if (! empty($store)) |
|
135 | + if ( ! empty($store)) |
|
136 | 136 | { |
137 | 137 | return self::$stores[$store]->get($key, $group); |
138 | 138 | } |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * @param $store |
161 | 161 | * @return mixed |
162 | 162 | */ |
163 | - public static function delete($key, $group='app', $store=null) |
|
163 | + public static function delete($key, $group = 'app', $store = null) |
|
164 | 164 | { |
165 | 165 | self::init(); |
166 | 166 | |
@@ -168,19 +168,19 @@ discard block |
||
168 | 168 | |
169 | 169 | // If the store is specified but doesn't exist, crap out |
170 | 170 | // so that they developer has a chance to fix it. |
171 | - if (! is_null($store) && empty(self::$stores[$store])) |
|
171 | + if ( ! is_null($store) && empty(self::$stores[$store])) |
|
172 | 172 | { |
173 | - show_error( sprintf( lang('settings.cant_retrieve'), $store ) ); |
|
173 | + show_error(sprintf(lang('settings.cant_retrieve'), $store)); |
|
174 | 174 | } |
175 | 175 | |
176 | 176 | // If $store is set, get the value from that store only. |
177 | - if (! empty($store)) |
|
177 | + if ( ! empty($store)) |
|
178 | 178 | { |
179 | 179 | return self::$stores[$store]->delete($key, $group); |
180 | 180 | } |
181 | 181 | |
182 | 182 | // Otherwise delete from the default store |
183 | - return self::$stores[ self::$default_store ]->delete($key, $group); |
|
183 | + return self::$stores[self::$default_store]->delete($key, $group); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | //-------------------------------------------------------------------- |
@@ -215,15 +215,15 @@ discard block |
||
215 | 215 | * @param string $group |
216 | 216 | * @return mixed |
217 | 217 | */ |
218 | - public static function all($group=null, $store=null) |
|
218 | + public static function all($group = null, $store = null) |
|
219 | 219 | { |
220 | 220 | self::init(); |
221 | 221 | |
222 | 222 | $group = strtolower($group); |
223 | 223 | |
224 | - if (! empty($store)) |
|
224 | + if ( ! empty($store)) |
|
225 | 225 | { |
226 | - return self::$stores[ $store ]->all($group); |
|
226 | + return self::$stores[$store]->all($group); |
|
227 | 227 | } |
228 | 228 | |
229 | 229 | // Otherwise combine the results from all stores |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | $found = $s->all($group); |
235 | 235 | if ($found) |
236 | 236 | { |
237 | - $results = array_merge($results, (array)$found); |
|
237 | + $results = array_merge($results, (array) $found); |
|
238 | 238 | } |
239 | 239 | } |
240 | 240 | |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | |
257 | 257 | if (class_exists($class)) |
258 | 258 | { |
259 | - self::$stores[ strtolower($alias) ] = new $class(); |
|
259 | + self::$stores[strtolower($alias)] = new $class(); |
|
260 | 260 | return true; |
261 | 261 | } |
262 | 262 |
@@ -47,7 +47,7 @@ discard block |
||
47 | 47 | * @param null $value |
48 | 48 | * @param string $group |
49 | 49 | */ |
50 | - public function save($key, $value=null, $group='app'); |
|
50 | + public function save($key, $value = null, $group = 'app'); |
|
51 | 51 | |
52 | 52 | //-------------------------------------------------------------------- |
53 | 53 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @param string $group |
59 | 59 | * @return mixed |
60 | 60 | */ |
61 | - public function get($key, $group='app'); |
|
61 | + public function get($key, $group = 'app'); |
|
62 | 62 | |
63 | 63 | //-------------------------------------------------------------------- |
64 | 64 | |
@@ -69,7 +69,7 @@ discard block |
||
69 | 69 | * @param $group |
70 | 70 | * @return mixed |
71 | 71 | */ |
72 | - public function delete($key, $group='app'); |
|
72 | + public function delete($key, $group = 'app'); |
|
73 | 73 | |
74 | 74 | //-------------------------------------------------------------------- |
75 | 75 | |
@@ -90,7 +90,7 @@ discard block |
||
90 | 90 | * @param string $group |
91 | 91 | * @return mixed |
92 | 92 | */ |
93 | - public function all($group=null); |
|
93 | + public function all($group = null); |
|
94 | 94 | |
95 | 95 | //-------------------------------------------------------------------- |
96 | 96 |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php namespace Myth\Themers; |
2 | 2 | |
3 | -require_once dirname(__FILE__) .'/escape.php'; |
|
3 | +require_once dirname(__FILE__).'/escape.php'; |
|
4 | 4 | |
5 | 5 | /** |
6 | 6 | * Sprint |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | * |
109 | 109 | * @return mixed |
110 | 110 | */ |
111 | - public function set($alias, $value=null, $escape=true) |
|
111 | + public function set($alias, $value = null, $escape = true) |
|
112 | 112 | { |
113 | 113 | if (is_array($alias)) |
114 | 114 | { |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | return $this; |
129 | 129 | } |
130 | 130 | |
131 | - $this->meta[ strtolower($alias) ] = $escape ? esc($value, 'htmlAttr') : $value; |
|
131 | + $this->meta[strtolower($alias)] = $escape ? esc($value, 'htmlAttr') : $value; |
|
132 | 132 | |
133 | 133 | return $this; |
134 | 134 | } |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | { |
147 | 147 | $alias = strtolower($alias); |
148 | 148 | |
149 | - return isset($this->meta[ $alias ]) ? $this->meta[$alias] : null; |
|
149 | + return isset($this->meta[$alias]) ? $this->meta[$alias] : null; |
|
150 | 150 | } |
151 | 151 | |
152 | 152 | //-------------------------------------------------------------------- |
@@ -158,7 +158,7 @@ discard block |
||
158 | 158 | */ |
159 | 159 | public function renderTags() |
160 | 160 | { |
161 | - if (! count($this->meta)) |
|
161 | + if ( ! count($this->meta)) |
|
162 | 162 | { |
163 | 163 | return null; |
164 | 164 | } |
@@ -227,7 +227,7 @@ discard block |
||
227 | 227 | * @param $alias |
228 | 228 | * @param null $value |
229 | 229 | */ |
230 | - public function __set($alias, $value=null) |
|
230 | + public function __set($alias, $value = null) |
|
231 | 231 | { |
232 | 232 | $this->set($alias, $value); |
233 | 233 | } |
@@ -41,7 +41,7 @@ |
||
41 | 41 | * |
42 | 42 | * @return mixed |
43 | 43 | */ |
44 | - public function set($alias, $value=null); |
|
44 | + public function set($alias, $value = null); |
|
45 | 45 | |
46 | 46 | //-------------------------------------------------------------------- |
47 | 47 |
@@ -249,7 +249,7 @@ |
||
249 | 249 | * @param int $cache_minutes |
250 | 250 | * @return mixed |
251 | 251 | */ |
252 | - public function call($command, $cache_minutes=0); |
|
252 | + public function call($command, $cache_minutes = 0); |
|
253 | 253 | |
254 | 254 | //-------------------------------------------------------------------- |
255 | 255 |
@@ -86,8 +86,8 @@ discard block |
||
86 | 86 | |
87 | 87 | $theme = empty($this->theme) ? $this->default_theme : $this->theme; |
88 | 88 | |
89 | - if (! isset($this->folders[$theme])) { |
|
90 | - throw new \LogicException( sprintf( lang('theme.bad_folder'), $theme ) ); |
|
89 | + if ( ! isset($this->folders[$theme])) { |
|
90 | + throw new \LogicException(sprintf(lang('theme.bad_folder'), $theme)); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | $this->active_theme = $theme; |
@@ -95,7 +95,7 @@ discard block |
||
95 | 95 | // Make the path available within views. |
96 | 96 | $this->vars['theme_path'] = $this->folders[$theme]; |
97 | 97 | |
98 | - return $this->display($this->folders[$theme] . '/' . $this->layout); |
|
98 | + return $this->display($this->folders[$theme].'/'.$this->layout); |
|
99 | 99 | } |
100 | 100 | |
101 | 101 | //-------------------------------------------------------------------- |
@@ -123,12 +123,11 @@ discard block |
||
123 | 123 | |
124 | 124 | $module = $this->ci->router->fetch_module(); |
125 | 125 | |
126 | - if (! empty($module) && substr($dir, -strlen($module .'/')) == $module . '/') { |
|
126 | + if ( ! empty($module) && substr($dir, -strlen($module.'/')) == $module.'/') { |
|
127 | 127 | $dir = ''; |
128 | 128 | } |
129 | 129 | |
130 | - $view = ! empty($this->view) ? $this->view : |
|
131 | - $dir . $this->ci->router->fetch_class() . '/' . $this->ci->router->fetch_method(); |
|
130 | + $view = ! empty($this->view) ? $this->view : $dir.$this->ci->router->fetch_class().'/'.$this->ci->router->fetch_method(); |
|
132 | 131 | |
133 | 132 | return $this->display($view); |
134 | 133 | } |
@@ -153,12 +152,12 @@ discard block |
||
153 | 152 | * @param string $cache_name A custom name for the cached file. |
154 | 153 | * @return mixed |
155 | 154 | */ |
156 | - public function display($view, $data = array(), $cache_time = 0, $cache_name=null) |
|
155 | + public function display($view, $data = array(), $cache_time = 0, $cache_name = null) |
|
157 | 156 | { |
158 | 157 | if (empty($cache_name)) |
159 | 158 | { |
160 | - $cache_name = 'theme_view_' . $view . '_' . $this->ci->router->fetch_class() . '_' . $this->ci->router->fetch_method(); |
|
161 | - $cache_name = str_replace( '/', '_', $cache_name ); |
|
159 | + $cache_name = 'theme_view_'.$view.'_'.$this->ci->router->fetch_class().'_'.$this->ci->router->fetch_method(); |
|
160 | + $cache_name = str_replace('/', '_', $cache_name); |
|
162 | 161 | } |
163 | 162 | |
164 | 163 | if ($cache_time == 0 || ! $output = $this->ci->cache->get($cache_name)) |
@@ -167,43 +166,43 @@ discard block |
||
167 | 166 | $variant_view = NULL; |
168 | 167 | |
169 | 168 | // Pull out the theme from the view, if given. |
170 | - if ( strpos( $view, ':' ) !== FALSE ) |
|
169 | + if (strpos($view, ':') !== FALSE) |
|
171 | 170 | { |
172 | - list( $theme, $view ) = explode( ':', $view ); |
|
171 | + list($theme, $view) = explode(':', $view); |
|
173 | 172 | |
174 | 173 | $theme = str_replace('{theme}', $this->active_theme, $theme); |
175 | 174 | } |
176 | 175 | |
177 | - if ( ! empty( $theme ) && isset( $this->folders[ $theme ] ) ) |
|
176 | + if ( ! empty($theme) && isset($this->folders[$theme])) |
|
178 | 177 | { |
179 | - $view = rtrim( $this->folders[ $theme ], '/' ) . '/' . $view; |
|
178 | + $view = rtrim($this->folders[$theme], '/').'/'.$view; |
|
180 | 179 | } |
181 | 180 | |
182 | - if (! is_array($data)) |
|
181 | + if ( ! is_array($data)) |
|
183 | 182 | { |
184 | 183 | $data = []; |
185 | 184 | } |
186 | 185 | |
187 | - $data = array_merge( $this->vars, $data ); |
|
186 | + $data = array_merge($this->vars, $data); |
|
188 | 187 | |
189 | 188 | // if using a variant, add it to the view name. |
190 | - if ( ! empty( $this->current_variant ) ) |
|
189 | + if ( ! empty($this->current_variant)) |
|
191 | 190 | { |
192 | - $variant_view = $view . $this->variants[ $this->current_variant ]; |
|
191 | + $variant_view = $view.$this->variants[$this->current_variant]; |
|
193 | 192 | |
194 | 193 | $output = $this->loadView($variant_view, $data); |
195 | 194 | } |
196 | 195 | |
197 | 196 | // If that didn't find anything, then try it without a variant |
198 | - if ( empty( $output ) ) |
|
197 | + if (empty($output)) |
|
199 | 198 | { |
200 | 199 | $output = $this->loadView($view, $data); |
201 | 200 | } |
202 | 201 | |
203 | 202 | // Cache it |
204 | - if ((int)$cache_time > 0) |
|
203 | + if ((int) $cache_time > 0) |
|
205 | 204 | { |
206 | - $this->ci->cache->save($cache_name, $output, (int)$cache_time * 60); |
|
205 | + $this->ci->cache->save($cache_name, $output, (int) $cache_time * 60); |
|
207 | 206 | } |
208 | 207 | } |
209 | 208 | |
@@ -232,14 +231,14 @@ discard block |
||
232 | 231 | * @param string $cache_name // Number of MINUTES to cache output |
233 | 232 | * @return mixed|void |
234 | 233 | */ |
235 | - public function call($command, $cache_time=0, $cache_name=null) |
|
234 | + public function call($command, $cache_time = 0, $cache_name = null) |
|
236 | 235 | { |
237 | 236 | if (empty($cache_name)) |
238 | 237 | { |
239 | - $cache_name = 'theme_call_' . md5( $command ); |
|
238 | + $cache_name = 'theme_call_'.md5($command); |
|
240 | 239 | } |
241 | 240 | |
242 | - if (! $output = $this->ci->cache->get($cache_name)) { |
|
241 | + if ( ! $output = $this->ci->cache->get($cache_name)) { |
|
243 | 242 | $parts = explode(' ', $command); |
244 | 243 | |
245 | 244 | list($class, $method) = explode(':', array_shift($parts)); |
@@ -256,7 +255,7 @@ discard block |
||
256 | 255 | continue; |
257 | 256 | } |
258 | 257 | |
259 | - $params[ $p[0] ] = $p[1]; |
|
258 | + $params[$p[0]] = $p[1]; |
|
260 | 259 | } |
261 | 260 | |
262 | 261 | // Let PHP try to autoload it through any available autoloaders |
@@ -266,20 +265,20 @@ discard block |
||
266 | 265 | $class = new $class(); |
267 | 266 | } else { |
268 | 267 | $this->ci->load->library($class); |
269 | - $class =& $this->ci->$class; |
|
268 | + $class = & $this->ci->$class; |
|
270 | 269 | } |
271 | 270 | |
272 | - if (! method_exists($class, $method)) { |
|
273 | - throw new \RuntimeException( sprintf( lang('themer.bad_callback'), $class, $method ) ); |
|
271 | + if ( ! method_exists($class, $method)) { |
|
272 | + throw new \RuntimeException(sprintf(lang('themer.bad_callback'), $class, $method)); |
|
274 | 273 | } |
275 | 274 | |
276 | 275 | // Call the class with our parameters |
277 | 276 | $output = $class->{$method}($params); |
278 | 277 | |
279 | 278 | // Cache it |
280 | - if ((int)$cache_time > 0) |
|
279 | + if ((int) $cache_time > 0) |
|
281 | 280 | { |
282 | - $this->ci->cache->save($cache_name, $output, (int)$cache_time * 60); |
|
281 | + $this->ci->cache->save($cache_name, $output, (int) $cache_time * 60); |
|
283 | 282 | } |
284 | 283 | } |
285 | 284 | |
@@ -479,7 +478,7 @@ discard block |
||
479 | 478 | { |
480 | 479 | $theme = empty($this->theme) ? $this->default_theme : $this->theme; |
481 | 480 | |
482 | - if (! isset($this->folders[ $theme ])) |
|
481 | + if ( ! isset($this->folders[$theme])) |
|
483 | 482 | { |
484 | 483 | return null; |
485 | 484 | } |
@@ -569,24 +568,24 @@ discard block |
||
569 | 568 | // First - does it exist in the current theme? |
570 | 569 | $theme = ! empty($this->active_theme) ? $this->active_theme : $this->default_theme; |
571 | 570 | $theme = ! empty($this->folders[$theme]) ? $this->folders[$theme] : $theme; |
572 | - $theme = rtrim($theme, '/ ') .'/'; |
|
571 | + $theme = rtrim($theme, '/ ').'/'; |
|
573 | 572 | |
574 | - if (file_exists($theme ."{$view}.php")) |
|
573 | + if (file_exists($theme."{$view}.php")) |
|
575 | 574 | { |
576 | - $output = $this->ci->load->view_path( $theme . $view, $data, TRUE ); |
|
575 | + $output = $this->ci->load->view_path($theme.$view, $data, TRUE); |
|
577 | 576 | } |
578 | 577 | |
579 | 578 | // Next, if it's a real file with path, then load it |
580 | - elseif ( realpath( $view . '.php' ) ) |
|
579 | + elseif (realpath($view.'.php')) |
|
581 | 580 | { |
582 | - $output = $this->ci->load->view_path( $view, $data, TRUE ); |
|
581 | + $output = $this->ci->load->view_path($view, $data, TRUE); |
|
583 | 582 | } |
584 | 583 | |
585 | 584 | // Otherwise, treat it as a standard view, which means |
586 | 585 | // application/views will override any modules. (See HMVC/Loader) |
587 | 586 | else |
588 | 587 | { |
589 | - $output = $this->ci->load->view( $view, $data, TRUE ); |
|
588 | + $output = $this->ci->load->view($view, $data, TRUE); |
|
590 | 589 | } |
591 | 590 | |
592 | 591 | return $output; |
@@ -2,7 +2,7 @@ discard block |
||
2 | 2 | |
3 | 3 | use Zend\Escaper\Escaper; |
4 | 4 | |
5 | -if (! function_exists('esc')) |
|
5 | +if ( ! function_exists('esc')) |
|
6 | 6 | { |
7 | 7 | /** |
8 | 8 | * Escapes strings to make them safe for use |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | * |
29 | 29 | * @return string |
30 | 30 | */ |
31 | - function esc($data, $context='html', $escaper=null) |
|
31 | + function esc($data, $context = 'html', $escaper = null) |
|
32 | 32 | { |
33 | 33 | if (is_array($data)) |
34 | 34 | { |
@@ -40,18 +40,18 @@ discard block |
||
40 | 40 | |
41 | 41 | $context = strtolower($context); |
42 | 42 | |
43 | - if (! is_object($escaper)) |
|
43 | + if ( ! is_object($escaper)) |
|
44 | 44 | { |
45 | 45 | $escaper = new Escaper(config_item('charset')); |
46 | 46 | } |
47 | 47 | |
48 | 48 | // Valid context? |
49 | - if (! in_array($context, ['html', 'htmlattr', 'js', 'css', 'url'])) |
|
49 | + if ( ! in_array($context, ['html', 'htmlattr', 'js', 'css', 'url'])) |
|
50 | 50 | { |
51 | - throw new \InvalidArgumentException('Invalid Context type: '. $context); |
|
51 | + throw new \InvalidArgumentException('Invalid Context type: '.$context); |
|
52 | 52 | } |
53 | 53 | |
54 | - if (! is_string($data)) |
|
54 | + if ( ! is_string($data)) |
|
55 | 55 | { |
56 | 56 | return $data; |
57 | 57 | } |
@@ -73,7 +73,7 @@ discard block |
||
73 | 73 | * @param array $options |
74 | 74 | * @return mixed |
75 | 75 | */ |
76 | - abstract public function row($options=[], \Closure $c); |
|
76 | + abstract public function row($options = [], \Closure $c); |
|
77 | 77 | |
78 | 78 | //-------------------------------------------------------------------- |
79 | 79 | |
@@ -94,7 +94,7 @@ discard block |
||
94 | 94 | * @param array $attributes |
95 | 95 | * @return mixed |
96 | 96 | */ |
97 | - abstract public function column($options=[], \Closure $c); |
|
97 | + abstract public function column($options = [], \Closure $c); |
|
98 | 98 | |
99 | 99 | //-------------------------------------------------------------------- |
100 | 100 | |
@@ -110,7 +110,7 @@ discard block |
||
110 | 110 | * @param callable $c |
111 | 111 | * @return string |
112 | 112 | */ |
113 | - abstract public function navbar($options=[], \Closure $c); |
|
113 | + abstract public function navbar($options = [], \Closure $c); |
|
114 | 114 | |
115 | 115 | //-------------------------------------------------------------------- |
116 | 116 | |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | * @param string $url |
123 | 123 | * @return string |
124 | 124 | */ |
125 | - abstract public function navbarTitle($title, $url='#'); |
|
125 | + abstract public function navbarTitle($title, $url = '#'); |
|
126 | 126 | |
127 | 127 | //-------------------------------------------------------------------- |
128 | 128 | |
@@ -136,7 +136,7 @@ discard block |
||
136 | 136 | * @param callable $c |
137 | 137 | * @return string |
138 | 138 | */ |
139 | - abstract public function navbarRight($options=[], \Closure $c); |
|
139 | + abstract public function navbarRight($options = [], \Closure $c); |
|
140 | 140 | |
141 | 141 | //-------------------------------------------------------------------- |
142 | 142 | |
@@ -148,7 +148,7 @@ discard block |
||
148 | 148 | * @param array $options |
149 | 149 | * @return string |
150 | 150 | */ |
151 | - abstract public function navItem($title, $url, $options=[], $isActive=false); |
|
151 | + abstract public function navItem($title, $url, $options = [], $isActive = false); |
|
152 | 152 | |
153 | 153 | //-------------------------------------------------------------------- |
154 | 154 | |
@@ -159,7 +159,7 @@ discard block |
||
159 | 159 | * @param array $options |
160 | 160 | * @param callable $c |
161 | 161 | */ |
162 | - abstract public function navDropdown($title,$options=[], \Closure $c); |
|
162 | + abstract public function navDropdown($title, $options = [], \Closure $c); |
|
163 | 163 | |
164 | 164 | //-------------------------------------------------------------------- |
165 | 165 | |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | * @param callable $c |
180 | 180 | * @return mixed |
181 | 181 | */ |
182 | - abstract public function breadcrumb($options=[], \Closure $c); |
|
182 | + abstract public function breadcrumb($options = [], \Closure $c); |
|
183 | 183 | |
184 | 184 | //-------------------------------------------------------------------- |
185 | 185 | |
@@ -198,7 +198,7 @@ discard block |
||
198 | 198 | * @param array $options |
199 | 199 | * @return mixed |
200 | 200 | */ |
201 | - abstract public function button($title, $style='default', $size='default', $options=[]); |
|
201 | + abstract public function button($title, $style = 'default', $size = 'default', $options = []); |
|
202 | 202 | |
203 | 203 | /** |
204 | 204 | * Creates a simple link styled as a button. |
@@ -212,7 +212,7 @@ discard block |
||
212 | 212 | * @param array $options |
213 | 213 | * @return mixed |
214 | 214 | */ |
215 | - abstract public function buttonLink($title, $url='#', $style='default', $size='default', $options=[]); |
|
215 | + abstract public function buttonLink($title, $url = '#', $style = 'default', $size = 'default', $options = []); |
|
216 | 216 | |
217 | 217 | /** |
218 | 218 | * Creates button groups wrapping HTML. |
@@ -243,7 +243,7 @@ discard block |
||
243 | 243 | * @param callable $c |
244 | 244 | * @return mixed |
245 | 245 | */ |
246 | - abstract public function buttonDropdown($title, $style='default', $size='default', $options=[], \Closure $c); |
|
246 | + abstract public function buttonDropdown($title, $style = 'default', $size = 'default', $options = [], \Closure $c); |
|
247 | 247 | |
248 | 248 | //-------------------------------------------------------------------- |
249 | 249 | // Notices |
@@ -259,7 +259,7 @@ discard block |
||
259 | 259 | * @param bool $closable |
260 | 260 | * @return mixed |
261 | 261 | */ |
262 | - abstract public function notice($content, $style='success', $closable=true); |
|
262 | + abstract public function notice($content, $style = 'success', $closable = true); |
|
263 | 263 | |
264 | 264 | //-------------------------------------------------------------------- |
265 | 265 | // Forms |
@@ -276,7 +276,7 @@ discard block |
||
276 | 276 | * |
277 | 277 | * @return mixed |
278 | 278 | */ |
279 | - abstract public function inputWrap($label_text, $options=[], \Closure $c); |
|
279 | + abstract public function inputWrap($label_text, $options = [], \Closure $c); |
|
280 | 280 | |
281 | 281 | //-------------------------------------------------------------------- |
282 | 282 | // Utility Methods |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | */ |
291 | 291 | protected function runClosure(\Closure $c) |
292 | 292 | { |
293 | - if (! is_callable($c)) return ''; |
|
293 | + if ( ! is_callable($c)) return ''; |
|
294 | 294 | |
295 | 295 | ob_start(); |
296 | 296 | $c(); |
@@ -311,7 +311,7 @@ discard block |
||
311 | 311 | * @param bool $fullClassString |
312 | 312 | * @return array |
313 | 313 | */ |
314 | - protected function parseStandardOptions($options, $initial_classes='', $fullClassString=false) |
|
314 | + protected function parseStandardOptions($options, $initial_classes = '', $fullClassString = false) |
|
315 | 315 | { |
316 | 316 | return [ |
317 | 317 | $this->buildClassString($initial_classes, $options, $fullClassString), |
@@ -348,7 +348,7 @@ discard block |
||
348 | 348 | * @param array $options |
349 | 349 | * @return array |
350 | 350 | */ |
351 | - protected function buildClassString($initial, $options, $buildEntireString=false) |
|
351 | + protected function buildClassString($initial, $options, $buildEntireString = false) |
|
352 | 352 | { |
353 | 353 | $classes = explode(' ', $initial); |
354 | 354 | |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | { |
405 | 405 | if (isset($options['attributes']) && ! is_array($options['attributes'])) |
406 | 406 | { |
407 | - $options['attributes'] = [ $options['attributes'] ]; |
|
407 | + $options['attributes'] = [$options['attributes']]; |
|
408 | 408 | } |
409 | 409 | |
410 | 410 | return isset($options['attributes']) ? implode($options['attributes']) : ''; |