From d58ae2ecda56af05926150ad875bf0c4260ec7be Mon Sep 17 00:00:00 2001 From: Benjamin Eberlei Date: Fri, 4 Mar 2011 22:22:07 +0100 Subject: [PATCH] DDC-1056 - Fixed notice in StaticPHPDriver. --- .../ORM/Mapping/Driver/StaticPHPDriver.php | 40 +++++++++++++------ 1 file changed, 28 insertions(+), 12 deletions(-) diff --git a/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php b/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php index d89b1ed68..916113c1d 100644 --- a/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php +++ b/lib/Doctrine/ORM/Mapping/Driver/StaticPHPDriver.php @@ -1,7 +1,5 @@ - * @author Guilherme Blanco + * @author Benjamin Eberlei + * @author Guilherme Blanco * @author Jonathan H. Wage * @author Roman Borschel */ class StaticPHPDriver implements Driver { + /** + * Paths of entity directories. + * + * @var array + */ private $_paths = array(); + + /** + * Map of all class names. + * + * @var array + */ + private $_classNames; + + /** + * The file extension of mapping documents. + * + * @var string + */ + private $_fileExtension = '.php'; public function __construct($paths) { @@ -58,7 +74,7 @@ class StaticPHPDriver implements Driver { call_user_func_array(array($className, 'loadMetadata'), array($metadata)); } - + /** * {@inheritDoc} * @todo Same code exists in AnnotationDriver, should we re-use it somehow or not worry about it? @@ -77,13 +93,13 @@ class StaticPHPDriver implements Driver $includedFiles = array(); foreach ($this->_paths as $path) { - if ( ! is_dir($path)) { + if (!is_dir($path)) { throw MappingException::fileMappingDriversRequireConfiguredDirectoryPath($path); } $iterator = new \RecursiveIteratorIterator( - new \RecursiveDirectoryIterator($path), - \RecursiveIteratorIterator::LEAVES_ONLY + new \RecursiveDirectoryIterator($path), + \RecursiveIteratorIterator::LEAVES_ONLY ); foreach ($iterator as $file) { @@ -102,7 +118,7 @@ class StaticPHPDriver implements Driver foreach ($declared as $className) { $rc = new \ReflectionClass($className); $sourceFile = $rc->getFileName(); - if (in_array($sourceFile, $includedFiles) && ! $this->isTransient($className)) { + if (in_array($sourceFile, $includedFiles) && !$this->isTransient($className)) { $classes[] = $className; } } @@ -119,4 +135,4 @@ class StaticPHPDriver implements Driver { return method_exists($className, 'loadMetadata') ? false : true; } -} \ No newline at end of file +}