/** * Save all the loaded classes to the configured output dir * * @throws Exception If no service is loaded */ protected function savePhp() { $factory = new FilterFactory(); $filter = $factory->create($this->config); $filteredService = $filter->filter($this->service); $service = $filteredService->getClass(); $filteredTypes = $filteredService->getTypes(); if ($service == null) { throw new Exception('No service loaded'); } $output = new OutputManager($this->config); // Generate all type classes $types = array(); foreach ($filteredTypes as $type) { $class = $type->getClass(); if ($class != null) { $types[] = $class; } } $output->save($service, $types); }
/** * Save all the loaded classes to the configured output dir * * @throws Exception If no service is loaded */ private function savePhp() { $service = $this->service->getClass(); if ($service == null) { throw new Exception('No service loaded'); } $output = new OutputManager($this->config); // Generate all type classes $types = array(); foreach ($this->types as $type) { $class = $type->getClass(); if ($class != null) { $types[] = $class; if (!$this->config->getOneFile() && !$this->config->getNoIncludes()) { $service->addDependency($class->getIdentifier() . '.php'); } } } $output->save($service, $types); }