1 | <?php |
||
2 | |||
3 | namespace App\Fixture; |
||
4 | |||
5 | use App\Entity\Role as RoleEntity; |
||
6 | use App\EventListener\Entity\Role\PropagationListener; |
||
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 ![]() |
|||
9 | |||
10 | /** |
||
11 | * Trait Role |
||
12 | */ |
||
13 | trait Role |
||
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 PropagationListener) { |
||
32 | $listener->setEnabled(false); |
||
33 | } else if (is_string($listener) && $listener === PropagationListener::class) { |
||
34 | $eventManager->removeEventListener(['postPersist'], $listener); |
||
35 | } |
||
36 | } |
||
37 | } |
||
38 | |||
39 | $objects = $this->parse($this->path); |
||
40 | |||
41 | foreach ($objects as $object) { |
||
42 | $role = new RoleEntity; |
||
43 | $role |
||
44 | ->setUuid($object->uuid) |
||
45 | ->setOwner($object->owner) |
||
46 | ->setOwnerUuid($object->owner_uuid) |
||
47 | ->setTitle((array) $object->title) |
||
48 | ->setSlug($object->slug) |
||
49 | ->setData((array) $object->data) |
||
50 | ->setPermissions((array) $object->permissions) |
||
51 | ->setTenant($object->tenant); |
||
52 | $manager->persist($role); |
||
53 | $this->setReference($object->uuid, $role); |
||
54 | } |
||
55 | |||
56 | $manager->flush(); |
||
57 | } |
||
58 | } |
||
59 |
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