@@ -65,7 +65,7 @@ public function checkPhpVersion()
65
65
];
66
66
}
67
67
$ multipleConstraints = $ this ->versionParser ->parseConstraints ($ requiredVersion );
68
- $ normalizedPhpVersion = $ this ->normalizeCurrentPhpVersion ( );
68
+ $ normalizedPhpVersion = $ this ->getNormalizedCurrentPhpVersion ( PHP_VERSION );
69
69
$ currentPhpVersion = $ this ->versionParser ->parseConstraints ($ normalizedPhpVersion );
70
70
$ responseType = ResponseTypeInterface::RESPONSE_TYPE_SUCCESS ;
71
71
if (!$ multipleConstraints ->matches ($ currentPhpVersion )) {
@@ -196,7 +196,7 @@ private function checkPopulateRawPostSetting()
196
196
$ iniSetting = intVal (ini_get ('always_populate_raw_post_data ' ));
197
197
198
198
$ checkVersionConstraint = $ this ->versionParser ->parseConstraints ('~5.6.0 ' );
199
- $ normalizedPhpVersion = $ this ->normalizeCurrentPhpVersion ( );
199
+ $ normalizedPhpVersion = $ this ->getNormalizedCurrentPhpVersion ( PHP_VERSION );
200
200
$ currentVersion = $ this ->versionParser ->parseConstraints ($ normalizedPhpVersion );
201
201
if ($ checkVersionConstraint ->matches ($ currentVersion ) && $ iniSetting !== -1 ) {
202
202
$ error = true ;
@@ -224,14 +224,15 @@ private function checkPopulateRawPostSetting()
224
224
/**
225
225
* Normalize PHP Version
226
226
*
227
+ * @param string $version
227
228
* @return string
228
229
*/
229
- private function normalizeCurrentPhpVersion ( )
230
+ private function getNormalizedCurrentPhpVersion ( $ version )
230
231
{
231
232
try {
232
- $ normalizedPhpVersion = $ this ->versionParser ->normalize (PHP_VERSION );
233
+ $ normalizedPhpVersion = $ this ->versionParser ->normalize ($ version );
233
234
} catch (\UnexpectedValueException $ e ) {
234
- $ prettyVersion = preg_replace ('#^([^~+-]+).*$# ' , '$1 ' , PHP_VERSION );
235
+ $ prettyVersion = preg_replace ('#^([^~+-]+).*$# ' , '$1 ' , $ version );
235
236
$ normalizedPhpVersion = $ this ->versionParser ->normalize ($ prettyVersion );
236
237
}
237
238
return $ normalizedPhpVersion ;
0 commit comments