welcome back to dyb-tech

This commit is contained in:
Daniel Guzman
2024-05-18 02:28:01 +02:00
parent 9513cdba09
commit 9f30bc98c7
6149 changed files with 668407 additions and 0 deletions
@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
use RuntimeException;
final class AbortMigration extends RuntimeException implements ControlException
{
}
@@ -0,0 +1,23 @@
<?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,
);
}
}
@@ -0,0 +1,9 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
interface ControlException extends MigrationException
{
}
@@ -0,0 +1,9 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
interface DependencyException extends MigrationException
{
}
@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
use RuntimeException;
use function sprintf;
final class DuplicateMigrationVersion extends RuntimeException implements MigrationException
{
public static function new(string $version, string $class): self
{
return new self(
sprintf(
'Migration version %s already registered with class %s',
$version,
$class,
),
7,
);
}
}
@@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
use LogicException;
final class FrozenDependencies extends LogicException implements DependencyException
{
public static function new(): self
{
return new self('The dependencies are frozen and cannot be edited anymore.');
}
}
@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
use RuntimeException;
final class IrreversibleMigration extends RuntimeException implements MigrationException
{
}
@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
use RuntimeException;
final class MetadataStorageError extends RuntimeException implements MigrationException
{
public static function notUpToDate(): self
{
return new self('The metadata storage is not up to date, please run the sync-metadata-storage command to fix this issue.');
}
public static function notInitialized(): self
{
return new self('The metadata storage is not initialized, please run the sync-metadata-storage command to fix this issue.');
}
}
@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
use RuntimeException;
use function sprintf;
final class MigrationClassNotFound extends RuntimeException implements MigrationException
{
public static function new(string $migrationClass): self
{
return new self(
sprintf(
'Migration class "%s" was not found?',
$migrationClass,
),
);
}
}
@@ -0,0 +1,26 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
use Doctrine\Migrations\AbstractMigration;
use UnexpectedValueException;
use function get_debug_type;
use function sprintf;
final class MigrationConfigurationConflict extends UnexpectedValueException implements MigrationException
{
public static function migrationIsNotTransactional(AbstractMigration $migration): self
{
return new self(sprintf(
<<<'EXCEPTION'
Context: attempting to execute migrations with all-or-nothing enabled
Problem: migration %s is marked as non-transactional
Solution: disable all-or-nothing in configuration or by command-line option, or enable transactions for all migrations
EXCEPTION,
get_debug_type($migration),
));
}
}
@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
use Throwable;
interface MigrationException extends Throwable
{
}
@@ -0,0 +1,24 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
use Doctrine\Migrations\Version\Version;
use RuntimeException;
use function sprintf;
final class MigrationNotAvailable extends RuntimeException implements MigrationException
{
public static function forVersion(Version $version): self
{
return new self(
sprintf(
'The migration %s is not available',
(string) $version,
),
5,
);
}
}
@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
use RuntimeException;
use function sprintf;
final class MigrationNotExecuted extends RuntimeException implements MigrationException
{
public static function new(string $version): self
{
return new self(
sprintf(
'The provided migration %s has not been executed',
$version,
),
5,
);
}
}
@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
use RuntimeException;
final class MissingDependency extends RuntimeException implements DependencyException
{
public static function noEntityManager(): self
{
return new self('The entity manager is not available.');
}
public static function noSchemaProvider(): self
{
return new self('The schema provider is not available.');
}
}
@@ -0,0 +1,22 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
use RuntimeException;
use function sprintf;
final class NoMigrationsFoundWithCriteria extends RuntimeException implements MigrationException
{
public static function new(string|null $criteria = null): self
{
return new self(
$criteria !== null
? sprintf('Could not find any migrations matching your criteria (%s).', $criteria)
: 'Could not find any migrations matching your criteria.',
4,
);
}
}
@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
use RuntimeException;
use Throwable;
final class NoMigrationsToExecute extends RuntimeException implements MigrationException
{
public static function new(Throwable|null $previous = null): self
{
return new self(
'Could not find any migrations to execute.',
4,
$previous,
);
}
}
@@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
use RuntimeException;
final class NoTablesFound extends RuntimeException implements MigrationException
{
public static function new(): self
{
return new self('Your database schema does not contain any tables.');
}
}
@@ -0,0 +1,15 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
use RuntimeException;
final class PlanAlreadyExecuted extends RuntimeException implements MigrationException
{
public static function new(): self
{
return new self('This plan was already marked as executed.');
}
}
@@ -0,0 +1,20 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
use RuntimeException;
final class RollupFailed extends RuntimeException implements MigrationException
{
public static function noMigrationsFound(): self
{
return new self('No migrations found.');
}
public static function tooManyMigrations(): self
{
return new self('Too many migrations.');
}
}
@@ -0,0 +1,11 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
use RuntimeException;
final class SkipMigration extends RuntimeException implements ControlException
{
}
@@ -0,0 +1,23 @@
<?php
declare(strict_types=1);
namespace Doctrine\Migrations\Exception;
use RuntimeException;
use function sprintf;
final class UnknownMigrationVersion extends RuntimeException implements MigrationException
{
public static function new(string $version): self
{
return new self(
sprintf(
'Could not find migration version %s',
$version,
),
5,
);
}
}