Skip to content

Commit a46cbea

Browse files
authored
Merge pull request #6655 from doctrine/4.3.x
Merge 4.3.x up into 5.0.x
2 parents 4a99f86 + 582633f commit a46cbea

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

UPGRADE.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,10 @@ all drivers and middleware.
6464

6565
# Upgrade to 4.3
6666

67+
## Deprecated `Sequence::isAutoIncrementsFor()`
68+
69+
The `Sequence::isAutoIncrementsFor()` method has been deprecated.
70+
6771
## Deprecated using invalid database object names
6872

6973
Using the following objects with an empty name is deprecated: `Column`, `View`, `Sequence`, `Identifier`.

psalm.xml.dist

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,12 @@
6262
-->
6363
<referencedMethod name="Doctrine\DBAL\Schema\AbstractAsset::getNameParser" />
6464
<referencedMethod name="Doctrine\DBAL\Schema\AbstractAsset::setName" />
65+
66+
<!--
67+
https://github.com/doctrine/dbal/pull/6654
68+
TODO: remove in 5.0.0
69+
-->
70+
<referencedMethod name="Doctrine\DBAL\Schema\Sequence::isAutoIncrementsFor" />
6571
</errorLevel>
6672
</DeprecatedMethod>
6773
<DocblockTypeContradiction>

src/Schema/Sequence.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
use Doctrine\DBAL\Schema\Name\OptionallyQualifiedName;
88
use Doctrine\DBAL\Schema\Name\Parser\OptionallyQualifiedNameParser;
99
use Doctrine\DBAL\Schema\Name\Parsers;
10+
use Doctrine\Deprecations\Deprecation;
1011

1112
use function count;
1213
use function sprintf;
@@ -80,9 +81,18 @@ public function setCache(int $cache): self
8081
*
8182
* This is used inside the comparator to not report sequences as missing,
8283
* when the "from" schema implicitly creates the sequences.
84+
*
85+
* @deprecated
8386
*/
8487
public function isAutoIncrementsFor(Table $table): bool
8588
{
89+
Deprecation::triggerIfCalledFromOutside(
90+
'doctrine/dbal',
91+
'https://github.com/doctrine/dbal/pull/6654',
92+
'%s is deprecated and will be removed in 5.0.',
93+
__METHOD__,
94+
);
95+
8696
$primaryKey = $table->getPrimaryKey();
8797

8898
if ($primaryKey === null) {

0 commit comments

Comments
 (0)