src/LightSaml/Model/Metadata/EntitiesDescriptor.php
public function containsItem($item)
    {
        if (false == $item instanceof self && false == $item instanceof EntityDescriptor) {
            throw new \InvalidArgumentException('Expected EntitiesDescriptor or EntityDescriptor');
        }
        foreach ($this->items as $i) {
            if ($i === $item) {
                return true;
            }
            if ($i instanceof self) {
                if ($i->containsItem($item)) {
                    return true;
                }
            }
        }

        return false;
    }
public function containsItem($item)
    {
        if (false == $item instanceof self && false == $item instanceof EntityDescriptor) {
            throw new \InvalidArgumentException('Expected EntitiesDescriptor or EntityDescriptor');
        }
        foreach ($this->items as $i) {
            if ($i === $item) {
                return true;
            }
            if ($i instanceof self) {
                if ($i->containsItem($item)) {
                    return true;
                }
            }
        }

        return false;
    }
@param EntitiesDescriptor|EntityDescriptor $item

@return bool

@throws \InvalidArgumentException