@@ -29,7 +29,7 @@ discard block |
||
| 29 | 29 | * |
| 30 | 30 | * @return PhpIniCheck |
| 31 | 31 | */ |
| 32 | - public function __construct(string $label, string $varName, string $varType, $varValue, $maxValue=null) |
|
| 32 | + public function __construct(string $label, string $varName, string $varType, $varValue, $maxValue = null) |
|
| 33 | 33 | { |
| 34 | 34 | parent::__construct($label); |
| 35 | 35 | $this->varName = $varName; |
@@ -45,14 +45,14 @@ discard block |
||
| 45 | 45 | */ |
| 46 | 46 | protected function stringToMegabyte(string $size) |
| 47 | 47 | { |
| 48 | - $value = preg_replace('~[^0-9]*~','', $size); |
|
| 48 | + $value = preg_replace('~[^0-9]*~', '', $size); |
|
| 49 | 49 | switch (substr(strtolower($size), -1)) { |
| 50 | 50 | case 'm': |
| 51 | - return (int)$value; |
|
| 51 | + return (int) $value; |
|
| 52 | 52 | case 'k': |
| 53 | - return round((int)$value / 1024); |
|
| 53 | + return round((int) $value / 1024); |
|
| 54 | 54 | case 'g': |
| 55 | - return ((int)$value * 1024); |
|
| 55 | + return ((int) $value * 1024); |
|
| 56 | 56 | default: |
| 57 | 57 | return false; |
| 58 | 58 | } |
@@ -78,7 +78,7 @@ discard block |
||
| 78 | 78 | default: |
| 79 | 79 | $result = new Result($this->label); |
| 80 | 80 | $result->setSuccess(false); |
| 81 | - $result->setError("Invalid Type: " . $this->varType); |
|
| 81 | + $result->setError("Invalid Type: ".$this->varType); |
|
| 82 | 82 | return $result; |
| 83 | 83 | } |
| 84 | 84 | } |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | break; |
| 106 | 106 | } |
| 107 | 107 | |
| 108 | - $result->setSuccess( boolval($this->iniValue) === boolval($this->varValue) ); |
|
| 108 | + $result->setSuccess(boolval($this->iniValue) === boolval($this->varValue)); |
|
| 109 | 109 | $result->setError("php.ini value of '".$this->varName."' is set to '".strval(boolval($this->iniValue))."' instead of expected '".strval(boolval($this->varValue))."'"); |
| 110 | 110 | return $result; |
| 111 | 111 | } |
@@ -118,7 +118,7 @@ discard block |
||
| 118 | 118 | $result = new Result($this->label); |
| 119 | 119 | if ($this->iniValue != -1) { |
| 120 | 120 | $value = $this->stringToMegabyte($this->iniValue); |
| 121 | - $result->setSuccess( $value >= $this->varValue ); |
|
| 121 | + $result->setSuccess($value >= $this->varValue); |
|
| 122 | 122 | $result->setError("php.ini value of '".$this->varName."' is set to '".strval($this->iniValue)."', minimum expected is '".strval($this->varValue)."'"); |
| 123 | 123 | } |
| 124 | 124 | return $result; |
@@ -165,7 +165,7 @@ discard block |
||
| 165 | 165 | protected function checkString() |
| 166 | 166 | { |
| 167 | 167 | $result = new Result($this->label); |
| 168 | - $result->setSuccess( strval($this->iniValue) == strval($this->varValue) ); |
|
| 168 | + $result->setSuccess(strval($this->iniValue) == strval($this->varValue)); |
|
| 169 | 169 | $result->setError("php.ini value of '".$this->varName."' is set to '".strval($this->iniValue)."', expected is '".strval($this->varValue)."'"); |
| 170 | 170 | return $result; |
| 171 | 171 | } |