@@ 112-122 (lines=11) @@ | ||
109 | $elementTypeClass = new \ReflectionClass($elementType); |
|
110 | $this->class->addUse($elementType); |
|
111 | $getAtMethod = $reflectionClass->getMethod('getAt'); |
|
112 | if ($getAtMethod->getDeclaringClass()->getName() != $this->class->getClassName()) { |
|
113 | $this->class->addMagicMethod( |
|
114 | 'getAt', |
|
115 | ['$offset'], |
|
116 | $elementTypeClass->getShortName(), |
|
117 | null, |
|
118 | null, |
|
119 | false, |
|
120 | true |
|
121 | ); |
|
122 | } |
|
123 | $addMethod = $reflectionClass->getMethod('add'); |
|
124 | if ($addMethod->getDeclaringClass()->getName() != $this->class->getClassName()) { |
|
125 | $this->class->addMagicMethod( |
|
@@ 124-134 (lines=11) @@ | ||
121 | ); |
|
122 | } |
|
123 | $addMethod = $reflectionClass->getMethod('add'); |
|
124 | if ($addMethod->getDeclaringClass()->getName() != $this->class->getClassName()) { |
|
125 | $this->class->addMagicMethod( |
|
126 | 'add', |
|
127 | [$elementTypeClass->getShortName() . ' $element'], |
|
128 | $reflectionClass->getShortName(), |
|
129 | null, |
|
130 | null, |
|
131 | false, |
|
132 | true |
|
133 | ); |
|
134 | } |
|
135 | $current = $reflectionClass->getMethod('current'); |
|
136 | if ($current->getDeclaringClass()->getName() != $this->class->getClassName()) { |
|
137 | $this->class->addMagicMethod( |
|
@@ 136-146 (lines=11) @@ | ||
133 | ); |
|
134 | } |
|
135 | $current = $reflectionClass->getMethod('current'); |
|
136 | if ($current->getDeclaringClass()->getName() != $this->class->getClassName()) { |
|
137 | $this->class->addMagicMethod( |
|
138 | 'current', |
|
139 | [], |
|
140 | $elementTypeClass->getShortName(), |
|
141 | null, |
|
142 | null, |
|
143 | false, |
|
144 | true |
|
145 | ); |
|
146 | } |
|
147 | } |
|
148 | } |
|
149 | ||
@@ 164-175 (lines=12) @@ | ||
161 | $resultClassReflection = new \ReflectionClass($resultClass); |
|
162 | $this->class->addUse($resultClass); |
|
163 | $mapResponseMethod = $reflectionClass->getMethod('mapResponse'); |
|
164 | if ($mapResponseMethod->getDeclaringClass()->getName() != $this->class->getClassName()) { |
|
165 | $this->class->addUse('\Commercetools\Core\Response\ApiResponseInterface'); |
|
166 | $this->class->addMagicMethod( |
|
167 | 'mapResponse', |
|
168 | ['ApiResponseInterface $response'], |
|
169 | $resultClassReflection->getShortName(), |
|
170 | null, |
|
171 | null, |
|
172 | false, |
|
173 | true |
|
174 | ); |
|
175 | } |
|
176 | } |
|
177 | ||
178 | /** |