Skip to content

Commit aa7f893

Browse files
committed
Merge branch '4.3.x' into 5.0.x
2 parents a97d449 + e7e2615 commit aa7f893

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
@@ -68,6 +68,10 @@ all drivers and middleware.
6868

6969
# Upgrade to 4.3
7070

71+
## Deprecated `AbstractAsset::getShortestName()`
72+
73+
The `AbstractAsset::getShortestName()` method has been deprecated. Use `AbstractAsset::getName()` instead.
74+
7175
## Deprecated `Sequence::isAutoIncrementsFor()`
7276

7377
The `Sequence::isAutoIncrementsFor()` method has been deprecated.

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/6657
68+
TODO: remove in 5.0.0
69+
-->
70+
<referencedMethod name="Doctrine\DBAL\Schema\AbstractAsset::getShortestName" />
6571
</errorLevel>
6672
</DeprecatedMethod>
6773
<DocblockTypeContradiction>

src/Schema/AbstractAsset.php

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
use Doctrine\DBAL\Schema\Name\OptionallyQualifiedName;
1313
use Doctrine\DBAL\Schema\Name\Parser;
1414
use Doctrine\DBAL\Schema\Name\UnqualifiedName;
15+
use Doctrine\Deprecations\Deprecation;
1516

1617
use function array_map;
1718
use function assert;
@@ -160,9 +161,18 @@ public function getNamespaceName(): ?string
160161
/**
161162
* The shortest name is stripped of the default namespace. All other
162163
* namespaced elements are returned as full-qualified names.
164+
*
165+
* @deprecated Use {@link getName()} instead.
163166
*/
164167
public function getShortestName(?string $defaultNamespaceName): string
165168
{
169+
Deprecation::triggerIfCalledFromOutside(
170+
'doctrine/dbal',
171+
'https://github.com/doctrine/dbal/pull/6657',
172+
'%s is deprecated and will be removed in 5.0.',
173+
__METHOD__,
174+
);
175+
166176
$shortestName = $this->getName();
167177
if ($this->_namespace === $defaultNamespaceName) {
168178
$shortestName = $this->_name;

0 commit comments

Comments
 (0)