DigitalState /
Authentication
| 1 | <?php |
||
| 2 | |||
| 3 | namespace App\Fixture; |
||
| 4 | |||
| 5 | use App\Entity\Registration as RegistrationEntity; |
||
| 6 | use App\EventListener\Entity\Registration\UserListener; |
||
| 7 | use Doctrine\Common\Persistence\ObjectManager; |
||
|
0 ignored issues
–
show
|
|||
| 8 | use Ds\Component\Database\Fixture\Yaml; |
||
|
0 ignored issues
–
show
The type
Ds\Component\Database\Fixture\Yaml 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...
|
|||
| 9 | |||
| 10 | /** |
||
| 11 | * Trait Registration |
||
| 12 | */ |
||
| 13 | trait Registration |
||
| 14 | { |
||
| 15 | use Yaml; |
||
| 16 | |||
| 17 | /** |
||
| 18 | * @var string |
||
| 19 | */ |
||
| 20 | private $path; |
||
| 21 | |||
| 22 | /** |
||
| 23 | * {@inheritdoc} |
||
| 24 | */ |
||
| 25 | public function load(ObjectManager $manager) |
||
| 26 | { |
||
| 27 | $eventManager = $manager->getEventManager(); |
||
| 28 | |||
| 29 | foreach ($eventManager->getListeners() as $event => $listeners) { |
||
| 30 | foreach ($listeners as $key => $listener) { |
||
| 31 | if (is_object($listener) && $listener instanceof UserListener) { |
||
| 32 | $listener->setEnabled(false); |
||
| 33 | } else if (is_string($listener) && $listener === UserListener::class) { |
||
| 34 | $eventManager->removeEventListener(['postPersist'], $listener); |
||
| 35 | } |
||
| 36 | } |
||
| 37 | } |
||
| 38 | |||
| 39 | $objects = $this->parse($this->path); |
||
| 40 | |||
| 41 | foreach ($objects as $object) { |
||
| 42 | $registration = new RegistrationEntity; |
||
| 43 | $registration |
||
| 44 | ->setUuid($object->uuid) |
||
| 45 | ->setOwner($object->owner) |
||
| 46 | ->setOwnerUuid($object->owner_uuid) |
||
| 47 | ->setUsername($object->username) |
||
| 48 | ->setPassword($object->password) |
||
| 49 | ->setData($object->data) |
||
| 50 | ->setTenant($object->tenant); |
||
| 51 | $manager->persist($registration); |
||
| 52 | } |
||
| 53 | |||
| 54 | $manager->flush(); |
||
| 55 | } |
||
| 56 | } |
||
| 57 |
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