/** * {@inheritdoc} */ public function hasBindingTypes(Expression $expr = null) { $this->assertPackagesLoaded(); if (!$expr) { return !$this->typeDescriptors->isEmpty(); } foreach ($this->typeDescriptors->toArray() as $typeName => $typesByPackage) { foreach ($typesByPackage as $type) { if ($type->match($expr)) { return true; } } } return false; }
/** * {@inheritdoc} */ public function hasTypeDescriptors(Expression $expr = null) { $this->assertModulesLoaded(); if (!$expr) { return !$this->typeDescriptors->isEmpty(); } foreach ($this->typeDescriptors->toArray() as $typeName => $descriptorsByModule) { foreach ($descriptorsByModule as $typeDescriptor) { if ($expr->evaluate($typeDescriptor)) { return true; } } } return false; }