ControleOnline /
api-platform-common
| 1 | <?php |
||
| 2 | |||
| 3 | namespace ControleOnline\Service; |
||
| 4 | |||
| 5 | use ControleOnline\Entity\User; |
||
|
0 ignored issues
–
show
|
|||
| 6 | use Doctrine\ORM\EntityManagerInterface; |
||
|
0 ignored issues
–
show
The type
Doctrine\ORM\EntityManagerInterface was not found. Maybe you did not declare it correctly or list all dependencies?
The issue could also be caused by a filter entry in the build configuration.
If the path has been excluded in your configuration, e.g. filter:
dependency_paths: ["lib/*"]
For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths Loading history...
|
|||
| 7 | |||
| 8 | class SkyNetService |
||
| 9 | { |
||
| 10 | |||
| 11 | private static ?User $botUser = null; |
||
| 12 | |||
| 13 | public function __construct( |
||
| 14 | private EntityManagerInterface $manager, |
||
| 15 | private DomainService $domainService, |
||
| 16 | ) {} |
||
| 17 | |||
| 18 | public function discoveryBotUser(): void |
||
| 19 | { |
||
| 20 | if (!self::$botUser) |
||
| 21 | $bots = ['R2D2', 'C3PO', 'T800', 'SkyNet']; |
||
| 22 | |||
| 23 | $online = array_rand($bots); |
||
|
0 ignored issues
–
show
Comprehensibility
Best Practice
introduced
by
|
|||
| 24 | $bot = $bots[$online]; |
||
| 25 | self::$botUser = $this->manager->getRepository(User::class)->findOneBy(['username' => $bot]); |
||
| 26 | if (!self::$botUser) { |
||
| 27 | self::$botUser = new User(); |
||
| 28 | self::$botUser->setUserName($bot); |
||
| 29 | self::$botUser->setHash('872844840.0'); |
||
| 30 | self::$botUser->setPeople($this->domainService->getPeopleDomain()->getPeople()); |
||
| 31 | $this->manager->persist(self::$botUser); |
||
| 32 | $this->manager->flush(); |
||
| 33 | } |
||
| 34 | } |
||
| 35 | public function getBotUser(): ?User |
||
| 36 | { |
||
| 37 | return self::$botUser; |
||
| 38 | } |
||
| 39 | } |
||
| 40 |
The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g.
excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths