Skip to content

Commit

Permalink
Merge branch '4.3.x' into 5.0.x
Browse files Browse the repository at this point in the history
  • Loading branch information
morozov committed Dec 21, 2024
2 parents a97d449 + e7e2615 commit aa7f893
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 0 deletions.
4 changes: 4 additions & 0 deletions UPGRADE.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ all drivers and middleware.

# Upgrade to 4.3

## Deprecated `AbstractAsset::getShortestName()`

The `AbstractAsset::getShortestName()` method has been deprecated. Use `AbstractAsset::getName()` instead.

## Deprecated `Sequence::isAutoIncrementsFor()`

The `Sequence::isAutoIncrementsFor()` method has been deprecated.
Expand Down
6 changes: 6 additions & 0 deletions psalm.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@
-->
<referencedMethod name="Doctrine\DBAL\Schema\AbstractAsset::getNameParser" />
<referencedMethod name="Doctrine\DBAL\Schema\AbstractAsset::setName" />

<!--
https://github.com/doctrine/dbal/pull/6657
TODO: remove in 5.0.0
-->
<referencedMethod name="Doctrine\DBAL\Schema\AbstractAsset::getShortestName" />
</errorLevel>
</DeprecatedMethod>
<DocblockTypeContradiction>
Expand Down
10 changes: 10 additions & 0 deletions src/Schema/AbstractAsset.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
use Doctrine\DBAL\Schema\Name\OptionallyQualifiedName;
use Doctrine\DBAL\Schema\Name\Parser;
use Doctrine\DBAL\Schema\Name\UnqualifiedName;
use Doctrine\Deprecations\Deprecation;

use function array_map;
use function assert;
Expand Down Expand Up @@ -160,9 +161,18 @@ public function getNamespaceName(): ?string
/**
* The shortest name is stripped of the default namespace. All other
* namespaced elements are returned as full-qualified names.
*
* @deprecated Use {@link getName()} instead.
*/
public function getShortestName(?string $defaultNamespaceName): string
{
Deprecation::triggerIfCalledFromOutside(
'doctrine/dbal',
'https://github.com/doctrine/dbal/pull/6657',
'%s is deprecated and will be removed in 5.0.',
__METHOD__,
);

$shortestName = $this->getName();
if ($this->_namespace === $defaultNamespaceName) {
$shortestName = $this->_name;
Expand Down

0 comments on commit aa7f893

Please sign in to comment.