Skip to content

Commit

Permalink
Pin phpstan to 1.12.0 (cakephp#17875)
Browse files Browse the repository at this point in the history
  • Loading branch information
ADmad authored Aug 28, 2024
1 parent 7de7328 commit 3cea64b
Show file tree
Hide file tree
Showing 9 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
"mikey179/vfsstream": "^1.6.10",
"mockery/mockery": "^1.6",
"paragonie/csp-builder": "^2.3 || ^3.0",
"phpstan/phpstan": "1.11.*",
"phpstan/phpstan": "1.12.0",
"phpstan/extension-installer": "^1.3",
"symplify/phpstan-rules": "^12.4",
"phpunit/phpunit": "^10.1.0 <=10.5.3"
Expand Down
1 change: 1 addition & 0 deletions src/Database/Driver/Mysql.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ public function version(): string
if (str_contains($this->_version, 'MariaDB')) {
$this->serverType = static::SERVER_TYPE_MARIADB;
preg_match('/^(?:5\.5\.5-)?(\d+\.\d+\.\d+.*-MariaDB[^:]*)/', $this->_version, $matches);
/** @phpstan-ignore-next-line */
$this->_version = $matches[1];
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/Database/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
"require-dev": {
"cakephp/i18n": "^5.0",
"cakephp/log": "^5.0",
"phpstan/phpstan": "^1.10"
"phpstan/phpstan": "1.12.0"
}
}
2 changes: 1 addition & 1 deletion src/Datasource/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@
"cakephp/cache": "^5.0",
"cakephp/collection": "^5.0",
"cakephp/utility": "^5.0",
"phpstan/phpstan": "^1.10"
"phpstan/phpstan": "1.12.0"
}
}
3 changes: 3 additions & 0 deletions src/Http/Client/Response.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,11 @@ protected function _parseHeaders(array $headers): void
foreach ($headers as $value) {
if (str_starts_with($value, 'HTTP/')) {
preg_match('/HTTP\/([\d.]+) ([0-9]+)(.*)/i', $value, $matches);
/** @phpstan-ignore-next-line */
$this->protocol = $matches[1];
/** @phpstan-ignore-next-line */
$this->code = (int)$matches[2];
/** @phpstan-ignore-next-line */
$this->reasonPhrase = trim($matches[3]);
continue;
}
Expand Down
8 changes: 8 additions & 0 deletions src/Http/HeaderUtility.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ protected static function parseLinkItem(string $value): array
{
preg_match('/<(.*)>[; ]?[; ]?(.*)?/i', $value, $matches);

if ($matches === []) {
return [];
}

$url = $matches[1];
$parsedParams = ['link' => $url];

Expand All @@ -48,8 +52,11 @@ protected static function parseLinkItem(string $value): array
// See https://www.rfc-editor.org/rfc/rfc8187#section-3.2.3
preg_match('/(.*)\'(.*)\'(.*)/i', $trimedValue, $matches);
$trimedValue = [
/** @phpstan-ignore-next-line */
'language' => $matches[2],
/** @phpstan-ignore-next-line */
'encoding' => $matches[1],
/** @phpstan-ignore-next-line */
'value' => urldecode($matches[3]),
];
}
Expand Down Expand Up @@ -117,6 +124,7 @@ public static function parseWwwAuthenticate(string $value): array

$return = [];
foreach ($matches as $match) {
/** @phpstan-ignore-next-line */
$return[$match[1]] = $match[3] ?? $match[2];
}

Expand Down
2 changes: 1 addition & 1 deletion src/Http/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,6 @@
"cakephp/orm": "^5.0",
"cakephp/i18n": "^5.0",
"paragonie/csp-builder": "^2.3",
"phpstan/phpstan": "^1.10"
"phpstan/phpstan": "1.12.0"
}
}
2 changes: 1 addition & 1 deletion src/ORM/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,6 @@
"require-dev": {
"cakephp/cache": "^5.0",
"cakephp/i18n": "^5.0",
"phpstan/phpstan": "^1.10"
"phpstan/phpstan": "1.12.0"
}
}
2 changes: 1 addition & 1 deletion src/Validation/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@
},
"require-dev": {
"cakephp/i18n": "^5.0",
"phpstan/phpstan": "^1.10"
"phpstan/phpstan": "1.12.0"
}
}

0 comments on commit 3cea64b

Please sign in to comment.