@@ -65,7 +65,7 @@ public function checkPhpVersion()
65
65
];
66
66
}
67
67
$ multipleConstraints = $ this ->versionParser ->parseConstraints ($ requiredVersion );
68
- $ normalizedPhpVersion = $ this ->normalizePhpVersion ( PHP_VERSION );
68
+ $ normalizedPhpVersion = $ this ->normalizeCurrentPhpVersion ( );
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 ->normalizePhpVersion ( PHP_VERSION );
199
+ $ normalizedPhpVersion = $ this ->normalizeCurrentPhpVersion ( );
200
200
$ currentVersion = $ this ->versionParser ->parseConstraints ($ normalizedPhpVersion );
201
201
if ($ checkVersionConstraint ->matches ($ currentVersion ) && $ iniSetting !== -1 ) {
202
202
$ error = true ;
@@ -221,19 +221,17 @@ private function checkPopulateRawPostSetting()
221
221
return $ data ;
222
222
}
223
223
224
-
225
224
/**
226
225
* Normalize PHP Version
227
226
*
228
- * @param string $version
229
227
* @return string
230
228
*/
231
- private function normalizePhpVersion ( $ version )
229
+ private function normalizeCurrentPhpVersion ( )
232
230
{
233
231
try {
234
- $ normalizedPhpVersion = $ this ->versionParser ->normalize ($ version );
232
+ $ normalizedPhpVersion = $ this ->versionParser ->normalize (PHP_VERSION );
235
233
} catch (\UnexpectedValueException $ e ) {
236
- $ prettyVersion = preg_replace ('#^([^~+-]+).*$# ' , '$1 ' , $ version );
234
+ $ prettyVersion = preg_replace ('#^([^~+-]+).*$# ' , '$1 ' , PHP_VERSION );
237
235
$ normalizedPhpVersion = $ this ->versionParser ->normalize ($ prettyVersion );
238
236
}
239
237
return $ normalizedPhpVersion ;
0 commit comments