@@ -80,7 +80,7 @@ discard block |
||
| 80 | 80 | */ |
| 81 | 81 | public function getVersion() |
| 82 | 82 | { |
| 83 | - return (string)isset($this->version) ? $this->version : '0.0.0'; |
|
| 83 | + return (string) isset($this->version) ? $this->version : '0.0.0'; |
|
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | /** |
@@ -92,7 +92,7 @@ discard block |
||
| 92 | 92 | */ |
| 93 | 93 | public function getMajor() |
| 94 | 94 | { |
| 95 | - return (int)$this->getComponent('major') ?: 0; |
|
| 95 | + return (int) $this->getComponent('major') ?: 0; |
|
| 96 | 96 | } |
| 97 | 97 | |
| 98 | 98 | /** |
@@ -104,7 +104,7 @@ discard block |
||
| 104 | 104 | */ |
| 105 | 105 | public function getMinor() |
| 106 | 106 | { |
| 107 | - return (int)$this->getComponent('minor') ?: 0; |
|
| 107 | + return (int) $this->getComponent('minor') ?: 0; |
|
| 108 | 108 | } |
| 109 | 109 | |
| 110 | 110 | /** |
@@ -116,7 +116,7 @@ discard block |
||
| 116 | 116 | */ |
| 117 | 117 | public function getPatch() |
| 118 | 118 | { |
| 119 | - return (int)$this->getComponent('patch') ?: 0; |
|
| 119 | + return (int) $this->getComponent('patch') ?: 0; |
|
| 120 | 120 | } |
| 121 | 121 | |
| 122 | 122 | /** |
@@ -128,7 +128,7 @@ discard block |
||
| 128 | 128 | */ |
| 129 | 129 | public function getPreRelease() |
| 130 | 130 | { |
| 131 | - return (string)$this->getComponent('pre-release') ?: ''; |
|
| 131 | + return (string) $this->getComponent('pre-release') ?: ''; |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | 134 | /** |
@@ -140,7 +140,7 @@ discard block |
||
| 140 | 140 | */ |
| 141 | 141 | public function getBuild() |
| 142 | 142 | { |
| 143 | - return (string)$this->getComponent('build') ?: ''; |
|
| 143 | + return (string) $this->getComponent('build') ?: ''; |
|
| 144 | 144 | } |
| 145 | 145 | |
| 146 | 146 | /** |
@@ -152,7 +152,7 @@ discard block |
||
| 152 | 152 | */ |
| 153 | 153 | public function __toString() |
| 154 | 154 | { |
| 155 | - return (string)$this->getVersion(); |
|
| 155 | + return (string) $this->getVersion(); |
|
| 156 | 156 | } |
| 157 | 157 | |
| 158 | 158 | /** |
@@ -179,22 +179,22 @@ discard block |
||
| 179 | 179 | if ( ! $result) { |
| 180 | 180 | throw new RuntimeException(sprintf( |
| 181 | 181 | 'Failed to validate version "%1$s".', |
| 182 | - (string)$version |
|
| 182 | + (string) $version |
|
| 183 | 183 | )); |
| 184 | 184 | } |
| 185 | 185 | |
| 186 | 186 | if ( ! $partial && ( ! isset($components[2]) || ! isset($components[3]))) { |
| 187 | 187 | throw new RuntimeException(sprintf( |
| 188 | 188 | 'Could not accept partial version "%1$s", requested full versions only.', |
| 189 | - (string)$version |
|
| 189 | + (string) $version |
|
| 190 | 190 | )); |
| 191 | 191 | } |
| 192 | 192 | |
| 193 | - $this->setComponent('major', isset($components[1]) ? (int)$components[1] : 0); |
|
| 194 | - $this->setComponent('minor', isset($components[2]) ? (int)$components[2] : 0); |
|
| 195 | - $this->setComponent('patch', isset($components[3]) ? (int)$components[3] : 0); |
|
| 196 | - $this->setComponent('pre-release', isset($components[4]) ? (string)$components[4] : ''); |
|
| 197 | - $this->setComponent('build', isset($components[5]) ? (string)$components[5] : ''); |
|
| 193 | + $this->setComponent('major', isset($components[1]) ? (int) $components[1] : 0); |
|
| 194 | + $this->setComponent('minor', isset($components[2]) ? (int) $components[2] : 0); |
|
| 195 | + $this->setComponent('patch', isset($components[3]) ? (int) $components[3] : 0); |
|
| 196 | + $this->setComponent('pre-release', isset($components[4]) ? (string) $components[4] : ''); |
|
| 197 | + $this->setComponent('build', isset($components[5]) ? (string) $components[5] : ''); |
|
| 198 | 198 | |
| 199 | 199 | $version = $this->getVersionFromComponents(); |
| 200 | 200 | |
@@ -211,8 +211,8 @@ discard block |
||
| 211 | 211 | protected function getVersionFromComponents() |
| 212 | 212 | { |
| 213 | 213 | |
| 214 | - $pre_release = $this->getPreRelease() ? '-' . $this->getPreRelease() : ''; |
|
| 215 | - $build = $this->getBuild() ? '+' . $this->getBuild() : ''; |
|
| 214 | + $pre_release = $this->getPreRelease() ? '-'.$this->getPreRelease() : ''; |
|
| 215 | + $build = $this->getBuild() ? '+'.$this->getBuild() : ''; |
|
| 216 | 216 | |
| 217 | 217 | $version = sprintf( |
| 218 | 218 | '%1$s.%2$s.%3$s%4$s%5$s', |
@@ -76,7 +76,7 @@ discard block |
||
| 76 | 76 | |
| 77 | 77 | // TODO: Better way to bootstrap this while still allowing DI? |
| 78 | 78 | if ( ! $config) { |
| 79 | - $config = new Config(include(dirname(__FILE__) . '/../config/known_features.php')); |
|
| 79 | + $config = new Config(include(dirname(__FILE__).'/../config/known_features.php')); |
|
| 80 | 80 | } |
| 81 | 81 | |
| 82 | 82 | $this->config = $config; |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | if (is_int($phpVersion)) { |
| 89 | - $phpVersion = (string)$phpVersion; |
|
| 89 | + $phpVersion = (string) $phpVersion; |
|
| 90 | 90 | } |
| 91 | 91 | |
| 92 | 92 | if (is_string($phpVersion)) { |
@@ -128,10 +128,10 @@ discard block |
||
| 128 | 128 | |
| 129 | 129 | while ($isSupported && count($features) > 0) { |
| 130 | 130 | $feature = array_pop($features); |
| 131 | - $isSupported &= (bool)$this->checkSupport($feature); |
|
| 131 | + $isSupported &= (bool) $this->checkSupport($feature); |
|
| 132 | 132 | } |
| 133 | 133 | |
| 134 | - return (bool)$isSupported; |
|
| 134 | + return (bool) $isSupported; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | /** |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | |
| 170 | 170 | while (count($features) > 0) { |
| 171 | 171 | $feature = array_pop($features); |
| 172 | - $isSupported &= (bool)$this->checkSupport($feature, $minimumRequired); |
|
| 172 | + $isSupported &= (bool) $this->checkSupport($feature, $minimumRequired); |
|
| 173 | 173 | } |
| 174 | 174 | |
| 175 | 175 | return $minimumRequired !== '0.0.0' ? new SemanticVersion($minimumRequired, true) : false; |
@@ -193,16 +193,16 @@ discard block |
||
| 193 | 193 | return false; |
| 194 | 194 | } |
| 195 | 195 | |
| 196 | - $requirements = (array)$this->config->getKey($feature); |
|
| 196 | + $requirements = (array) $this->config->getKey($feature); |
|
| 197 | 197 | |
| 198 | 198 | $isSupported = true; |
| 199 | 199 | |
| 200 | 200 | while (($isSupported || null !== $minimumRequired) && count($requirements) > 0) { |
| 201 | 201 | $requirement = array_pop($requirements); |
| 202 | - $isSupported &= (bool)$this->checkRequirement($requirement, $minimumRequired); |
|
| 202 | + $isSupported &= (bool) $this->checkRequirement($requirement, $minimumRequired); |
|
| 203 | 203 | } |
| 204 | 204 | |
| 205 | - return (bool)$isSupported; |
|
| 205 | + return (bool) $isSupported; |
|
| 206 | 206 | } |
| 207 | 207 | |
| 208 | 208 | /** |
@@ -228,14 +228,14 @@ discard block |
||
| 228 | 228 | if ( ! $result || ! isset($arguments[1]) || ! isset($arguments[2])) { |
| 229 | 229 | throw new RuntimeException(sprintf( |
| 230 | 230 | 'Could not parse the requirement "%1$s".', |
| 231 | - (string)$requirement |
|
| 231 | + (string) $requirement |
|
| 232 | 232 | )); |
| 233 | 233 | } |
| 234 | 234 | |
| 235 | - $operator = isset($arguments[1]) ? (string)$arguments[1] : '>='; |
|
| 236 | - $milestone = isset($arguments[2]) ? (string)$arguments[2] : '0.0.0'; |
|
| 235 | + $operator = isset($arguments[1]) ? (string) $arguments[1] : '>='; |
|
| 236 | + $milestone = isset($arguments[2]) ? (string) $arguments[2] : '0.0.0'; |
|
| 237 | 237 | |
| 238 | - $isSupported = (bool)version_compare($this->version->getVersion(), $milestone, $operator); |
|
| 238 | + $isSupported = (bool) version_compare($this->version->getVersion(), $milestone, $operator); |
|
| 239 | 239 | |
| 240 | 240 | if (null !== $minimumRequired) { |
| 241 | 241 | $requiredVersion = $this->getRequiredVersion($milestone, $operator); |