Exemplo n.º 1
0
 /**
  * @param Configuration   $configuration
  * @param OutputInterface $output
  */
 protected function includeLoaders(Configuration $configuration, OutputInterface $output)
 {
     $this->typeCheck->includeLoaders(func_get_args());
     $output->writeln('<info>Including loaders...</info>');
     foreach ($configuration->loaderPaths() as $path) {
         $output->writeln(sprintf('  - %s', $path));
         $this->isolator->require($path);
     }
 }
Exemplo n.º 2
0
 /**
  * @param Configuration $configuration
  *
  * @return AnalysisResult
  */
 public function analyze(Configuration $configuration)
 {
     $this->typeCheck->analyze(func_get_args());
     $facadeClassName = $configuration->validatorNamespace()->joinAtoms('TypeCheck');
     $sourcePaths = $configuration->sourcePaths();
     $issues = array();
     foreach ($this->classMapper()->classesByPaths($sourcePaths) as $classDefinition) {
         $this->analyzeClass($configuration, $classDefinition, $facadeClassName, $issues);
     }
     return new AnalysisResult($issues);
 }
 /**
  * @param Configuration $configuration
  * @param ClassName     $className
  *
  * @return string
  */
 protected function outputPath(Configuration $configuration, ClassName $className)
 {
     $this->typeCheck->outputPath(func_get_args());
     return sprintf('%s%s', $configuration->outputPath(), $this->PSRPath($className));
 }
Exemplo n.º 4
0
 /**
  * @param mixed $data
  *
  * @return Configuration
  */
 protected function buildConfiguration($data)
 {
     $this->typeCheck->buildConfiguration(func_get_args());
     $this->validateData($data);
     $configuration = new Configuration($data->{'output-path'}, $data->{'source-paths'});
     if (property_exists($data, ConfigurationOption::LOADER_PATHS()->value())) {
         $configuration->setLoaderPaths($data->{'loader-paths'});
     }
     if (property_exists($data, ConfigurationOption::VALIDATOR_NAMESPACE()->value())) {
         $configuration->setValidatorNamespace(ClassName::fromString($data->{'validator-namespace'}));
     }
     if (property_exists($data, ConfigurationOption::USE_NATIVE_CALLABLE()->value())) {
         $configuration->setUseNativeCallable($data->{'use-native-callable'});
     }
     return $configuration;
 }