Permalink
Browse files

Cleaning up

  • Loading branch information...
1 parent 882b717 commit e0d5d3059122e1c7049f3f09200f233db7f313da @Ocramius Ocramius committed Oct 14, 2012
View
1 src/DoctrineORMModule/Module.php
@@ -30,7 +30,6 @@
use DoctrineORMModule\Service\SQLLoggerCollectorFactory;
use DoctrineORMModule\Form\Annotation\AnnotationBuilder;
-use Zend\ModuleManager\ModuleManagerInterface;
use Zend\ModuleManager\Feature\AutoloaderProviderInterface;
use Zend\ModuleManager\Feature\BootstrapListenerInterface;
use Zend\ModuleManager\Feature\ServiceProviderInterface;
View
23 src/DoctrineORMModule/Options/Configuration.php
@@ -403,24 +403,25 @@ public function getCustomHydrationModes()
/**
* @param string|null|NamingStrategy $namingStrategy
* @return self
+ * @throws InvalidArgumentException when the provided naming strategy does not fit the expected type
*/
public function setNamingStrategy($namingStrategy)
{
if (
- null !== $namingStrategy
- && !is_string($namingStrategy)
- && !$namingStrategy instanceof NamingStrategy
+ null === $namingStrategy
+ || is_string($namingStrategy)
+ || $namingStrategy instanceof NamingStrategy
) {
- throw new InvalidArgumentException(sprintf(
- 'namingStrategy must be either a string, a Doctrine\ORM\Mapping\NamingStrategy '
- . 'instance or null, %s given',
- is_object($namingStrategy) ? get_class($namingStrategy) : gettype($namingStrategy)
- ));
- }
+ $this->namingStrategy = $namingStrategy;
- $this->namingStrategy = $namingStrategy;
+ return $this;
+ }
- return $this;
+ throw new InvalidArgumentException(sprintf(
+ 'namingStrategy must be either a string, a Doctrine\ORM\Mapping\NamingStrategy '
+ . 'instance or null, %s given',
+ is_object($namingStrategy) ? get_class($namingStrategy) : gettype($namingStrategy)
+ ));
}
/**
View
1 src/DoctrineORMModule/Service/EntityResolverFactory.php
@@ -19,7 +19,6 @@
namespace DoctrineORMModule\Service;
-use Doctrine\ORM\EntityManager;
use Doctrine\ORM\Events;
use Doctrine\ORM\Tools\ResolveTargetEntityListener;
use DoctrineModule\Service\AbstractFactory;

0 comments on commit e0d5d30

Please sign in to comment.