objectManager = $objectManager; } /** * Create specification instance * * @param string $specificationClass * @return SpecificationInterface * @throws \InvalidArgumentException */ public function create($specificationClass) { $specification = $this->objectManager->get($specificationClass); if (!$specification instanceof SpecificationInterface) { throw new \InvalidArgumentException('Specification must implement SpecificationInterface'); } return $specification; } }