@@ -14,9 +14,9 @@ discard block |
||
| 14 | 14 | * @param mixed $value |
| 15 | 15 | * @return \AppUtils\NumberInfo |
| 16 | 16 | */ |
| 17 | -function parseNumber($value, $forceNew=false) |
|
| 17 | +function parseNumber($value, $forceNew = false) |
|
| 18 | 18 | { |
| 19 | - if($value instanceof NumberInfo && $forceNew !== true) { |
|
| 19 | + if ($value instanceof NumberInfo && $forceNew !== true) { |
|
| 20 | 20 | return $value; |
| 21 | 21 | } |
| 22 | 22 | |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | $args = func_get_args(); |
| 98 | 98 | |
| 99 | 99 | // is the localization package installed? |
| 100 | - if(class_exists('\AppLocalize\Localization')) |
|
| 100 | + if (class_exists('\AppLocalize\Localization')) |
|
| 101 | 101 | { |
| 102 | 102 | return call_user_func_array('\AppLocalize\t', $args); |
| 103 | 103 | } |
@@ -115,7 +115,7 @@ discard block |
||
| 115 | 115 | */ |
| 116 | 116 | function requireCURL() : void |
| 117 | 117 | { |
| 118 | - if(function_exists('curl_init')) { |
|
| 118 | + if (function_exists('curl_init')) { |
|
| 119 | 119 | return; |
| 120 | 120 | } |
| 121 | 121 | |
@@ -132,7 +132,7 @@ discard block |
||
| 132 | 132 | * @param bool $initial The initial boolean value to use. |
| 133 | 133 | * @return Value_Bool |
| 134 | 134 | */ |
| 135 | -function valBool(bool $initial=false) : Value_Bool |
|
| 135 | +function valBool(bool $initial = false) : Value_Bool |
|
| 136 | 136 | { |
| 137 | 137 | return new Value_Bool($initial); |
| 138 | 138 | } |
@@ -145,7 +145,7 @@ discard block |
||
| 145 | 145 | * @param bool $initial |
| 146 | 146 | * @return Value_Bool_True |
| 147 | 147 | */ |
| 148 | -function valBoolTrue(bool $initial=false) : Value_Bool_True |
|
| 148 | +function valBoolTrue(bool $initial = false) : Value_Bool_True |
|
| 149 | 149 | { |
| 150 | 150 | return new Value_Bool_True($initial); |
| 151 | 151 | } |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | * @param bool $initial |
| 159 | 159 | * @return Value_Bool_False |
| 160 | 160 | */ |
| 161 | -function valBoolFalse(bool $initial=true) : Value_Bool_False |
|
| 161 | +function valBoolFalse(bool $initial = true) : Value_Bool_False |
|
| 162 | 162 | { |
| 163 | 163 | return new Value_Bool_False($initial); |
| 164 | 164 | } |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | */ |
| 171 | 171 | function init() |
| 172 | 172 | { |
| 173 | - if(!class_exists('\AppLocalize\Localization')) { |
|
| 173 | + if (!class_exists('\AppLocalize\Localization')) { |
|
| 174 | 174 | return; |
| 175 | 175 | } |
| 176 | 176 | |
@@ -21,7 +21,7 @@ |
||
| 21 | 21 | { |
| 22 | 22 | protected $value = false; |
| 23 | 23 | |
| 24 | - public function __construct(bool $value=false) |
|
| 24 | + public function __construct(bool $value = false) |
|
| 25 | 25 | { |
| 26 | 26 | $this->value = $value; |
| 27 | 27 | } |
@@ -22,14 +22,14 @@ |
||
| 22 | 22 | */ |
| 23 | 23 | class Value_Bool_False extends Value_Bool |
| 24 | 24 | { |
| 25 | - public function __construct(bool $value=true) |
|
| 25 | + public function __construct(bool $value = true) |
|
| 26 | 26 | { |
| 27 | 27 | parent::__construct($value); |
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | public function set(bool $value) : Value_Bool |
| 31 | 31 | { |
| 32 | - if($value === false) |
|
| 32 | + if ($value === false) |
|
| 33 | 33 | { |
| 34 | 34 | parent::set($value); |
| 35 | 35 | } |
@@ -24,7 +24,7 @@ |
||
| 24 | 24 | { |
| 25 | 25 | public function set(bool $value) : Value_Bool |
| 26 | 26 | { |
| 27 | - if($value === true) |
|
| 27 | + if ($value === true) |
|
| 28 | 28 | { |
| 29 | 29 | parent::set($value); |
| 30 | 30 | } |
@@ -56,9 +56,9 @@ discard block |
||
| 56 | 56 | * @param mixed $value |
| 57 | 57 | * @param array|null $serialized |
| 58 | 58 | */ |
| 59 | - public function __construct($value, $serialized=null) |
|
| 59 | + public function __construct($value, $serialized = null) |
|
| 60 | 60 | { |
| 61 | - if(is_array($serialized)) |
|
| 61 | + if (is_array($serialized)) |
|
| 62 | 62 | { |
| 63 | 63 | $this->parseSerialized($serialized); |
| 64 | 64 | } |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | protected function parseSerialized(array $serialized) : void |
| 106 | 106 | { |
| 107 | - if(!isset($serialized['string']) || !isset($serialized['type']) || !isset($serialized['options'])) |
|
| 107 | + if (!isset($serialized['string']) || !isset($serialized['type']) || !isset($serialized['options'])) |
|
| 108 | 108 | { |
| 109 | 109 | throw new BaseException( |
| 110 | 110 | 'Invalid variable info serialized data.', |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | $this->value = $value; |
| 125 | 125 | $this->type = strtolower(gettype($value)); |
| 126 | 126 | |
| 127 | - if(is_array($value) && is_callable($value)) { |
|
| 127 | + if (is_array($value) && is_callable($value)) { |
|
| 128 | 128 | $this->type = self::TYPE_CALLABLE; |
| 129 | 129 | } |
| 130 | 130 | |
@@ -162,7 +162,7 @@ discard block |
||
| 162 | 162 | * @param bool $enable |
| 163 | 163 | * @return VariableInfo |
| 164 | 164 | */ |
| 165 | - public function enableType(bool $enable=true) : VariableInfo |
|
| 165 | + public function enableType(bool $enable = true) : VariableInfo |
|
| 166 | 166 | { |
| 167 | 167 | return $this->setOption('prepend-type', $enable); |
| 168 | 168 | } |
@@ -171,9 +171,9 @@ discard block |
||
| 171 | 171 | { |
| 172 | 172 | $converted = $this->string; |
| 173 | 173 | |
| 174 | - if($this->getOption('prepend-type') === true && !$this->isNull()) |
|
| 174 | + if ($this->getOption('prepend-type') === true && !$this->isNull()) |
|
| 175 | 175 | { |
| 176 | - if($this->isString()) |
|
| 176 | + if ($this->isString()) |
|
| 177 | 177 | { |
| 178 | 178 | $converted = '"'.$converted.'"'; |
| 179 | 179 | } |
@@ -54,7 +54,7 @@ discard block |
||
| 54 | 54 | * @param bool $enabled |
| 55 | 55 | * @return ConvertHelper_URLFinder |
| 56 | 56 | */ |
| 57 | - public function enableSorting(bool $enabled=true) : ConvertHelper_URLFinder |
|
| 57 | + public function enableSorting(bool $enabled = true) : ConvertHelper_URLFinder |
|
| 58 | 58 | { |
| 59 | 59 | $this->sorting = $enabled; |
| 60 | 60 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | { |
| 71 | 71 | $replaces = array(); |
| 72 | 72 | |
| 73 | - foreach($this->schemes as $scheme) |
|
| 73 | + foreach ($this->schemes as $scheme) |
|
| 74 | 74 | { |
| 75 | 75 | $replaces[$scheme.':'] = PHP_EOL.$scheme.':'; |
| 76 | 76 | } |
@@ -94,18 +94,18 @@ discard block |
||
| 94 | 94 | |
| 95 | 95 | $result = array(); |
| 96 | 96 | |
| 97 | - if(is_array($matches)) |
|
| 97 | + if (is_array($matches)) |
|
| 98 | 98 | { |
| 99 | - foreach($matches[0] as $match) |
|
| 99 | + foreach ($matches[0] as $match) |
|
| 100 | 100 | { |
| 101 | - if(strstr($match, '://') && !in_array($match, $result)) |
|
| 101 | + if (strstr($match, '://') && !in_array($match, $result)) |
|
| 102 | 102 | { |
| 103 | 103 | $result[] = $match; |
| 104 | 104 | } |
| 105 | 105 | } |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - if($this->sorting) |
|
| 108 | + if ($this->sorting) |
|
| 109 | 109 | { |
| 110 | 110 | usort($result, function(string $a, string $b) { |
| 111 | 111 | return strnatcasecmp($a, $b); |
@@ -126,7 +126,7 @@ discard block |
||
| 126 | 126 | |
| 127 | 127 | $result = array(); |
| 128 | 128 | |
| 129 | - foreach($urls as $url) |
|
| 129 | + foreach ($urls as $url) |
|
| 130 | 130 | { |
| 131 | 131 | $result[] = parseURL($url); |
| 132 | 132 | } |
@@ -13,15 +13,15 @@ |
||
| 13 | 13 | return print_r($result, true); |
| 14 | 14 | } |
| 15 | 15 | |
| 16 | - protected function traverseArray(array $array, int $level=0) : array |
|
| 16 | + protected function traverseArray(array $array, int $level = 0) : array |
|
| 17 | 17 | { |
| 18 | 18 | $result = array(); |
| 19 | 19 | |
| 20 | - foreach($array as $key => $val) |
|
| 20 | + foreach ($array as $key => $val) |
|
| 21 | 21 | { |
| 22 | - if(is_array($val)) |
|
| 22 | + if (is_array($val)) |
|
| 23 | 23 | { |
| 24 | - $result[$key] = $this->traverseArray($val, ($level+1)); |
|
| 24 | + $result[$key] = $this->traverseArray($val, ($level + 1)); |
|
| 25 | 25 | } |
| 26 | 26 | else |
| 27 | 27 | { |