Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit262906b

Browse files
committed
throw when invalid
1 parent837013b commit262906b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

‎src/Symfony/Bridge/Doctrine/PropertyInfo/DoctrineExtractor.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,11 @@ public function __construct($entityManager)
3838
{
3939
if ($entityManagerinstanceof EntityManagerInterface) {
4040
$this->entityManager =$entityManager;
41-
}else {
41+
}elseif ($entityManagerinstanceof ClassMetadataFactory) {
4242
@trigger_error(sprintf('Injecting an instance of "%s" in "%s" is deprecated since Symfony 4.2, inject an instance of "%s" instead.', ClassMetadataFactory::class,__CLASS__, EntityManagerInterface::class),E_USER_DEPRECATED);
4343
$this->classMetadataFactory =$entityManager;
44+
}else {
45+
thrownew \InvalidArgumentException(sprintf('$entityManager must be an instance of "%s", "%s" given.', EntityManagerInterface::class,\is_object($entityManager) ?\get_class($entityManager) :\gettype($entityManager)));
4446
}
4547
}
4648

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp