Example #1
0
 /**
  * @throws ServiceDefinitionNotFound
  *
  * @param ServiceId $serviceId
  * @param DiConfig  $diConfig
  */
 private function checkServiceIsDefined(ServiceId $serviceId, DiConfig $diConfig)
 {
     if (!$diConfig->serviceIsDefined($serviceId)) {
         throw ServiceDefinitionNotFound::constructWithServiceId($serviceId);
     }
 }
Example #2
0
 /**
  * @throws ServiceDefinitionNotFound
  *
  * @param ServiceId $serviceId
  * @return string[]
  */
 public function getArguments(ServiceId $serviceId)
 {
     if (!$this->serviceIsDefined($serviceId)) {
         throw ServiceDefinitionNotFound::constructWithServiceId($serviceId);
     }
     return $this->definitions[(string) $serviceId]->getArguments();
 }