@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | |
| 3 | 3 | use System\Application; |
| 4 | 4 | |
| 5 | -if (! function_exists('pre')) { |
|
| 5 | +if (!function_exists('pre')) { |
|
| 6 | 6 | function pre($var) { |
| 7 | 7 | echo '<pre>'; |
| 8 | 8 | print_r($var); |
@@ -10,28 +10,28 @@ discard block |
||
| 10 | 10 | } |
| 11 | 11 | } |
| 12 | 12 | |
| 13 | -if (! function_exists('array_get')) { |
|
| 13 | +if (!function_exists('array_get')) { |
|
| 14 | 14 | function array_get($array, $key, $default = null) |
| 15 | 15 | { |
| 16 | 16 | return $array[$key] ?: $default; |
| 17 | 17 | } |
| 18 | 18 | } |
| 19 | 19 | |
| 20 | -if (! function_exists('app')) { |
|
| 20 | +if (!function_exists('app')) { |
|
| 21 | 21 | function app() |
| 22 | 22 | { |
| 23 | 23 | return Application::getInstance(); |
| 24 | 24 | } |
| 25 | 25 | } |
| 26 | 26 | |
| 27 | -if (! function_exists('_e')) { |
|
| 27 | +if (!function_exists('_e')) { |
|
| 28 | 28 | function _e($value) |
| 29 | 29 | { |
| 30 | 30 | return htmlspecialchars($value); |
| 31 | 31 | } |
| 32 | 32 | } |
| 33 | 33 | |
| 34 | -if (! function_exists('getLastIndex')) { |
|
| 34 | +if (!function_exists('getLastIndex')) { |
|
| 35 | 35 | function getLastIndex($index) |
| 36 | 36 | { |
| 37 | 37 | $array = explode('\\', $index); |
@@ -39,14 +39,14 @@ discard block |
||
| 39 | 39 | } |
| 40 | 40 | } |
| 41 | 41 | |
| 42 | -if (! function_exists('url')) { |
|
| 42 | +if (!function_exists('url')) { |
|
| 43 | 43 | function url($path) { |
| 44 | 44 | $app = Application::getInstance(); |
| 45 | 45 | return $app->url->link($path); |
| 46 | 46 | } |
| 47 | 47 | } |
| 48 | 48 | |
| 49 | -if (! function_exists('assets')) { |
|
| 49 | +if (!function_exists('assets')) { |
|
| 50 | 50 | function assets($path) |
| 51 | 51 | { |
| 52 | 52 | $app = Application::getInstance(); |
@@ -54,24 +54,24 @@ discard block |
||
| 54 | 54 | } |
| 55 | 55 | } |
| 56 | 56 | |
| 57 | -if (! function_exists('remove_space')) { |
|
| 57 | +if (!function_exists('remove_space')) { |
|
| 58 | 58 | function remove_space($str) { |
| 59 | 59 | return str_replace(' ', '-', $str); |
| 60 | 60 | } |
| 61 | 61 | } |
| 62 | 62 | |
| 63 | -if (! function_exists('remove_dash')) { |
|
| 63 | +if (!function_exists('remove_dash')) { |
|
| 64 | 64 | function remove_dash($str) { |
| 65 | 65 | return str_replace('-', ' ', $str); |
| 66 | 66 | } |
| 67 | 67 | } |
| 68 | 68 | |
| 69 | -if (! function_exists('clean_name_url')) { |
|
| 69 | +if (!function_exists('clean_name_url')) { |
|
| 70 | 70 | function clean_name_url($class = null) { |
| 71 | 71 | |
| 72 | 72 | $app = Application::getInstance(); |
| 73 | 73 | |
| 74 | - if (! $class) { |
|
| 74 | + if (!$class) { |
|
| 75 | 75 | |
| 76 | 76 | $class = debug_backtrace()[1]['class']; |
| 77 | 77 | |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | |
| 84 | 84 | $class = strtolower($class); |
| 85 | 85 | |
| 86 | - $class = '/' . $class . '/'; |
|
| 86 | + $class = '/' . $class . '/'; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | $url = $app->request->url(); |
@@ -96,7 +96,7 @@ discard block |
||
| 96 | 96 | } |
| 97 | 97 | } |
| 98 | 98 | |
| 99 | -if (! function_exists('text_char_limit')) { |
|
| 99 | +if (!function_exists('text_char_limit')) { |
|
| 100 | 100 | function text_char_limit($text, $limit) { |
| 101 | 101 | if (strlen($text) > $limit) { |
| 102 | 102 | return substr($text, 0, $limit) . '...'; |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | -if (! function_exists('array_equal')) { |
|
| 107 | +if (!function_exists('array_equal')) { |
|
| 108 | 108 | function array_equal($a, $b) { |
| 109 | 109 | return ( |
| 110 | 110 | is_array($a) |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | } |
| 116 | 116 | } |
| 117 | 117 | |
| 118 | -if (! function_exists('redirect_after')) { |
|
| 118 | +if (!function_exists('redirect_after')) { |
|
| 119 | 119 | function redirect_after($num) { |
| 120 | 120 | $app = Application::getInstance(); |
| 121 | 121 | $app->url->redirectTo('/', $num); |
@@ -18,7 +18,7 @@ |
||
| 18 | 18 | |
| 19 | 19 | $userGroup->pages = []; |
| 20 | 20 | |
| 21 | - foreach($userGroupInfos as $userGroupInfo) { |
|
| 21 | + foreach ($userGroupInfos as $userGroupInfo) { |
|
| 22 | 22 | |
| 23 | 23 | $userGroup->pages[] = $userGroupInfo->page; |
| 24 | 24 | } |
@@ -12,7 +12,7 @@ |
||
| 12 | 12 | |
| 13 | 13 | public function loadAll() |
| 14 | 14 | { |
| 15 | - foreach($this->all() as $setting) { |
|
| 15 | + foreach ($this->all() as $setting) { |
|
| 16 | 16 | |
| 17 | 17 | $this->settings[$setting->key] = $setting->value; |
| 18 | 18 | } |
@@ -27,7 +27,7 @@ |
||
| 27 | 27 | 'middleware' => ['admin'] |
| 28 | 28 | ]; |
| 29 | 29 | |
| 30 | -$app->route->group($adminOptions, function ($route) { |
|
| 30 | +$app->route->group($adminOptions, function($route) { |
|
| 31 | 31 | |
| 32 | 32 | $route->add('/', 'Home'); |
| 33 | 33 | |
@@ -89,7 +89,7 @@ |
||
| 89 | 89 | |
| 90 | 90 | public function get($key) |
| 91 | 91 | { |
| 92 | - if (! $this->isSharing($key)) { |
|
| 92 | + if (!$this->isSharing($key)) { |
|
| 93 | 93 | |
| 94 | 94 | if ($this->isCoreAlias($key)) { |
| 95 | 95 | |
@@ -34,7 +34,7 @@ |
||
| 34 | 34 | |
| 35 | 35 | public function sendHeaders() |
| 36 | 36 | { |
| 37 | - foreach($this->headers as $header => $value) |
|
| 37 | + foreach ($this->headers as $header => $value) |
|
| 38 | 38 | { |
| 39 | 39 | header($header . ':' . $value); |
| 40 | 40 | } |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | { |
| 26 | 26 | $page = $this->app->request->get('page'); |
| 27 | 27 | |
| 28 | - if (! is_numeric($page) || $page < 1) { |
|
| 28 | + if (!is_numeric($page) || $page < 1) { |
|
| 29 | 29 | $page = 1; |
| 30 | 30 | } |
| 31 | 31 | |
@@ -10,7 +10,7 @@ |
||
| 10 | 10 | public function handle(Application $app, $next) |
| 11 | 11 | { |
| 12 | 12 | |
| 13 | - if (! $this->session->has('error') || $this->session->get('error') != true) { |
|
| 13 | + if (!$this->session->has('error') || $this->session->get('error') != true) { |
|
| 14 | 14 | |
| 15 | 15 | $this->url->redirectTo('/'); |
| 16 | 16 | |
@@ -12,9 +12,9 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | public function isValidLogin($email, $password) |
| 14 | 14 | { |
| 15 | - $user = $this->where('email=?' , $email)->fetch($this->table); |
|
| 15 | + $user = $this->where('email=?', $email)->fetch($this->table); |
|
| 16 | 16 | |
| 17 | - if (! $user) { |
|
| 17 | + if (!$user) { |
|
| 18 | 18 | |
| 19 | 19 | return false; |
| 20 | 20 | } |
@@ -44,7 +44,7 @@ discard block |
||
| 44 | 44 | return false; |
| 45 | 45 | } |
| 46 | 46 | |
| 47 | - $user = $this->where('code=?' , $code)->fetch($this->table); |
|
| 47 | + $user = $this->where('code=?', $code)->fetch($this->table); |
|
| 48 | 48 | |
| 49 | 49 | if (!$user) { |
| 50 | 50 | return false; |