Skip to content

Commit

Permalink
Address deprecations
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed May 7, 2022
1 parent 3f5a105 commit 72d88a2
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions lib/Doctrine/ORM/ORMInvalidArgumentException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,12 @@

namespace Doctrine\ORM;

use Doctrine\Deprecations\Deprecation;
use Doctrine\ORM\Mapping\ClassMetadata;
use InvalidArgumentException;
use Stringable;

use function array_map;
use function count;
use function func_get_arg;
use function func_num_args;
use function get_debug_type;
use function gettype;
use function implode;
Expand Down Expand Up @@ -200,26 +197,15 @@ public static function invalidCompositeIdentifier()
/**
* @return ORMInvalidArgumentException
*/
public static function invalidIdentifierBindingEntity(/* string $class */)
public static function invalidIdentifierBindingEntity(string $class)
{
if (func_num_args() === 0) {
Deprecation::trigger(
'doctrine/orm',
'https://github.com/doctrine/orm/pull/9642',
'Omitting the class name in the exception method %s is deprecated.',
__METHOD__
);

return new self('Binding entities to query parameters only allowed for entities that have an identifier.');
}

return new self(sprintf(
<<<'EXCEPTION'
Binding entities to query parameters only allowed for entities that have an identifier.
Class "%s" does not have an identifier.
EXCEPTION
,
func_get_arg(0)
$class
));
}

Expand Down

0 comments on commit 72d88a2

Please sign in to comment.