Skip to content

Commit

Permalink
Move exceptions in an Exception sub-namespace
Browse files Browse the repository at this point in the history
  • Loading branch information
greg0ire committed Apr 12, 2018
1 parent 46d342d commit 28e7e53
Show file tree
Hide file tree
Showing 65 changed files with 128 additions and 111 deletions.
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/AbstractQuery.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Doctrine\Common\Collections\Collection;
use Doctrine\DBAL\Cache\QueryCacheProfile;
use Doctrine\DBAL\Driver\Statement;
use Doctrine\ORM\Cache\InvalidResultCacheDriver;
use Doctrine\ORM\Cache\Exception\InvalidResultCacheDriver;
use Doctrine\ORM\Cache\Logging\CacheLogger;
use Doctrine\ORM\Cache\QueryCacheKey;
use Doctrine\ORM\Cache\TimestampCacheKey;
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/Cache/DefaultQueryCache.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
namespace Doctrine\ORM\Cache;

use Doctrine\ORM\Cache;
use Doctrine\ORM\Cache\FeatureNotImplemented;
use Doctrine\ORM\Cache\Exception\FeatureNotImplemented;
use Doctrine\ORM\Cache\Logging\CacheLogger;
use Doctrine\ORM\Cache\NonCacheableEntity;
use Doctrine\ORM\Cache\Exception\NonCacheableEntity;
use Doctrine\ORM\Cache\Persister\CachedPersister;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Mapping\AssociationMetadata;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\ORM\Cache;
namespace Doctrine\ORM\Cache\Exception;

use Doctrine\ORM\ORMException;
use function sprintf;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\ORM\Cache;
namespace Doctrine\ORM\Cache\Exception;

class CannotUpdateReadOnlyCollection extends \Exception implements CacheException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\ORM\Cache;
namespace Doctrine\ORM\Cache\Exception;

class CannotUpdateReadOnlyEntity extends \Exception implements CacheException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\ORM\Cache;
namespace Doctrine\ORM\Cache\Exception;

class FeatureNotImplemented extends \Exception implements CacheException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\ORM\Cache;
namespace Doctrine\ORM\Cache\Exception;

final class InvalidResultCacheDriver extends \Exception implements CacheException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\ORM\Cache;
namespace Doctrine\ORM\Cache\Exception;

final class MetadataCacheNotConfigured extends \Exception implements CacheException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\ORM\Cache;
namespace Doctrine\ORM\Cache\Exception;

use Doctrine\Common\Cache\Cache;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\ORM\Cache;
namespace Doctrine\ORM\Cache\Exception;

class NonCacheableEntity extends \Exception implements CacheException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\ORM\Cache;
namespace Doctrine\ORM\Cache\Exception;

class NonCacheableEntityAssociation extends \Exception implements CacheException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\ORM\Cache;
namespace Doctrine\ORM\Cache\Exception;

final class QueryCacheNotConfigured extends \Exception implements CacheException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\ORM\Cache;
namespace Doctrine\ORM\Cache\Exception;

use Doctrine\Common\Cache\Cache;

Expand Down
4 changes: 3 additions & 1 deletion lib/Doctrine/ORM/Cache/LockException.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

namespace Doctrine\ORM\Cache;

use Doctrine\ORM\Cache\Exception\CacheException;

/**
* Lock exception for cache.
*/
class LockException implements CacheException
class LockException extends \RuntimeException implements CacheException
{
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Doctrine\ORM\Cache\Persister\Collection;

use Doctrine\ORM\Cache\CannotUpdateReadOnlyCollection;
use Doctrine\ORM\Cache\Exception\CannotUpdateReadOnlyCollection;
use Doctrine\ORM\PersistentCollection;
use Doctrine\ORM\Utility\StaticClassNameConverter;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

namespace Doctrine\ORM\Cache\Persister\Entity;

use Doctrine\ORM\Cache\CannotUpdateReadOnlyEntity;
use Doctrine\ORM\Cache\Exception\CannotUpdateReadOnlyEntity;
use Doctrine\ORM\Utility\StaticClassNameConverter;

/**
Expand Down
12 changes: 6 additions & 6 deletions lib/Doctrine/ORM/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@
use Doctrine\Common\Persistence\ObjectRepository;
use Doctrine\DBAL\Configuration as DBALConfiguration;
use Doctrine\ORM\Cache\CacheConfiguration;
use Doctrine\ORM\Cache\MetadataCacheNotConfigured;
use Doctrine\ORM\Cache\MetadataCacheUsesNonPersistentCache;
use Doctrine\ORM\Cache\QueryCacheNotConfigured;
use Doctrine\ORM\Cache\QueryCacheUsesNonPersistentCache;
use Doctrine\ORM\Configuration\InvalidEntityRepository;
use Doctrine\ORM\Configuration\ProxyClassesAlwaysRegenerating;
use Doctrine\ORM\Cache\Exception\MetadataCacheNotConfigured;
use Doctrine\ORM\Cache\Exception\MetadataCacheUsesNonPersistentCache;
use Doctrine\ORM\Cache\Exception\QueryCacheNotConfigured;
use Doctrine\ORM\Cache\Exception\QueryCacheUsesNonPersistentCache;
use Doctrine\ORM\Exception\InvalidEntityRepository;
use Doctrine\ORM\Exception\ProxyClassesAlwaysRegenerating;
use Doctrine\ORM\Mapping\ClassMetadataFactory;
use Doctrine\ORM\Mapping\DefaultEntityListenerResolver;
use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
Expand Down
12 changes: 6 additions & 6 deletions lib/Doctrine/ORM/EntityManager.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@
use Doctrine\DBAL\Connection;
use Doctrine\DBAL\DriverManager;
use Doctrine\DBAL\LockMode;
use Doctrine\ORM\EntityManager\EntityManagerClosed;
use Doctrine\ORM\EntityManager\InvalidHydrationMode;
use Doctrine\ORM\EntityManager\MismatchedEventManager;
use Doctrine\ORM\EntityManager\MissingIdentifierField;
use Doctrine\ORM\EntityManager\MissingMappingDriverImplementation;
use Doctrine\ORM\EntityManager\UnrecognizedIdentifierFields;
use Doctrine\ORM\Exception\EntityManagerClosed;
use Doctrine\ORM\Exception\InvalidHydrationMode;
use Doctrine\ORM\Exception\MismatchedEventManager;
use Doctrine\ORM\Exception\MissingIdentifierField;
use Doctrine\ORM\Exception\MissingMappingDriverImplementation;
use Doctrine\ORM\Exception\UnrecognizedIdentifierFields;
use Doctrine\ORM\Mapping\ClassMetadataFactory;
use Doctrine\ORM\Proxy\Factory\ProxyFactory;
use Doctrine\ORM\Proxy\Factory\StaticProxyFactory;
Expand Down
2 changes: 1 addition & 1 deletion lib/Doctrine/ORM/EntityRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Doctrine\Common\Util\Inflector;
use Doctrine\ORM\Mapping\ClassMetadata;
use Doctrine\ORM\Query\ResultSetMappingBuilder;
use Doctrine\ORM\Repository\InvalidMagicMethodCall;
use Doctrine\ORM\Repository\Exception\InvalidMagicMethodCall;
use function array_slice;
use function lcfirst;
use function sprintf;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

declare(strict_types=1);

namespace Doctrine\ORM;
namespace Doctrine\ORM\Exception;

use Doctrine\ORM\ORMException;

interface ConfigurationException extends ORMException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Doctrine\ORM\EntityManager;
namespace Doctrine\ORM\Exception;

use Doctrine\ORM\ManagerException;
use Doctrine\ORM\Exception\ManagerException;

final class EntityManagerClosed extends \Exception implements ManagerException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Doctrine\ORM\Configuration;
namespace Doctrine\ORM\Exception;

use Doctrine\Common\Persistence\ObjectRepository;
use Doctrine\ORM\ConfigurationException;
use Doctrine\ORM\Exception\ConfigurationException;

final class InvalidEntityRepository extends \Exception implements ConfigurationException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Doctrine\ORM\EntityManager;
namespace Doctrine\ORM\Exception;

use Doctrine\ORM\ManagerException;
use Doctrine\ORM\Exception\ManagerException;

final class InvalidHydrationMode extends \Exception implements ManagerException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

declare(strict_types=1);

namespace Doctrine\ORM;
namespace Doctrine\ORM\Exception;

use Doctrine\ORM\ORMException;

interface ManagerException extends ORMException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Doctrine\ORM\EntityManager;
namespace Doctrine\ORM\Exception;

use Doctrine\ORM\ManagerException;
use Doctrine\ORM\Exception\ManagerException;

final class MismatchedEventManager extends \Exception implements ManagerException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Doctrine\ORM\EntityManager;
namespace Doctrine\ORM\Exception;

use Doctrine\ORM\ManagerException;
use Doctrine\ORM\Exception\ManagerException;

final class MissingIdentifierField extends \Exception implements ManagerException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Doctrine\ORM\EntityManager;
namespace Doctrine\ORM\Exception;

use Doctrine\ORM\ManagerException;
use Doctrine\ORM\Exception\ManagerException;

final class MissingMappingDriverImplementation extends \Exception implements ManagerException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Doctrine\ORM;
namespace Doctrine\ORM\Exception;

final class NotSupported extends \Exception implements ORMException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

declare(strict_types=1);

namespace Doctrine\ORM;
namespace Doctrine\ORM\Exception;

use Doctrine\ORM\ORMException;

interface PersisterException extends ORMException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Doctrine\ORM\Configuration;
namespace Doctrine\ORM\Exception;

use Doctrine\ORM\ConfigurationException;
use Doctrine\ORM\Exception\ConfigurationException;

final class ProxyClassesAlwaysRegenerating extends \Exception implements ConfigurationException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

declare(strict_types=1);

namespace Doctrine\ORM;
namespace Doctrine\ORM\Exception;

use Doctrine\ORM\ORMException;

/**
* This interface should be implemented by all exceptions in the Repository
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,9 @@

declare(strict_types=1);

namespace Doctrine\ORM;
namespace Doctrine\ORM\Exception;

use Doctrine\ORM\ORMException;

interface SchemaToolException extends ORMException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Doctrine\ORM;
namespace Doctrine\ORM\Exception;

use Doctrine\ORM\Cache\CacheException;
use Doctrine\ORM\Cache\Exception\CacheException;

final class UnexpectedAssociationValue extends \Exception implements CacheException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Doctrine\ORM\Configuration;
namespace Doctrine\ORM\Exception;

use Doctrine\ORM\ConfigurationException;
use Doctrine\ORM\Exception\ConfigurationException;

final class UnknownEntityNamespace extends \Exception implements ConfigurationException
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Doctrine\ORM\EntityManager;
namespace Doctrine\ORM\Exception;

use Doctrine\ORM\ManagerException;
use Doctrine\ORM\Exception\ManagerException;

final class UnrecognizedIdentifierFields extends \Exception implements ManagerException
{
Expand Down
4 changes: 2 additions & 2 deletions lib/Doctrine/ORM/Mapping/ClassMetadata.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@

namespace Doctrine\ORM\Mapping;

use Doctrine\ORM\Cache\CacheException;
use Doctrine\ORM\Cache\NonCacheableEntityAssociation;
use Doctrine\ORM\Cache\Exception\CacheException;
use Doctrine\ORM\Cache\Exception\NonCacheableEntityAssociation;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\Mapping\Factory\NamingStrategy;
use Doctrine\ORM\Reflection\ReflectionService;
Expand Down
Loading

0 comments on commit 28e7e53

Please sign in to comment.