@@ -30,7 +30,10 @@ discard block |
||
| 30 | 30 | */ |
| 31 | 31 | public function is($pattern) |
| 32 | 32 | { |
| 33 | - if ($this->toString() === $pattern) return true; |
|
| 33 | + if ($this->toString() === $pattern) |
|
| 34 | + { |
|
| 35 | + return true; |
|
| 36 | + } |
|
| 34 | 37 | $quotedPattern = preg_quote($pattern, $this->regexDelimiter); |
| 35 | 38 | $replaceWildCards = str_replace('\*', '.*', $quotedPattern); |
| 36 | 39 | return $this->regexMatch('^'.$replaceWildCards.'\z'); |
@@ -109,7 +112,10 @@ discard block |
||
| 109 | 112 | */ |
| 110 | 113 | public function isJson() |
| 111 | 114 | { |
| 112 | - if ($this->getLength() === 0) return false; |
|
| 115 | + if ($this->getLength() === 0) |
|
| 116 | + { |
|
| 117 | + return false; |
|
| 118 | + } |
|
| 113 | 119 | |
| 114 | 120 | json_decode($this->scalarString); |
| 115 | 121 | |
@@ -123,7 +129,10 @@ discard block |
||
| 123 | 129 | */ |
| 124 | 130 | public function isSerialized() |
| 125 | 131 | { |
| 126 | - if ($this->getLength() === 0) return false; |
|
| 132 | + if ($this->getLength() === 0) |
|
| 133 | + { |
|
| 134 | + return false; |
|
| 135 | + } |
|
| 127 | 136 | |
| 128 | 137 | /** @noinspection PhpUsageOfSilenceOperatorInspection */ |
| 129 | 138 | return |
@@ -141,7 +150,10 @@ discard block |
||
| 141 | 150 | public function isBase64() |
| 142 | 151 | { |
| 143 | 152 | // An empty string is by definition not encoded. |
| 144 | - if ($this->getLength() === 0) return false; |
|
| 153 | + if ($this->getLength() === 0) |
|
| 154 | + { |
|
| 155 | + return false; |
|
| 156 | + } |
|
| 145 | 157 | |
| 146 | 158 | // Grab the current string value. |
| 147 | 159 | $possiblyEncoded = $this->scalarString; |
@@ -150,7 +162,10 @@ discard block |
||
| 150 | 162 | $decoded = base64_decode($possiblyEncoded, true); |
| 151 | 163 | |
| 152 | 164 | // If we get false it can't be base64 |
| 153 | - if ($decoded === false) return false; |
|
| 165 | + if ($decoded === false) |
|
| 166 | + { |
|
| 167 | + return false; |
|
| 168 | + } |
|
| 154 | 169 | |
| 155 | 170 | // Lets double check |
| 156 | 171 | return (base64_encode($decoded) === $this->scalarString); |