From d1a0aa45de7f51af16ffe6cda3d38ec4ace9e04b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Maximilian=20Kr=C3=B6g?= Date: Fri, 28 Apr 2023 22:25:41 +0200 Subject: [PATCH] phpstan supports object shape since 1.10.12 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Maximilian Krög --- composer.json | 2 +- libraries/classes/FieldMetadata.php | 19 +++++++++---------- 2 files changed, 10 insertions(+), 11 deletions(-) diff --git a/composer.json b/composer.json index c0b9c636d7..24e9c76d7c 100644 --- a/composer.json +++ b/composer.json @@ -100,7 +100,7 @@ "php-webdriver/webdriver": "^1.14", "phpmyadmin/coding-standard": "^4.0", "phpstan/extension-installer": "^1.2", - "phpstan/phpstan": "^1.10", + "phpstan/phpstan": "^1.10.12", "phpstan/phpstan-phpunit": "^1.3", "phpstan/phpstan-strict-rules": "^1.5", "phpstan/phpstan-webmozart-assert": "^1.2", diff --git a/libraries/classes/FieldMetadata.php b/libraries/classes/FieldMetadata.php index 73f1bff006..9201bd0648 100644 --- a/libraries/classes/FieldMetadata.php +++ b/libraries/classes/FieldMetadata.php @@ -179,14 +179,13 @@ final class FieldMetadata * def: string, * catalog: string, * } $field - * @phpstan-param object $field Ignore unknown property access */ public function __construct(object $field) { - $type = $field->type; // @phpstan-ignore-line + $type = $field->type; $this->mappedType = $this->getMappedInternalType($type); - $flags = $field->flags; // @phpstan-ignore-line + $flags = $field->flags; $this->isMultipleKey = (bool) ($flags & MYSQLI_MULTIPLE_KEY_FLAG); $this->isPrimaryKey = (bool) ($flags & MYSQLI_PRI_KEY_FLAG); $this->isUniqueKey = (bool) ($flags & MYSQLI_UNIQUE_KEY_FLAG); @@ -210,13 +209,13 @@ final class FieldMetadata $this->isMappedTypeGeometry = $this->isType(self::TYPE_GEOMETRY); $this->isMappedTypeTimestamp = $this->isType(self::TYPE_TIMESTAMP); - $this->name = $field->name; // @phpstan-ignore-line - $this->orgname = $field->orgname; // @phpstan-ignore-line - $this->table = $field->table; // @phpstan-ignore-line - $this->orgtable = $field->orgtable; // @phpstan-ignore-line - $this->charsetnr = $field->charsetnr; // @phpstan-ignore-line - $this->decimals = $field->decimals; // @phpstan-ignore-line - $this->length = $field->length; // @phpstan-ignore-line + $this->name = $field->name; + $this->orgname = $field->orgname; + $this->table = $field->table; + $this->orgtable = $field->orgtable; + $this->charsetnr = $field->charsetnr; + $this->decimals = $field->decimals; + $this->length = $field->length; // 63 is the number for the MySQL charset "binary" $this->isBinary = (