@@ -76,7 +76,7 @@ |
||
76 | 76 | 'jpm' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'], |
77 | 77 | 'mj2' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'], |
78 | 78 | 'mjp2' => ['image/jp2', 'video/mj2', 'image/jpx', 'image/jpm'], |
79 | - 'png' => ['image/png', 'image/x-png'], |
|
79 | + 'png' => ['image/png', 'image/x-png'], |
|
80 | 80 | 'tiff' => 'image/tiff', |
81 | 81 | 'tif' => 'image/tiff', |
82 | 82 | 'css' => ['text/css', 'text/plain'], |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | */ |
192 | 192 | public static function sass(string $path) |
193 | 193 | { |
194 | - \Cookie\helper::one('sass' . self::$key, 'compiler', 1, function () use ($path) { |
|
194 | + \Cookie\helper::one('sass' . self::$key, 'compiler', 1, function() use ($path) { |
|
195 | 195 | if (is_file($path)) { |
196 | 196 | if (self::is_windows()) { |
197 | 197 | $path = self::fixSlash($path); |
@@ -242,7 +242,7 @@ discard block |
||
242 | 242 | |
243 | 243 | public static function babel(string $path) |
244 | 244 | { |
245 | - \Cookie\helper::one('babel' . self::$key, 'compiler', 1, function () use ($path) { |
|
245 | + \Cookie\helper::one('babel' . self::$key, 'compiler', 1, function() use ($path) { |
|
246 | 246 | if (is_file($path)) { |
247 | 247 | if (self::is_windows()) { |
248 | 248 | $path = self::fixSlash($path); |
@@ -650,7 +650,7 @@ discard block |
||
650 | 650 | header('Access-Control-Allow-Origin: ' . $_SERVER['HTTP_ORIGIN']); |
651 | 651 | header('Access-Control-Expose-Headers: date,content-type,transfer-encoding,connection,access-control-allow-origin,server,x-xss-protection,x-content-type-options,x-request-id,content-encoding,x-final-url'); |
652 | 652 | header('Access-Control-Allow-Credentials: true'); |
653 | - header('Access-Control-Max-Age: 86400'); // cache for 1 day |
|
653 | + header('Access-Control-Max-Age: 86400'); // cache for 1 day |
|
654 | 654 | if (isset($_SERVER['HTTP_REFERER'])) { |
655 | 655 | $parseRef = parse_url($_SERVER['HTTP_REFERER']); |
656 | 656 | $parseOri = parse_url($_SERVER['HTTP_ORIGIN']); |
@@ -928,7 +928,7 @@ discard block |
||
928 | 928 | */ |
929 | 929 | public static function get_url_path($path, bool $cache = null) |
930 | 930 | { |
931 | - $load = function (string $path) use ($cache) { |
|
931 | + $load = function(string $path) use ($cache) { |
|
932 | 932 | if ($realpath = realpath($path)) { |
933 | 933 | $f = str_replace(realpath($_SERVER['DOCUMENT_ROOT']), '', $realpath); |
934 | 934 | |
@@ -980,9 +980,9 @@ discard block |
||
980 | 980 | return $buffer; |
981 | 981 | } |
982 | 982 | $search = [ |
983 | - '/\>[^\S ]+/s', // strip whitespaces after tags, except space |
|
984 | - '/[^\S ]+\</s', // strip whitespaces before tags, except space |
|
985 | - '/(\s)+/s', // shorten multiple whitespace sequences |
|
983 | + '/\>[^\S ]+/s', // strip whitespaces after tags, except space |
|
984 | + '/[^\S ]+\</s', // strip whitespaces before tags, except space |
|
985 | + '/(\s)+/s', // shorten multiple whitespace sequences |
|
986 | 986 | '/<!--(.|\s)*?-->/', // Remove HTML comments |
987 | 987 | ]; |
988 | 988 |
@@ -6,7 +6,7 @@ |
||
6 | 6 | |
7 | 7 | if (isset($_POST['config'])) { |
8 | 8 | unset($_POST['config']); |
9 | - array_walk_recursive($_POST, function (&$key, $value) { |
|
9 | + array_walk_recursive($_POST, function(&$key, $value) { |
|
10 | 10 | if (preg_match('/^(true|false)$/s', $key, $match)) { |
11 | 11 | if ($match[0] == 'true') { |
12 | 12 | $key = true; |
@@ -1,4 +1,4 @@ |
||
1 | 1 | <?php |
2 | -if (!user()->is_admin()){ |
|
2 | +if (!user()->is_admin()) { |
|
3 | 3 | safe_redirect('/'); |
4 | 4 | } |
5 | 5 | \ No newline at end of file |
@@ -22,7 +22,7 @@ discard block |
||
22 | 22 | if (isset($package['devDependencies'])) { |
23 | 23 | $packages = array_merge($package['devDependencies'], $packages); |
24 | 24 | } |
25 | -$packages = array_map(function ($pkg) { |
|
25 | +$packages = array_map(function($pkg) { |
|
26 | 26 | //var_dump($pkg); |
27 | 27 | if (false === strpos($pkg, '@types/')) { |
28 | 28 | return $pkg; |
@@ -31,19 +31,19 @@ discard block |
||
31 | 31 | } |
32 | 32 | }, array_keys($packages)); |
33 | 33 | $packages = array_values(array_filter($packages)); |
34 | -$packages = array_map(function ($pkg) { |
|
34 | +$packages = array_map(function($pkg) { |
|
35 | 35 | return "@types/$pkg"; |
36 | 36 | }, $packages); |
37 | 37 | |
38 | 38 | if (isset($package['devDependencies'])) { |
39 | - array_map(function ($types) { |
|
39 | + array_map(function($types) { |
|
40 | 40 | $package['devDependencies'][$types] = '*'; |
41 | 41 | }, $packages); |
42 | 42 | } |
43 | 43 | |
44 | 44 | \Filemanager\file::file($location, $package, true); |
45 | 45 | |
46 | -$cmd = function ($pkg) { |
|
46 | +$cmd = function($pkg) { |
|
47 | 47 | return 'cd ' . ROOT . ' && echo "Installing ' . $pkg . ' On %cd%" && '; |
48 | 48 | }; |
49 | 49 |
@@ -35,7 +35,7 @@ |
||
35 | 35 | $data = $p->fetchAll(); |
36 | 36 | $result['recordsTotal'] = count($data); |
37 | 37 | $result['recordsFiltered'] = (int) count($data); |
38 | -$data_filter = array_map(function ($map_data) { |
|
38 | +$data_filter = array_map(function($map_data) { |
|
39 | 39 | $i = 0; |
40 | 40 | foreach ($map_data as $key => $value) { |
41 | 41 | if (is_numeric($value)) { |
@@ -386,7 +386,7 @@ |
||
386 | 386 | throw new Exception('Callback must be function', 1); |
387 | 387 | } |
388 | 388 | |
389 | - return array_map(function ($key, $val) use ($callback) { |
|
389 | + return array_map(function($key, $val) use ($callback) { |
|
390 | 390 | return call_user_func($callback, $key, $val); |
391 | 391 | }, array_keys($arr), $arr); |
392 | 392 | } |
@@ -24,13 +24,13 @@ discard block |
||
24 | 24 | |
25 | 25 | // Constructs an Event object from the given array of key=>values. |
26 | 26 | // You can optionally force the timezone of the parsed dates. |
27 | - public function __construct($array, $timezone=null) { |
|
27 | + public function __construct($array, $timezone = null) { |
|
28 | 28 | |
29 | 29 | $this->title = $array['title']; |
30 | 30 | |
31 | 31 | if (isset($array['allDay'])) { |
32 | 32 | // allDay has been explicitly specified |
33 | - $this->allDay = (bool)$array['allDay']; |
|
33 | + $this->allDay = (bool) $array['allDay']; |
|
34 | 34 | } |
35 | 35 | else { |
36 | 36 | // Guess allDay based off of ISO8601 date strings |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | |
110 | 110 | // Parses a string into a DateTime object, optionally forced into the given timezone. |
111 | -function parseDateTime($string, $timezone=null) { |
|
111 | +function parseDateTime($string, $timezone = null) { |
|
112 | 112 | $date = new DateTime( |
113 | 113 | $string, |
114 | 114 | $timezone ? $timezone : new DateTimeZone('UTC') |
@@ -31,8 +31,7 @@ discard block |
||
31 | 31 | if (isset($array['allDay'])) { |
32 | 32 | // allDay has been explicitly specified |
33 | 33 | $this->allDay = (bool)$array['allDay']; |
34 | - } |
|
35 | - else { |
|
34 | + } else { |
|
36 | 35 | // Guess allDay based off of ISO8601 date strings |
37 | 36 | $this->allDay = preg_match(self::ALL_DAY_REGEX, $array['start']) && |
38 | 37 | (!isset($array['end']) || preg_match(self::ALL_DAY_REGEX, $array['end'])); |
@@ -65,8 +64,7 @@ discard block |
||
65 | 64 | |
66 | 65 | if (isset($this->end)) { |
67 | 66 | $eventEnd = stripTime($this->end); // normalize |
68 | - } |
|
69 | - else { |
|
67 | + } else { |
|
70 | 68 | $eventEnd = $eventStart; // consider this a zero-duration event |
71 | 69 | } |
72 | 70 | |
@@ -86,8 +84,7 @@ discard block |
||
86 | 84 | // Figure out the date format. This essentially encodes allDay into the date string. |
87 | 85 | if ($this->allDay) { |
88 | 86 | $format = 'Y-m-d'; // output like "2013-12-29" |
89 | - } |
|
90 | - else { |
|
87 | + } else { |
|
91 | 88 | $format = 'c'; // full ISO8601 output, like "2013-12-29T09:00:00+08:00" |
92 | 89 | } |
93 | 90 |
@@ -24,13 +24,13 @@ discard block |
||
24 | 24 | |
25 | 25 | // Constructs an Event object from the given array of key=>values. |
26 | 26 | // You can optionally force the timezone of the parsed dates. |
27 | - public function __construct($array, $timezone=null) { |
|
27 | + public function __construct($array, $timezone = null) { |
|
28 | 28 | |
29 | 29 | $this->title = $array['title']; |
30 | 30 | |
31 | 31 | if (isset($array['allDay'])) { |
32 | 32 | // allDay has been explicitly specified |
33 | - $this->allDay = (bool)$array['allDay']; |
|
33 | + $this->allDay = (bool) $array['allDay']; |
|
34 | 34 | } |
35 | 35 | else { |
36 | 36 | // Guess allDay based off of ISO8601 date strings |
@@ -108,7 +108,7 @@ discard block |
||
108 | 108 | |
109 | 109 | |
110 | 110 | // Parses a string into a DateTime object, optionally forced into the given timezone. |
111 | -function parseDateTime($string, $timezone=null) { |
|
111 | +function parseDateTime($string, $timezone = null) { |
|
112 | 112 | $date = new DateTime( |
113 | 113 | $string, |
114 | 114 | $timezone ? $timezone : new DateTimeZone('UTC') |
@@ -31,8 +31,7 @@ discard block |
||
31 | 31 | if (isset($array['allDay'])) { |
32 | 32 | // allDay has been explicitly specified |
33 | 33 | $this->allDay = (bool)$array['allDay']; |
34 | - } |
|
35 | - else { |
|
34 | + } else { |
|
36 | 35 | // Guess allDay based off of ISO8601 date strings |
37 | 36 | $this->allDay = preg_match(self::ALL_DAY_REGEX, $array['start']) && |
38 | 37 | (!isset($array['end']) || preg_match(self::ALL_DAY_REGEX, $array['end'])); |
@@ -65,8 +64,7 @@ discard block |
||
65 | 64 | |
66 | 65 | if (isset($this->end)) { |
67 | 66 | $eventEnd = stripTime($this->end); // normalize |
68 | - } |
|
69 | - else { |
|
67 | + } else { |
|
70 | 68 | $eventEnd = $eventStart; // consider this a zero-duration event |
71 | 69 | } |
72 | 70 | |
@@ -86,8 +84,7 @@ discard block |
||
86 | 84 | // Figure out the date format. This essentially encodes allDay into the date string. |
87 | 85 | if ($this->allDay) { |
88 | 86 | $format = 'Y-m-d'; // output like "2013-12-29" |
89 | - } |
|
90 | - else { |
|
87 | + } else { |
|
91 | 88 | $format = 'c'; // full ISO8601 output, like "2013-12-29T09:00:00+08:00" |
92 | 89 | } |
93 | 90 |