Permalink
Browse files

Updating the ClassMapBuild implementation.

  • Loading branch information...
1 parent c6ac2b0 commit 5ef455ff012759f62a8cc707da32353aad2bf86d @zyxist zyxist committed Jun 30, 2011
Showing with 6 additions and 16 deletions.
  1. +6 −16 src/Opl/Autoloader/Command/ClassMapBuild.php
View
22 src/Opl/Autoloader/Command/ClassMapBuild.php
@@ -109,25 +109,15 @@ protected function execute(InputInterface $input, OutputInterface $output)
$this->_builder = new ClassMapBuilder();
foreach($data['namespaces'] as $name => $path)
{
- $this->_processSingleNamespace($output, $name, $path, $extension);
+ $this->_builder->addNamespace($name, $path, $extension);
}
- file_put_contents($outputFile, serialize($this->_builder->getMap()));
- $output->writeln('<info>Map saved as:</info> '.$outputFile);
- } // end execute();
-
- /**
- * Processes a single top-level namespace.
- *
- * @param string $name
- * @param string $path
- */
- protected function _processSingleNamespace(OutputInterface $output, $namespaceName, $path, $extension)
- {
- $errors = $this->_builder->addNamespace($namespaceName, $path, $extension);
-
+ $errors = $this->_builder->buildMap();
foreach($errors as $error)
{
$output->writeln(preg_replace('/^(([^\:]+)\:) (.*)$/', '<error>$1</error> $3', $error));
}
- } // end _processSingleNamespace();
+
+ file_put_contents($outputFile, serialize($this->_builder->getMap()));
+ $output->writeln('<info>Map saved as:</info> '.$outputFile);
+ } // end execute();
} // end ClassMapBuild;

0 comments on commit 5ef455f

Please sign in to comment.