Skip to content

Commit

Permalink
Review
Browse files Browse the repository at this point in the history
  • Loading branch information
VincentLanglet committed Nov 1, 2021
1 parent 9cff7e0 commit d7bc09c
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 5 deletions.
6 changes: 5 additions & 1 deletion src/Adapter/ORM/DoctrineORMAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ public function getNormalizedIdentifier($model)
return null;
}

throw new \RuntimeException('Invalid argument, object required');
throw new \RuntimeException(sprintf(
'Argument 1 passed to "%s()" must be an object, %s given.',
__METHOD__,
\gettype($model)
));
}

$manager = $this->registry->getManagerForClass(\get_class($model));
Expand Down
6 changes: 5 additions & 1 deletion src/Adapter/PHPCR/DoctrinePHPCRAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,11 @@ public function getNormalizedIdentifier($model)
return null;
}

throw new \RuntimeException('Invalid argument, object required');
throw new \RuntimeException(sprintf(
'Argument 1 passed to "%s()" must be an object, %s given.',
__METHOD__,
\gettype($model)
));
}

$manager = $this->registry->getManagerForClass(\get_class($model));
Expand Down
2 changes: 1 addition & 1 deletion src/Document/BaseDocumentManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public function __get($name)
{
if ('dm' === $name) {
@trigger_error(
'Accessing to the entity manager with the magic getter is deprecated since'
'Accessing to the document manager through the magic getter is deprecated since'
.' sonata-project/sonata-doctrine-extensions 1.x and will throw an exception in 2.0.'
.' Use the "getObjectManager()" method instead.',
\E_USER_DEPRECATED
Expand Down
2 changes: 1 addition & 1 deletion src/Document/BasePHPCRManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function __get($name)
{
if ('dm' === $name) {
@trigger_error(
'Accessing to the entity manager with the magic getter is deprecated since'
'Accessing to the document manager through the magic getter is deprecated since'
.' sonata-project/sonata-doctrine-extensions 1.x and will throw an exception in 2.0.'
.' Use the "getObjectManager()" method instead.',
\E_USER_DEPRECATED
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/BaseEntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public function __get($name)
{
if ('em' === $name) {
@trigger_error(
'Accessing to the entity manager with the magic getter is deprecated since'
'Accessing to the entity manager through the magic getter is deprecated since'
.' sonata-project/sonata-doctrine-extensions 1.x and will throw an exception in 2.0.'
.' Use the "getObjectManager()" method instead.',
\E_USER_DEPRECATED
Expand Down

0 comments on commit d7bc09c

Please sign in to comment.