@@ -23,7 +23,9 @@ discard block |
||
23 | 23 | |
24 | 24 | $this->name = $name; |
25 | 25 | |
26 | - foreach ($attributes as $name => $value) $this->set($name, $value); |
|
26 | + foreach ($attributes as $name => $value) { |
|
27 | + $this->set($name, $value); |
|
28 | + } |
|
27 | 29 | |
28 | 30 | $this->contents($contents); |
29 | 31 | } |
@@ -41,9 +43,11 @@ discard block |
||
41 | 43 | |
42 | 44 | public function contents($contents) { |
43 | 45 | |
44 | - if ((null === $contents) || Template::isBlock($contents)) $this->contents = $contents; |
|
45 | - |
|
46 | - else if (is_scalar($contents)) $this->contents = Template::block('$contents$')->set('contents', $contents); |
|
46 | + if ((null === $contents) || Template::isBlock($contents)) { |
|
47 | + $this->contents = $contents; |
|
48 | + } else if (is_scalar($contents)) { |
|
49 | + $this->contents = Template::block('$contents$')->set('contents', $contents); |
|
50 | + } |
|
47 | 51 | |
48 | 52 | # ------------------------ |
49 | 53 |
@@ -8,9 +8,13 @@ discard block |
||
8 | 8 | |
9 | 9 | public static function validate(string $date, string $format) { |
10 | 10 | |
11 | - if (false === ($date_object = date_create_from_format($format, $date))) return false; |
|
11 | + if (false === ($date_object = date_create_from_format($format, $date))) { |
|
12 | + return false; |
|
13 | + } |
|
12 | 14 | |
13 | - if (false === ($date_formatted = $date_object->format($format))) return false; |
|
15 | + if (false === ($date_formatted = $date_object->format($format))) { |
|
16 | + return false; |
|
17 | + } |
|
14 | 18 | |
15 | 19 | # ------------------------ |
16 | 20 | |
@@ -35,7 +39,9 @@ discard block |
||
35 | 39 | |
36 | 40 | public static function validateYear(int $year) { |
37 | 41 | |
38 | - if (false === ($year = self::validate($year, 'Y'))) return false; |
|
42 | + if (false === ($year = self::validate($year, 'Y'))) { |
|
43 | + return false; |
|
44 | + } |
|
39 | 45 | |
40 | 46 | return (($year > '1900') ? (($year > self::year()) ? self::year() : $year) : '1900'); |
41 | 47 | } |
@@ -37,7 +37,9 @@ |
||
37 | 37 | |
38 | 38 | $group->add($block = clone($this->block)); |
39 | 39 | |
40 | - if (is_array($item)) foreach ($item as $name => $value) if (is_scalar($value)) $block->set($name, $value); |
|
40 | + if (is_array($item)) { |
|
41 | + foreach ($item as $name => $value) if (is_scalar($value)) $block->set($name, $value); |
|
42 | + } |
|
41 | 43 | } |
42 | 44 | |
43 | 45 | # ------------------------ |
@@ -23,7 +23,9 @@ |
||
23 | 23 | |
24 | 24 | $contents = ''; |
25 | 25 | |
26 | - foreach ($this->items as $block) $contents .= $block->contents(); |
|
26 | + foreach ($this->items as $block) { |
|
27 | + $contents .= $block->contents(); |
|
28 | + } |
|
27 | 29 | |
28 | 30 | # ------------------------ |
29 | 31 |
@@ -8,7 +8,9 @@ discard block |
||
8 | 8 | |
9 | 9 | public static function start(string $name, int $lifetime) { |
10 | 10 | |
11 | - if (session_id()) return true; |
|
11 | + if (session_id()) { |
|
12 | + return true; |
|
13 | + } |
|
12 | 14 | |
13 | 15 | ini_set('session.gc_maxlifetime', $lifetime); |
14 | 16 | |
@@ -46,14 +48,18 @@ discard block |
||
46 | 48 | |
47 | 49 | public static function set(string $name, $value) { |
48 | 50 | |
49 | - if (session_id()) $_SESSION[$name] = $value; |
|
51 | + if (session_id()) { |
|
52 | + $_SESSION[$name] = $value; |
|
53 | + } |
|
50 | 54 | } |
51 | 55 | |
52 | 56 | # Delete variable |
53 | 57 | |
54 | 58 | public static function delete(string $name) { |
55 | 59 | |
56 | - if (session_id() && isset($_SESSION[$name])) unset($_SESSION[$name]); |
|
60 | + if (session_id() && isset($_SESSION[$name])) { |
|
61 | + unset($_SESSION[$name]); |
|
62 | + } |
|
57 | 63 | } |
58 | 64 | } |
59 | 65 | } |
@@ -31,7 +31,9 @@ |
||
31 | 31 | |
32 | 32 | public static function delete(string $name) { |
33 | 33 | |
34 | - if (isset($_COOKIE[$name])) unset($_COOKIE[$name]); |
|
34 | + if (isset($_COOKIE[$name])) { |
|
35 | + unset($_COOKIE[$name]); |
|
36 | + } |
|
35 | 37 | } |
36 | 38 | } |
37 | 39 | } |
@@ -10,7 +10,9 @@ |
||
10 | 10 | |
11 | 11 | protected static function init(string $file_name) { |
12 | 12 | |
13 | - if (is_array($list = Explorer::php($file_name))) static::$list = $list; |
|
13 | + if (is_array($list = Explorer::php($file_name))) { |
|
14 | + static::$list = $list; |
|
15 | + } |
|
14 | 16 | } |
15 | 17 | |
16 | 18 | # Check if item exists |
@@ -10,7 +10,9 @@ |
||
10 | 10 | |
11 | 11 | private static function checkType(string $extension, string $type) { |
12 | 12 | |
13 | - if (false === ($mime = self::get($extension))) return false; |
|
13 | + if (false === ($mime = self::get($extension))) { |
|
14 | + return false; |
|
15 | + } |
|
14 | 16 | |
15 | 17 | return (preg_match('/^' . $type . '\//', $mime) ? true : false); |
16 | 18 | } |
@@ -8,7 +8,9 @@ |
||
8 | 8 | |
9 | 9 | private static function output($image, string $mime, callable $outputter, array $params = []) { |
10 | 10 | |
11 | - if (!is_resource($image)) return false; |
|
11 | + if (!is_resource($image)) { |
|
12 | + return false; |
|
13 | + } |
|
12 | 14 | |
13 | 15 | Headers::nocache(); Headers::content($mime); |
14 | 16 |