1 | <?php |
||
16 | class AttributeMap |
||
17 | { |
||
18 | /** |
||
19 | * Attribute map |
||
20 | * |
||
21 | * @var Iterable |
||
22 | */ |
||
23 | protected $map = []; |
||
24 | |||
25 | |||
26 | /** |
||
27 | * Logger |
||
28 | * |
||
29 | * @var Logger |
||
30 | */ |
||
31 | protected $logger; |
||
32 | |||
33 | |||
34 | /** |
||
35 | * Initialize |
||
36 | * |
||
37 | * @param Iterable $map |
||
38 | * @param Logger $logger |
||
39 | * @return void |
||
|
|||
40 | */ |
||
41 | public function __construct(Iterable $map, Logger $logger) |
||
46 | |||
47 | |||
48 | /** |
||
49 | * Get attribute map |
||
50 | * |
||
51 | * @return Iterable |
||
52 | */ |
||
53 | public function getAttributeMap(): Iterable |
||
57 | |||
58 | |||
59 | /** |
||
60 | * Prepare attributes |
||
61 | * |
||
62 | * @param array $data |
||
63 | * @return array |
||
64 | */ |
||
65 | public function map(array $data): array |
||
117 | } |
||
118 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.