Skip to content

Commit 9cf5593

Browse files
committed
Merge branch '3.3.x' into 4.0.x
* 3.3.x: Stop recommending vendor-prefixed PHPDoc (doctrine#11640) Let PHPStan detect deprecated usages (doctrine#11639) PHPStan 1.12.6 (doctrine#11635) Add upgrade note about property hooks (doctrine#11636) Prepare PHP 8.4 support: Prevent property hooks from being used (doctrine#11628) Use E_ALL instead of E_ALL | E_STRICT Add CI job for PHP 8.4 fix generating duplicate method stubs
2 parents b5c0e01 + 3079555 commit 9cf5593

File tree

8 files changed

+32
-11
lines changed

8 files changed

+32
-11
lines changed

.github/workflows/continuous-integration.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ jobs:
3636
- "8.1"
3737
- "8.2"
3838
- "8.3"
39+
- "8.4"
3940
dbal-version:
4041
- "default"
4142
extension:
@@ -106,6 +107,7 @@ jobs:
106107
php-version:
107108
- "8.2"
108109
- "8.3"
110+
- "8.4"
109111
dbal-version:
110112
- "default"
111113
postgres-version:
@@ -178,6 +180,7 @@ jobs:
178180
php-version:
179181
- "8.2"
180182
- "8.3"
183+
- "8.4"
181184
dbal-version:
182185
- "default"
183186
- "4@dev"
@@ -243,6 +246,7 @@ jobs:
243246
php-version:
244247
- "8.2"
245248
- "8.3"
249+
- "8.4"
246250
dbal-version:
247251
- "default"
248252
mysql-version:

UPGRADE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -783,6 +783,14 @@ Use `toIterable()` instead.
783783

784784
# Upgrade to 2.20
785785

786+
## Explictly forbid property hooks
787+
788+
Property hooks are not supported yet by Doctrine ORM. Until support is added,
789+
they are explicitly forbidden because the support would result in a breaking
790+
change in behavior.
791+
792+
Progress on this is tracked at https://github.com/doctrine/orm/issues/11624 .
793+
786794
## PARTIAL DQL syntax is undeprecated for non-object hydration
787795

788796
Use of the PARTIAL keyword is not deprecated anymore in DQL when used with a hydrator

composer.json

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@
1515
"config": {
1616
"allow-plugins": {
1717
"composer/package-versions-deprecated": true,
18-
"dealerdirect/phpcodesniffer-composer-installer": true
18+
"dealerdirect/phpcodesniffer-composer-installer": true,
19+
"phpstan/extension-installer": true
1920
},
2021
"sort-packages": true
2122
},
@@ -39,7 +40,9 @@
3940
"doctrine/coding-standard": "^12.0",
4041
"phpbench/phpbench": "^1.0",
4142
"phpdocumentor/guides-cli": "^1.4",
42-
"phpstan/phpstan": "1.12.0",
43+
"phpstan/extension-installer": "^1.4",
44+
"phpstan/phpstan": "1.12.6",
45+
"phpstan/phpstan-deprecation-rules": "^1.2",
4346
"phpunit/phpunit": "^10.4.0",
4447
"psr/log": "^1 || ^2 || ^3",
4548
"squizlabs/php_codesniffer": "3.7.2",

docs/en/reference/metadata-drivers.rst

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ implements the ``MappingDriver`` interface:
7070
/**
7171
* Loads the metadata for the specified class into the provided container.
7272
*
73-
* @psalm-param class-string<T> $className
74-
* @psalm-param ClassMetadata<T> $metadata
73+
* @param class-string<T> $className
74+
* @param ClassMetadata<T> $metadata
7575
*
7676
* @return void
7777
*
@@ -82,16 +82,15 @@ implements the ``MappingDriver`` interface:
8282
/**
8383
* Gets the names of all mapped classes known to this driver.
8484
*
85-
* @return array<int, string> The names of all mapped classes known to this driver.
86-
* @psalm-return list<class-string>
85+
* @return list<class-string> The names of all mapped classes known to this driver.
8786
*/
8887
public function getAllClassNames();
8988
9089
/**
9190
* Returns whether the class with the specified name should have its metadata loaded.
9291
* This is only the case if it is either mapped as an Entity or a MappedSuperclass.
9392
*
94-
* @psalm-param class-string $className
93+
* @param class-string $className
9594
*
9695
* @return bool
9796
*/

src/Mapping/ClassMetadata.php

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1038,6 +1038,7 @@ public function isNullable(string $fieldName): bool
10381038
*/
10391039
public function getColumnName(string $fieldName): string
10401040
{
1041+
// @phpstan-ignore property.deprecated
10411042
return $this->columnNames[$fieldName] ?? $fieldName;
10421043
}
10431044

@@ -1187,6 +1188,7 @@ protected function validateAndCompleteFieldMapping(array $mapping): FieldMapping
11871188
$mapping->quoted = true;
11881189
}
11891190

1191+
// @phpstan-ignore property.deprecated
11901192
$this->columnNames[$mapping->fieldName] = $mapping->columnName;
11911193

11921194
if (isset($this->fieldNames[$mapping->columnName]) || ($this->discriminatorColumn && $this->discriminatorColumn->name === $mapping->columnName)) {
@@ -1767,6 +1769,7 @@ public function setAttributeOverride(string $fieldName, array $overrideMapping):
17671769

17681770
unset($this->fieldMappings[$fieldName]);
17691771
unset($this->fieldNames[$mapping->columnName]);
1772+
// @phpstan-ignore property.deprecated
17701773
unset($this->columnNames[$mapping->fieldName]);
17711774

17721775
$overrideMapping = $this->validateAndCompleteFieldMapping($overrideMapping);
@@ -1917,8 +1920,9 @@ public function addInheritedAssociationMapping(AssociationMapping $mapping/*, $o
19171920
public function addInheritedFieldMapping(FieldMapping $fieldMapping): void
19181921
{
19191922
$this->fieldMappings[$fieldMapping->fieldName] = $fieldMapping;
1920-
$this->columnNames[$fieldMapping->fieldName] = $fieldMapping->columnName;
1921-
$this->fieldNames[$fieldMapping->columnName] = $fieldMapping->fieldName;
1923+
// @phpstan-ignore property.deprecated
1924+
$this->columnNames[$fieldMapping->fieldName] = $fieldMapping->columnName;
1925+
$this->fieldNames[$fieldMapping->columnName] = $fieldMapping->fieldName;
19221926

19231927
if (isset($fieldMapping->generated)) {
19241928
$this->requiresFetchAfterChange = true;

src/Mapping/Driver/XmlDriver.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -411,6 +411,7 @@ public function loadMetadataForClass($className, PersistenceClassMetadata $metad
411411
/** @psalm-suppress DeprecatedConstant */
412412
$orderBy[(string) $orderByField['name']] = isset($orderByField['direction'])
413413
? (string) $orderByField['direction']
414+
// @phpstan-ignore classConstant.deprecated
414415
: (enum_exists(Order::class) ? Order::Ascending->value : Criteria::ASC);
415416
}
416417

@@ -540,6 +541,7 @@ public function loadMetadataForClass($className, PersistenceClassMetadata $metad
540541
/** @psalm-suppress DeprecatedConstant */
541542
$orderBy[(string) $orderByField['name']] = isset($orderByField['direction'])
542543
? (string) $orderByField['direction']
544+
// @phpstan-ignore classConstant.deprecated
543545
: (enum_exists(Order::class) ? Order::Ascending->value : Criteria::ASC);
544546
}
545547

src/QueryBuilder.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -301,6 +301,7 @@ private function findRootAlias(string $alias, string $parentAlias): string
301301
} else {
302302
// Should never happen with correct joining order. Might be
303303
// thoughtful to throw exception instead.
304+
// @phpstan-ignore method.deprecated
304305
$rootAlias = $this->getRootAlias();
305306
}
306307

@@ -583,6 +584,7 @@ public function add(string $dqlPartName, string|object|array $dqlPart, bool $app
583584
$newDqlPart = [];
584585

585586
foreach ($dqlPart as $k => $v) {
587+
// @phpstan-ignore method.deprecated
586588
$k = is_numeric($k) ? $this->getRootAlias() : $k;
587589

588590
$newDqlPart[$k] = $v;

tests/Tests/TestInit.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,8 @@
1616
use function mkdir;
1717

1818
use const E_ALL;
19-
use const E_STRICT;
2019

21-
error_reporting(E_ALL | E_STRICT);
20+
error_reporting(E_ALL);
2221
date_default_timezone_set('UTC');
2322

2423
if (file_exists(__DIR__ . '/../../vendor/autoload.php')) {

0 commit comments

Comments
 (0)