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