1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
/* |
6
|
|
|
* This file is part of the G.L.S.R. Apps package. |
7
|
|
|
* |
8
|
|
|
* (c) Dev-Int Création <[email protected]>. |
9
|
|
|
* |
10
|
|
|
* For the full copyright and license information, please view the LICENSE |
11
|
|
|
* file that was distributed with this source code. |
12
|
|
|
*/ |
13
|
|
|
|
14
|
|
|
namespace Administration\Infrastructure\Supplier\Serializer\Handler; |
15
|
|
|
|
16
|
|
|
use Administration\Application\Supplier\ReadModel\Supplier as SupplierReadModel; |
17
|
|
|
use JMS\Serializer\GraphNavigator; |
|
|
|
|
18
|
|
|
use JMS\Serializer\Handler\SubscribingHandlerInterface; |
|
|
|
|
19
|
|
|
use JMS\Serializer\JsonSerializationVisitor; |
|
|
|
|
20
|
|
|
|
21
|
|
|
class SupplierHandler implements SubscribingHandlerInterface |
22
|
|
|
{ |
23
|
|
|
public static function getSubscribingMethods(): array |
24
|
|
|
{ |
25
|
|
|
return [ |
26
|
|
|
[ |
27
|
|
|
'direction' => GraphNavigator::DIRECTION_SERIALIZATION, |
28
|
|
|
'format' => 'json', |
29
|
|
|
'type' => SupplierReadModel::class, |
30
|
|
|
'method' => 'serialize', |
31
|
|
|
], |
32
|
|
|
[ |
33
|
|
|
'direction' => GraphNavigator::DIRECTION_DESERIALIZATION, |
34
|
|
|
'format' => 'json', |
35
|
|
|
'type' => SupplierReadModel::class, |
36
|
|
|
'method' => 'deserialize', |
37
|
|
|
], |
38
|
|
|
]; |
39
|
|
|
} |
40
|
|
|
|
41
|
|
|
public function serialize( |
42
|
|
|
JsonSerializationVisitor $visitor, |
43
|
|
|
SupplierReadModel $supplier, |
44
|
|
|
array $type |
45
|
|
|
): array { |
46
|
|
|
$data = [ |
47
|
|
|
'uuid' => $supplier->uuid, |
48
|
|
|
'name' => $supplier->name, |
49
|
|
|
'fullAddress' => $supplier->fullAddress(), |
50
|
|
|
'address' => $supplier->address, |
51
|
|
|
'zipCode' => $supplier->zipCode, |
52
|
|
|
'town' => $supplier->town, |
53
|
|
|
'country' => $supplier->country, |
54
|
|
|
'phone' => $supplier->phone, |
55
|
|
|
'facsimile' => $supplier->facsimile, |
56
|
|
|
'email' => $supplier->email, |
57
|
|
|
'contactName' => $supplier->contact, |
58
|
|
|
'cellPhone' => $supplier->cellphone, |
59
|
|
|
'familyLog' => $supplier->familyLog, |
60
|
|
|
'familyLogId' => $supplier->familyLogId, |
61
|
|
|
'delayDelivery' => $supplier->delayDelivery, |
62
|
|
|
'orderDays' => $supplier->orderDays, |
63
|
|
|
'active' => $supplier->active, |
64
|
|
|
]; |
65
|
|
|
|
66
|
|
|
return $visitor->visitArray($data, $type); |
67
|
|
|
} |
68
|
|
|
} |
69
|
|
|
|
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