1 | <?php |
||
19 | class MappingFluentSyntax |
||
20 | { |
||
21 | /** |
||
22 | * @var TypeMap |
||
23 | */ |
||
24 | private $typeMap; |
||
25 | |||
26 | public function __construct(TypeMap $typeMap) |
||
30 | |||
31 | /** |
||
32 | * Supply a custom instantiation function for the destination type |
||
33 | * |
||
34 | * @param ObjectCreatorInterface|\Closure $objectCreator Callback to create the destination type given the source object |
||
35 | * @throws PapperConfigurationException |
||
36 | * @return MappingFluentSyntax |
||
|
|||
37 | */ |
||
38 | public function constructUsing($objectCreator) |
||
48 | |||
49 | /** |
||
50 | * Customize configuration for individual member |
||
51 | * |
||
52 | * @param string $name Destination member name |
||
53 | * @param MemberOptionInterface|MemberOptionInterface[] $memberOptions Member option |
||
54 | * @throws PapperConfigurationException |
||
55 | * @return MappingFluentSyntax |
||
56 | */ |
||
57 | public function forMember($name, $memberOptions) |
||
72 | |||
73 | /** |
||
74 | * Create configuration for individual dynamic member |
||
75 | * |
||
76 | * @param string $name Destination member name |
||
77 | * @param MemberOptionInterface|MemberOptionInterface[] $memberOptions Member option |
||
78 | * @throws PapperConfigurationException |
||
79 | * @return MappingFluentSyntax |
||
80 | */ |
||
81 | public function forDynamicMember($name, $memberOptions = null) |
||
103 | |||
104 | /** |
||
105 | * Ignores all remaining unmapped members that do not exist on the destination. |
||
106 | * |
||
107 | * @return $this |
||
108 | */ |
||
109 | public function ignoreAllNonExisting() |
||
116 | |||
117 | /** |
||
118 | * Execute a custom closure function to the source and/or destination types before member mapping |
||
119 | * |
||
120 | * @param \Closure $func Callback for the source/destination types |
||
121 | * @return $this |
||
122 | */ |
||
123 | public function beforeMap(\Closure $func) |
||
128 | |||
129 | /** |
||
130 | * Execute a custom function to the source and/or destination types after member mapping |
||
131 | * |
||
132 | * @param \Closure $func Callback for the source/destination types |
||
133 | * @return $this |
||
134 | */ |
||
135 | public function afterMap(\Closure $func) |
||
140 | } |
||
141 |
This check compares the return type specified in the
@return
annotation of a function or method doc comment with the types returned by the function and raises an issue if they mismatch.