@@ -93,7 +93,7 @@ |
||
| 93 | 93 | if (empty($target) || empty($multidimensional)) return false; |
| 94 | 94 | |
| 95 | 95 | $output = array_map( |
| 96 | - function ($element) use ($target, $object) { |
|
| 96 | + function($element) use ($target, $object) { |
|
| 97 | 97 | $exist = true; |
| 98 | 98 | foreach ($target as $skey => $svalue) { |
| 99 | 99 | $exist = $object |
@@ -11,8 +11,9 @@ discard block |
||
| 11 | 11 | foreach ($args as $n => $field) { |
| 12 | 12 | if (is_string($field)) { |
| 13 | 13 | $tmp = array(); |
| 14 | - foreach ($data as $key => $row) |
|
| 15 | - $tmp[$key] = $row[$field]; |
|
| 14 | + foreach ($data as $key => $row) { |
|
| 15 | + $tmp[$key] = $row[$field]; |
|
| 16 | + } |
|
| 16 | 17 | $args[$n] = $tmp; |
| 17 | 18 | } |
| 18 | 19 | } |
@@ -30,12 +31,13 @@ discard block |
||
| 30 | 31 | static function is_md($array) |
| 31 | 32 | { |
| 32 | 33 | // First we need know what value is array |
| 33 | - if (is_array($array)) |
|
| 34 | - // Next read cols from array |
|
| 34 | + if (is_array($array)) { |
|
| 35 | + // Next read cols from array |
|
| 35 | 36 | foreach ($array as $value) |
| 36 | 37 | // And if some element is array then $array is multidimensional |
| 37 | 38 | if (is_array($value)) |
| 38 | 39 | return true; |
| 40 | + } |
|
| 39 | 41 | |
| 40 | 42 | return false; |
| 41 | 43 | } |
@@ -72,8 +74,11 @@ discard block |
||
| 72 | 74 | |
| 73 | 75 | foreach ($dirContent as $key => $value) { |
| 74 | 76 | if (!in_array($value, array(".", ".."))) { |
| 75 | - if (is_dir($path . DIRECTORY_SEPARATOR . $value)) $result[$value] = self::dir_to_array($path . DIRECTORY_SEPARATOR . $value); |
|
| 76 | - else $result[] = $value; |
|
| 77 | + if (is_dir($path . DIRECTORY_SEPARATOR . $value)) { |
|
| 78 | + $result[$value] = self::dir_to_array($path . DIRECTORY_SEPARATOR . $value); |
|
| 79 | + } else { |
|
| 80 | + $result[] = $value; |
|
| 81 | + } |
|
| 77 | 82 | } |
| 78 | 83 | } |
| 79 | 84 | |
@@ -90,7 +95,9 @@ discard block |
||
| 90 | 95 | */ |
| 91 | 96 | static function md_search($multidimensional, $target, $object = true) |
| 92 | 97 | { |
| 93 | - if (empty($target) || empty($multidimensional)) return false; |
|
| 98 | + if (empty($target) || empty($multidimensional)) { |
|
| 99 | + return false; |
|
| 100 | + } |
|
| 94 | 101 | |
| 95 | 102 | $output = array_map( |
| 96 | 103 | function ($element) use ($target, $object) { |
@@ -43,7 +43,9 @@ |
||
| 43 | 43 | { |
| 44 | 44 | // Checked if true status |
| 45 | 45 | $checked = ''; |
| 46 | - if (true === $status) $checked = 'checked'; |
|
| 46 | + if (true === $status) { |
|
| 47 | + $checked = 'checked'; |
|
| 48 | + } |
|
| 47 | 49 | |
| 48 | 50 | $result = "<input type='checkbox' data-id='" . $id . "' name='" . $name . "' " . $checked . ">"; |
| 49 | 51 | return $result; |
@@ -23,8 +23,9 @@ |
||
| 23 | 23 | $url .= "?s=$s&d=$d&r=$r"; |
| 24 | 24 | if ($img) { |
| 25 | 25 | $url = '<img src="' . $url . '"'; |
| 26 | - foreach ($attrs as $key => $val) |
|
| 27 | - $url .= ' ' . $key . '="' . $val . '"'; |
|
| 26 | + foreach ($attrs as $key => $val) { |
|
| 27 | + $url .= ' ' . $key . '="' . $val . '"'; |
|
| 28 | + } |
|
| 28 | 29 | $url .= ' />'; |
| 29 | 30 | } |
| 30 | 31 | return $url; |
@@ -66,7 +66,9 @@ |
||
| 66 | 66 | $lat2 = $value[0]; |
| 67 | 67 | $long2 = $value[1]; |
| 68 | 68 | $distance = 3959 * acos(cos(self::radians($lat1)) * cos(self::radians($lat2)) * cos(self::radians($long2) - self::radians($long1)) + sin(self::radians($lat1)) * sin(self::radians($lat2))); |
| 69 | - if ($distance < $radius) $resultArray[$key] = $value; |
|
| 69 | + if ($distance < $radius) { |
|
| 70 | + $resultArray[$key] = $value; |
|
| 71 | + } |
|
| 70 | 72 | } |
| 71 | 73 | return $resultArray; |
| 72 | 74 | } |
@@ -23,12 +23,14 @@ discard block |
||
| 23 | 23 | */ |
| 24 | 24 | public static function is_valid_url($url, $query = false) |
| 25 | 25 | { |
| 26 | - if (true === $query) |
|
| 27 | - if (!filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_QUERY_REQUIRED) === false) |
|
| 26 | + if (true === $query) { |
|
| 27 | + if (!filter_var($url, FILTER_VALIDATE_URL, FILTER_FLAG_QUERY_REQUIRED) === false) |
|
| 28 | 28 | return true; |
| 29 | + } |
|
| 29 | 30 | |
| 30 | - if (!filter_var($url, FILTER_VALIDATE_URL) === false) |
|
| 31 | - return true; |
|
| 31 | + if (!filter_var($url, FILTER_VALIDATE_URL) === false) { |
|
| 32 | + return true; |
|
| 33 | + } |
|
| 32 | 34 | |
| 33 | 35 | return false; |
| 34 | 36 | } |
@@ -43,12 +45,14 @@ discard block |
||
| 43 | 45 | public static function is_valid_email($email, $sanitize = true) |
| 44 | 46 | { |
| 45 | 47 | // Remove all illegal characters from email |
| 46 | - if (true === $sanitize) |
|
| 47 | - $email = filter_var($email, FILTER_SANITIZE_EMAIL); |
|
| 48 | + if (true === $sanitize) { |
|
| 49 | + $email = filter_var($email, FILTER_SANITIZE_EMAIL); |
|
| 50 | + } |
|
| 48 | 51 | |
| 49 | 52 | // Validate e-mail |
| 50 | - if (!filter_var($email, FILTER_VALIDATE_EMAIL) === false) |
|
| 51 | - return true; |
|
| 53 | + if (!filter_var($email, FILTER_VALIDATE_EMAIL) === false) { |
|
| 54 | + return true; |
|
| 55 | + } |
|
| 52 | 56 | |
| 53 | 57 | return false; |
| 54 | 58 | } |
@@ -15,7 +15,9 @@ discard block |
||
| 15 | 15 | */ |
| 16 | 16 | public static function v3($namespace, $name) |
| 17 | 17 | { |
| 18 | - if (!self::is_valid($namespace)) return false; |
|
| 18 | + if (!self::is_valid($namespace)) { |
|
| 19 | + return false; |
|
| 20 | + } |
|
| 19 | 21 | |
| 20 | 22 | // Get hexadecimal components of namespace |
| 21 | 23 | $nhex = str_replace(array('-', '{', '}'), '', $namespace); |
@@ -91,7 +93,9 @@ discard block |
||
| 91 | 93 | */ |
| 92 | 94 | public static function v5($namespace, $name) |
| 93 | 95 | { |
| 94 | - if (!self::is_valid($namespace)) return false; |
|
| 96 | + if (!self::is_valid($namespace)) { |
|
| 97 | + return false; |
|
| 98 | + } |
|
| 95 | 99 | |
| 96 | 100 | // Get hexadecimal components of namespace |
| 97 | 101 | $nhex = str_replace(array('-', '{', '}'), '', $namespace); |
@@ -8,6 +8,6 @@ |
||
| 8 | 8 | $tests[2] = "~!@#$%^&*()_+"; |
| 9 | 9 | $tests[3] = "test123\n\n"; |
| 10 | 10 | |
| 11 | -echo Cleaner::run($tests[1])."\n"; |
|
| 12 | -echo Cleaner::run($tests[2])."\n"; |
|
| 13 | -echo Cleaner::run($tests[3])."\n"; |
|
| 11 | +echo Cleaner::run($tests[1]) . "\n"; |
|
| 12 | +echo Cleaner::run($tests[2]) . "\n"; |
|
| 13 | +echo Cleaner::run($tests[3]) . "\n"; |
|