diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index 59723f577f..1a5af0ff1e 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -36,6 +36,7 @@ jobs: - "8.1" - "8.2" - "8.3" + - "8.4" dbal-version: - "default" extension: @@ -106,6 +107,7 @@ jobs: php-version: - "8.2" - "8.3" + - "8.4" dbal-version: - "default" postgres-version: @@ -178,6 +180,7 @@ jobs: php-version: - "8.2" - "8.3" + - "8.4" dbal-version: - "default" - "4@dev" @@ -243,6 +246,7 @@ jobs: php-version: - "8.2" - "8.3" + - "8.4" dbal-version: - "default" mysql-version: diff --git a/UPGRADE.md b/UPGRADE.md index 01f4a19dc6..3167224175 100644 --- a/UPGRADE.md +++ b/UPGRADE.md @@ -783,6 +783,14 @@ Use `toIterable()` instead. # Upgrade to 2.20 +## Explictly forbid property hooks + +Property hooks are not supported yet by Doctrine ORM. Until support is added, +they are explicitly forbidden because the support would result in a breaking +change in behavior. + +Progress on this is tracked at https://github.com/doctrine/orm/issues/11624 . + ## PARTIAL DQL syntax is undeprecated for non-object hydration Use of the PARTIAL keyword is not deprecated anymore in DQL when used with a hydrator diff --git a/composer.json b/composer.json index d0d678f48f..f763c72ab8 100644 --- a/composer.json +++ b/composer.json @@ -15,7 +15,8 @@ "config": { "allow-plugins": { "composer/package-versions-deprecated": true, - "dealerdirect/phpcodesniffer-composer-installer": true + "dealerdirect/phpcodesniffer-composer-installer": true, + "phpstan/extension-installer": true }, "sort-packages": true }, @@ -39,7 +40,9 @@ "doctrine/coding-standard": "^12.0", "phpbench/phpbench": "^1.0", "phpdocumentor/guides-cli": "^1.4", - "phpstan/phpstan": "1.12.0", + "phpstan/extension-installer": "^1.4", + "phpstan/phpstan": "1.12.6", + "phpstan/phpstan-deprecation-rules": "^1.2", "phpunit/phpunit": "^10.4.0", "psr/log": "^1 || ^2 || ^3", "squizlabs/php_codesniffer": "3.7.2", diff --git a/docs/en/reference/metadata-drivers.rst b/docs/en/reference/metadata-drivers.rst index 1b4faadb3c..6c3d62d859 100644 --- a/docs/en/reference/metadata-drivers.rst +++ b/docs/en/reference/metadata-drivers.rst @@ -70,8 +70,8 @@ implements the ``MappingDriver`` interface: /** * Loads the metadata for the specified class into the provided container. * - * @psalm-param class-string $className - * @psalm-param ClassMetadata $metadata + * @param class-string $className + * @param ClassMetadata $metadata * * @return void * @@ -82,8 +82,7 @@ implements the ``MappingDriver`` interface: /** * Gets the names of all mapped classes known to this driver. * - * @return array The names of all mapped classes known to this driver. - * @psalm-return list + * @return list The names of all mapped classes known to this driver. */ public function getAllClassNames(); @@ -91,7 +90,7 @@ implements the ``MappingDriver`` interface: * Returns whether the class with the specified name should have its metadata loaded. * This is only the case if it is either mapped as an Entity or a MappedSuperclass. * - * @psalm-param class-string $className + * @param class-string $className * * @return bool */ diff --git a/src/Mapping/ClassMetadata.php b/src/Mapping/ClassMetadata.php index a4f620e508..53773e5cf9 100644 --- a/src/Mapping/ClassMetadata.php +++ b/src/Mapping/ClassMetadata.php @@ -1038,6 +1038,7 @@ public function isNullable(string $fieldName): bool */ public function getColumnName(string $fieldName): string { + // @phpstan-ignore property.deprecated return $this->columnNames[$fieldName] ?? $fieldName; } @@ -1187,6 +1188,7 @@ protected function validateAndCompleteFieldMapping(array $mapping): FieldMapping $mapping->quoted = true; } + // @phpstan-ignore property.deprecated $this->columnNames[$mapping->fieldName] = $mapping->columnName; if (isset($this->fieldNames[$mapping->columnName]) || ($this->discriminatorColumn && $this->discriminatorColumn->name === $mapping->columnName)) { @@ -1767,6 +1769,7 @@ public function setAttributeOverride(string $fieldName, array $overrideMapping): unset($this->fieldMappings[$fieldName]); unset($this->fieldNames[$mapping->columnName]); + // @phpstan-ignore property.deprecated unset($this->columnNames[$mapping->fieldName]); $overrideMapping = $this->validateAndCompleteFieldMapping($overrideMapping); @@ -1917,8 +1920,9 @@ public function addInheritedAssociationMapping(AssociationMapping $mapping/*, $o public function addInheritedFieldMapping(FieldMapping $fieldMapping): void { $this->fieldMappings[$fieldMapping->fieldName] = $fieldMapping; - $this->columnNames[$fieldMapping->fieldName] = $fieldMapping->columnName; - $this->fieldNames[$fieldMapping->columnName] = $fieldMapping->fieldName; + // @phpstan-ignore property.deprecated + $this->columnNames[$fieldMapping->fieldName] = $fieldMapping->columnName; + $this->fieldNames[$fieldMapping->columnName] = $fieldMapping->fieldName; if (isset($fieldMapping->generated)) { $this->requiresFetchAfterChange = true; diff --git a/src/Mapping/Driver/XmlDriver.php b/src/Mapping/Driver/XmlDriver.php index 48f650576c..9d53c91ad2 100644 --- a/src/Mapping/Driver/XmlDriver.php +++ b/src/Mapping/Driver/XmlDriver.php @@ -411,6 +411,7 @@ public function loadMetadataForClass($className, PersistenceClassMetadata $metad /** @psalm-suppress DeprecatedConstant */ $orderBy[(string) $orderByField['name']] = isset($orderByField['direction']) ? (string) $orderByField['direction'] + // @phpstan-ignore classConstant.deprecated : (enum_exists(Order::class) ? Order::Ascending->value : Criteria::ASC); } @@ -540,6 +541,7 @@ public function loadMetadataForClass($className, PersistenceClassMetadata $metad /** @psalm-suppress DeprecatedConstant */ $orderBy[(string) $orderByField['name']] = isset($orderByField['direction']) ? (string) $orderByField['direction'] + // @phpstan-ignore classConstant.deprecated : (enum_exists(Order::class) ? Order::Ascending->value : Criteria::ASC); } diff --git a/src/QueryBuilder.php b/src/QueryBuilder.php index d5d1863f0d..5a6a6e8db8 100644 --- a/src/QueryBuilder.php +++ b/src/QueryBuilder.php @@ -301,6 +301,7 @@ private function findRootAlias(string $alias, string $parentAlias): string } else { // Should never happen with correct joining order. Might be // thoughtful to throw exception instead. + // @phpstan-ignore method.deprecated $rootAlias = $this->getRootAlias(); } @@ -583,6 +584,7 @@ public function add(string $dqlPartName, string|object|array $dqlPart, bool $app $newDqlPart = []; foreach ($dqlPart as $k => $v) { + // @phpstan-ignore method.deprecated $k = is_numeric($k) ? $this->getRootAlias() : $k; $newDqlPart[$k] = $v; diff --git a/tests/Tests/TestInit.php b/tests/Tests/TestInit.php index eb2db60674..5b8ec4048f 100644 --- a/tests/Tests/TestInit.php +++ b/tests/Tests/TestInit.php @@ -16,9 +16,8 @@ use function mkdir; use const E_ALL; -use const E_STRICT; -error_reporting(E_ALL | E_STRICT); +error_reporting(E_ALL); date_default_timezone_set('UTC'); if (file_exists(__DIR__ . '/../../vendor/autoload.php')) {