PHPStan 1.11 + minor update dev dependencies (#6459)

* PHPStan 1.11 + minor update dev dependencies
https://github.com/phpstan/phpstan/releases/tag/1.11.0

* Comment style
This commit is contained in:
Alexandre Alapetite
2024-05-15 08:57:58 +02:00
committed by GitHub
parent f958eaef2f
commit 2d17c020b6
16 changed files with 139 additions and 194 deletions

View File

@@ -72,7 +72,7 @@ class Minz_Configuration {
/**
* The namespace of the current configuration.
* Unused.
* @phpstan-ignore-next-line
* @phpstan-ignore property.onlyWritten
*/
private string $namespace = '';

View File

@@ -44,7 +44,7 @@ final class Minz_Dispatcher {
$this->createController (Minz_Request::controllerName ());
$this->controller->init ();
$this->controller->firstAction ();
// @phpstan-ignore-next-line
// @phpstan-ignore booleanNot.alwaysTrue
if (!self::$needsReset) {
$this->launchAction (
Minz_Request::actionName ()
@@ -53,7 +53,7 @@ final class Minz_Dispatcher {
}
$this->controller->lastAction ();
// @phpstan-ignore-next-line
// @phpstan-ignore booleanNot.alwaysTrue
if (!self::$needsReset) {
$this->controller->declareCspHeader();
$this->controller->view ()->build ();
@@ -61,7 +61,7 @@ final class Minz_Dispatcher {
} catch (Minz_Exception $e) {
throw $e;
}
// @phpstan-ignore-next-line
// @phpstan-ignore doWhile.alwaysFalse
} while (self::$needsReset);
}

View File

@@ -58,7 +58,7 @@ abstract class Minz_Pdo extends PDO {
* @param array<int,string> $options
* @return PDOStatement|false
* @throws PDOException if the attribute `PDO::ATTR_ERRMODE` is set to `PDO::ERRMODE_EXCEPTION`
* @phpstan-ignore-next-line
* @phpstan-ignore method.childParameterType, throws.unusedType
*/
#[\Override]
#[\ReturnTypeWillChange]
@@ -72,7 +72,7 @@ abstract class Minz_Pdo extends PDO {
* @param string $statement
* @return int|false
* @throws PDOException if the attribute `PDO::ATTR_ERRMODE` is set to `PDO::ERRMODE_EXCEPTION`
* @phpstan-ignore-next-line
* @phpstan-ignore throws.unusedType
*/
#[\Override]
#[\ReturnTypeWillChange]
@@ -84,7 +84,7 @@ abstract class Minz_Pdo extends PDO {
/**
* @return PDOStatement|false
* @throws PDOException if the attribute `PDO::ATTR_ERRMODE` is set to `PDO::ERRMODE_EXCEPTION`
* @phpstan-ignore-next-line
* @phpstan-ignore throws.unusedType
*/
#[\Override]
#[\ReturnTypeWillChange]

View File

@@ -346,8 +346,7 @@ class Minz_View {
public function attributeParams(): void {
foreach (Minz_View::$params as $key => $value) {
// TODO: Do not use variable variable (noVariableVariables)
/** @phpstan-ignore-next-line */
// @phpstan-ignore property.dynamicName
$this->$key = $value;
}
}

View File

@@ -107,13 +107,13 @@ function httpConditional(int $UnixTimeStamp, int $cacheSeconds = 0, int $cachePr
}
$etagServer = '"' . md5($scriptName . $myQuery . '#' . $dateLastModif) . '"';
// @phpstan-ignore-next-line
// @phpstan-ignore booleanNot.alwaysTrue
if ((!$is412) && isset($_SERVER['HTTP_IF_MATCH'])) { //rfc2616-sec14.html#sec14.24
$etagsClient = stripslashes($_SERVER['HTTP_IF_MATCH']);
$etagsClient = str_ireplace('-gzip', '', $etagsClient);
$is412 = (($etagsClient !== '*') && (strpos($etagsClient, $etagServer) === false));
}
// @phpstan-ignore-next-line
// @phpstan-ignore booleanAnd.leftAlwaysTrue
if ($is304 && isset($_SERVER['HTTP_IF_MODIFIED_SINCE'])) { //rfc2616-sec14.html#sec14.25 //rfc1945.txt
$nbCond++;
$dateCacheClient = $_SERVER['HTTP_IF_MODIFIED_SINCE'];

View File

@@ -41,7 +41,7 @@ if (!function_exists('syslog')) {
define('STDERR', fopen('php://stderr', 'w'));
}
function syslog(int $priority, string $message): bool {
// @phpstan-ignore-next-line
// @phpstan-ignore booleanAnd.rightAlwaysTrue
if (COPY_SYSLOG_TO_STDERR && defined('STDERR') && STDERR) {
return fwrite(STDERR, $message . "\n") != false;
}