Skip to content

Commit

Permalink
PHPStan 1.12 (#6507)
Browse files Browse the repository at this point in the history
|      Q       |   A
|------------- | -----------
| Type         | improvement
| Fixed issues | N/A

#### Summary

The new PHPStan release has a deeper understanding of the array shape
created by `preg_match()` calls. I've made some adjustments to account
for that.
  • Loading branch information
derrabus authored Aug 27, 2024
1 parent a6707bf commit 5980613
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
"doctrine/coding-standard": "12.0.0",
"fig/log-test": "^1",
"jetbrains/phpstorm-stubs": "2023.1",
"phpstan/phpstan": "1.11.10",
"phpstan/phpstan": "1.12.0",
"phpstan/phpstan-strict-rules": "^1.6",
"phpunit/phpunit": "9.6.20",
"psalm/plugin-phpunit": "0.18.4",
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/AbstractDB2Driver.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ private function getVersionNumber(string $versionString): string
'/^(?:[^\s]+\s)?(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)/i',
$versionString,
$versionParts,
) === 0
) !== 1
) {
throw DBALException::invalidPlatformVersionSpecified(
$versionString,
Expand Down
4 changes: 2 additions & 2 deletions src/Driver/AbstractMySQLDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ private function getOracleMysqlVersionNumber(string $versionString): string
'/^(?P<major>\d+)(?:\.(?P<minor>\d+)(?:\.(?P<patch>\d+))?)?/',
$versionString,
$versionParts,
) === 0
) !== 1
) {
throw Exception::invalidPlatformVersionSpecified(
$versionString,
Expand Down Expand Up @@ -182,7 +182,7 @@ private function getMariaDbMysqlVersionNumber(string $versionString): string
'/^(?:5\.5\.5-)?(mariadb-)?(?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)/i',
$versionString,
$versionParts,
) === 0
) !== 1
) {
throw Exception::invalidPlatformVersionSpecified(
$versionString,
Expand Down
2 changes: 1 addition & 1 deletion src/Driver/AbstractPostgreSQLDriver.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ abstract class AbstractPostgreSQLDriver implements VersionAwarePlatformDriver
*/
public function createDatabasePlatformForVersion($version)
{
if (preg_match('/^(?P<major>\d+)(?:\.(?P<minor>\d+)(?:\.(?P<patch>\d+))?)?/', $version, $versionParts) === 0) {
if (preg_match('/^(?P<major>\d+)(?:\.(?P<minor>\d+)(?:\.(?P<patch>\d+))?)?/', $version, $versionParts) !== 1) {
throw Exception::invalidPlatformVersionSpecified(
$version,
'<major_version>.<minor_version>.<patch_version>',
Expand Down

0 comments on commit 5980613

Please sign in to comment.