Skip to content

Commit 7148052

Browse files
committed
Phpstan: fixes
1 parent e3e458c commit 7148052

File tree

3 files changed

+8
-13
lines changed

3 files changed

+8
-13
lines changed

phpstan.neon

+1-4
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,7 @@ includes:
66

77
parameters:
88
level: 9
9-
phpVersion: 70200
9+
phpVersion: 70400
1010

1111
paths:
1212
- src
13-
14-
ignoreErrors:
15-
- '#Fetching class constant .+ of deprecated class Doctrine\\\w+.+#'

src/EntityManagerDecorator.php

+4-6
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,11 @@ public function __construct(EntityManagerInterface $wrapped)
1515
}
1616

1717
/**
18-
* {@inheritdoc}
19-
*
20-
* @psalm-param class-string<T> $className
21-
* @psalm-return EntityRepository<T>
22-
* @template T
18+
* @template T of object
19+
* @param class-string<T> $className
20+
* @return EntityRepository<T>
2321
*/
24-
public function getRepository($className)
22+
public function getRepository($className): EntityRepository
2523
{
2624
return $this->wrapped->getRepository($className);
2725
}

src/ManagerRegistry.php

+3-3
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,10 @@
44

55
use Doctrine\DBAL\Connection;
66
use Doctrine\ORM\EntityManagerInterface;
7-
use Doctrine\ORM\ORMException;
8-
use Doctrine\ORM\Proxy\Proxy;
7+
use Doctrine\ORM\Exception\ORMException;
98
use Doctrine\Persistence\AbstractManagerRegistry;
109
use Doctrine\Persistence\ObjectManager;
10+
use Doctrine\Persistence\Proxy;
1111
use Nette\DI\Container;
1212

1313
class ManagerRegistry extends AbstractManagerRegistry
@@ -66,7 +66,7 @@ public function getAliasNamespace($alias): string
6666
}
6767
}
6868

69-
throw ORMException::unknownEntityNamespace($alias);
69+
throw new ORMException(sprintf('Unknown Entity namespace alias "%s"', $alias));
7070
}
7171

7272
}

0 commit comments

Comments
 (0)