-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Exceptions were moved in separated files - Added aliases for exceptions - Composer require PHP at ^7.1
- Loading branch information
Showing
30 changed files
with
340 additions
and
296 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
<?php | ||
|
||
namespace Kdyby\Doctrine\Exception; | ||
use Doctrine; | ||
|
||
/** | ||
* @author Filip Procházka <[email protected]> | ||
* @deprecated | ||
*/ | ||
class DBALException extends \RuntimeException implements IException | ||
{ | ||
|
||
/** | ||
* @var string|NULL | ||
*/ | ||
public $query; | ||
|
||
/** | ||
* @var array | ||
*/ | ||
public $params = []; | ||
|
||
/** | ||
* @var \Doctrine\DBAL\Connection|NULL | ||
*/ | ||
public $connection; | ||
|
||
|
||
/** | ||
* @param \Exception|\Throwable $previous | ||
* @param string|NULL $query | ||
* @param array $params | ||
* @param \Doctrine\DBAL\Connection|NULL $connection | ||
* @param string|NULL $message | ||
*/ | ||
public function __construct($previous, $query = NULL, $params = [], Doctrine\DBAL\Connection $connection = NULL, $message = NULL) | ||
{ | ||
parent::__construct($message ?: $previous->getMessage(), $previous->getCode(), $previous); | ||
$this->query = $query; | ||
$this->params = $params; | ||
$this->connection = $connection; | ||
} | ||
|
||
|
||
/** | ||
* This is just a paranoia, hopes no one actually serializes exceptions. | ||
* | ||
* @return array | ||
*/ | ||
public function __sleep() | ||
{ | ||
return ['message', 'code', 'file', 'line', 'errorInfo', 'query', 'params']; | ||
} | ||
|
||
} | ||
|
||
class_alias(DBALException::class, 'Kdyby\Doctrine\DBALException'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<?php | ||
|
||
namespace Kdyby\Doctrine\Exception; | ||
|
||
use Doctrine; | ||
use Kdyby\Doctrine\Exception; | ||
|
||
/** | ||
* @author Filip Procházka <[email protected]> | ||
* @deprecated | ||
*/ | ||
class DuplicateEntryException extends DBALException | ||
{ | ||
|
||
/** | ||
* @var array | ||
*/ | ||
public $columns; | ||
|
||
|
||
/** | ||
* @param \Exception|\Throwable $previous | ||
* @param array $columns | ||
* @param string $query | ||
* @param array $params | ||
* @param \Doctrine\DBAL\Connection $connection | ||
*/ | ||
public function __construct($previous, $columns = [], $query = NULL, $params = [], Doctrine\DBAL\Connection $connection = NULL) | ||
{ | ||
parent::__construct($previous, $query, $params, $connection); | ||
$this->columns = $columns; | ||
} | ||
|
||
|
||
/** | ||
* @return array | ||
*/ | ||
public function __sleep() | ||
{ | ||
return array_merge(parent::__sleep(), ['columns']); | ||
} | ||
|
||
} | ||
|
||
class_alias(DuplicateEntryException::class, 'Kdyby\Doctrine\DuplicateEntryException'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
<?php | ||
|
||
namespace Kdyby\Doctrine\Exception; | ||
|
||
use Doctrine; | ||
|
||
/** | ||
* @author Filip Procházka <[email protected]> | ||
* @deprecated | ||
*/ | ||
class EmptyValueException extends DBALException | ||
{ | ||
|
||
/** | ||
* @var string|NULL | ||
*/ | ||
public $column; | ||
|
||
|
||
/** | ||
* @param \Exception|\Throwable $previous | ||
* @param string|NULL $column | ||
* @param string $query | ||
* @param array $params | ||
* @param \Doctrine\DBAL\Connection $connection | ||
*/ | ||
public function __construct($previous, $column = NULL, $query = NULL, $params = [], Doctrine\DBAL\Connection $connection = NULL) | ||
{ | ||
parent::__construct($previous, $query, $params, $connection); | ||
$this->column = $column; | ||
} | ||
|
||
|
||
/** | ||
* @return array | ||
*/ | ||
public function __sleep() | ||
{ | ||
return array_merge(parent::__sleep(), ['column']); | ||
} | ||
|
||
} | ||
|
||
class_alias(EmptyValueException::class, 'Kdyby\Doctrine\EmptyValueException'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Kdyby\Doctrine\Exception; | ||
|
||
/** | ||
* @author Filip Procházka <[email protected]> | ||
*/ | ||
interface IException | ||
{ | ||
|
||
} | ||
|
||
class_alias(IException::class, 'Kdyby\Doctrine\Exception'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Kdyby\Doctrine\Exception; | ||
|
||
/** | ||
* @author Filip Procházka <[email protected]> | ||
*/ | ||
class InvalidArgumentException extends \InvalidArgumentException implements IException | ||
{ | ||
|
||
} | ||
|
||
class_alias(InvalidArgumentException::class, 'Kdyby\Doctrine\InvalidArgumentException'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Kdyby\Doctrine\Exception; | ||
|
||
/** | ||
* @author Filip Procházka <[email protected]> | ||
*/ | ||
class InvalidStateException extends \RuntimeException implements IException | ||
{ | ||
|
||
} | ||
|
||
class_alias(InvalidStateException::class, 'Kdyby\Doctrine\InvalidStateException'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Kdyby\Doctrine\Exception; | ||
|
||
/** | ||
* When class is not found | ||
*/ | ||
class MissingClassException extends \LogicException implements IException | ||
{ | ||
|
||
} | ||
|
||
class_alias(MissingClassException::class, 'Kdyby\Doctrine\MissingClassException'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Kdyby\Doctrine\Exception; | ||
|
||
/** | ||
* The exception that is thrown when a requested method or operation is not implemented. | ||
*/ | ||
class NotImplementedException extends \LogicException implements IException | ||
{ | ||
|
||
} | ||
|
||
class_alias(NotImplementedException::class, 'Kdyby\Doctrine\NotImplementedException'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<?php | ||
|
||
namespace Kdyby\Doctrine\Exception; | ||
|
||
/** | ||
* @author Filip Procházka <[email protected]> | ||
*/ | ||
class NotSupportedException extends \LogicException implements IException | ||
{ | ||
|
||
} | ||
|
||
class_alias(NotSupportedException::class, 'Kdyby\Doctrine\NotSupportedException'); |
Oops, something went wrong.