-
-
Notifications
You must be signed in to change notification settings - Fork 389
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split and move around exceptions, make MigrationException an interface
- Loading branch information
Showing
38 changed files
with
370 additions
and
215 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
11 changes: 11 additions & 0 deletions
11
lib/Doctrine/Migrations/Configuration/Exception/ConfigurationException.php
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,11 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Migrations\Configuration\Exception; | ||
|
||
use Doctrine\Migrations\Exception\MigrationException; | ||
|
||
interface ConfigurationException extends MigrationException | ||
{ | ||
} |
21 changes: 21 additions & 0 deletions
21
lib/Doctrine/Migrations/Configuration/Exception/FileAlreadyLoaded.php
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,21 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Migrations\Configuration\Exception; | ||
|
||
use LogicException; | ||
use function sprintf; | ||
|
||
final class FileAlreadyLoaded extends LogicException implements ConfigurationException | ||
{ | ||
public static function new() : self | ||
{ | ||
return new self( | ||
sprintf( | ||
'Migrations configuration file already loaded' | ||
), | ||
8 | ||
); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
lib/Doctrine/Migrations/Configuration/Exception/MigrationsNamespaceRequired.php
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,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Migrations\Configuration\Exception; | ||
|
||
use LogicException; | ||
|
||
final class MigrationsNamespaceRequired extends LogicException implements ConfigurationException | ||
{ | ||
public static function new() : self | ||
{ | ||
return new self( | ||
'Migrations namespace must be configured in order to use Doctrine migrations.', | ||
2 | ||
); | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
lib/Doctrine/Migrations/Configuration/Exception/NotValid.php
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 Doctrine\Migrations\Configuration\Exception; | ||
|
||
use LogicException; | ||
|
||
final class NotValid extends LogicException implements ConfigurationException | ||
{ | ||
public static function new(string $message) : self | ||
{ | ||
return new self($message, 10); | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
lib/Doctrine/Migrations/Configuration/Exception/ParameterIncompatibleWithFinder.php
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,25 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Migrations\Configuration\Exception; | ||
|
||
use Doctrine\Migrations\Finder\MigrationFinder; | ||
use LogicException; | ||
use function get_class; | ||
use function sprintf; | ||
|
||
final class ParameterIncompatibleWithFinder extends LogicException implements ConfigurationException | ||
{ | ||
public static function new(string $configurationParameterName, MigrationFinder $finder) : self | ||
{ | ||
return new self( | ||
sprintf( | ||
'Configuration-parameter "%s" cannot be used with finder of type "%s"', | ||
$configurationParameterName, | ||
get_class($finder) | ||
), | ||
9 | ||
); | ||
} | ||
} |
18 changes: 18 additions & 0 deletions
18
lib/Doctrine/Migrations/Configuration/Exception/YamlNotAvailable.php
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,18 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Migrations\Configuration\Exception; | ||
|
||
use LogicException; | ||
|
||
final class YamlNotAvailable extends LogicException implements ConfigurationException | ||
{ | ||
public static function new() : self | ||
{ | ||
return new self( | ||
'Unable to load yaml configuration files, please run ' | ||
. '`composer require symfony/yaml` to load yaml configuration files.' | ||
); | ||
} | ||
} |
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,11 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Migrations\Exception; | ||
|
||
use RuntimeException; | ||
|
||
final class AbortMigration extends RuntimeException implements ControlException | ||
{ | ||
} |
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,22 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Migrations\Exception; | ||
|
||
use RuntimeException; | ||
use function sprintf; | ||
|
||
final class AlreadyAtVersion extends RuntimeException implements MigrationException | ||
{ | ||
public static function new(string $version) : self | ||
{ | ||
return new self( | ||
sprintf( | ||
'Database is already at version %s', | ||
$version | ||
), | ||
6 | ||
); | ||
} | ||
} |
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,9 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Doctrine\Migrations\Exception; | ||
|
||
interface ControlException extends MigrationException | ||
{ | ||
} |
Oops, something went wrong.