@@ 208-210 (lines=3) @@ | ||
205 | */ |
|
206 | public function addItem($item) |
|
207 | { |
|
208 | if (false == $item instanceof self && false == $item instanceof EntityDescriptor) { |
|
209 | throw new \InvalidArgumentException('Expected EntitiesDescriptor or EntityDescriptor'); |
|
210 | } |
|
211 | if ($item === $this) { |
|
212 | throw new \InvalidArgumentException('Circular reference detected'); |
|
213 | } |
|
@@ 233-235 (lines=3) @@ | ||
230 | */ |
|
231 | public function containsItem($item) |
|
232 | { |
|
233 | if (false == $item instanceof self && false == $item instanceof EntityDescriptor) { |
|
234 | throw new \InvalidArgumentException('Expected EntitiesDescriptor or EntityDescriptor'); |
|
235 | } |
|
236 | foreach ($this->items as $i) { |
|
237 | if ($i === $item) { |
|
238 | return true; |