welcome back to dyb-tech
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Schema\Exception;
|
||||
|
||||
use Doctrine\DBAL\Schema\SchemaException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/** @psalm-immutable */
|
||||
final class ColumnAlreadyExists extends SchemaException
|
||||
{
|
||||
public static function new(string $tableName, string $columnName): self
|
||||
{
|
||||
return new self(
|
||||
sprintf('The column "%s" on table "%s" already exists.', $columnName, $tableName),
|
||||
self::COLUMN_ALREADY_EXISTS,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Schema\Exception;
|
||||
|
||||
use Doctrine\DBAL\Schema\SchemaException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/** @psalm-immutable */
|
||||
final class ColumnDoesNotExist extends SchemaException
|
||||
{
|
||||
public static function new(string $columnName, string $table): self
|
||||
{
|
||||
return new self(
|
||||
sprintf('There is no column with name "%s" on table "%s".', $columnName, $table),
|
||||
self::COLUMN_DOESNT_EXIST,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Schema\Exception;
|
||||
|
||||
use Doctrine\DBAL\Schema\SchemaException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/** @psalm-immutable */
|
||||
final class ForeignKeyDoesNotExist extends SchemaException
|
||||
{
|
||||
public static function new(string $foreignKeyName, string $table): self
|
||||
{
|
||||
return new self(
|
||||
sprintf('There exists no foreign key with the name "%s" on table "%s".', $foreignKeyName, $table),
|
||||
self::FOREIGNKEY_DOESNT_EXIST,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Schema\Exception;
|
||||
|
||||
use Doctrine\DBAL\Schema\SchemaException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/** @psalm-immutable */
|
||||
final class IndexAlreadyExists extends SchemaException
|
||||
{
|
||||
public static function new(string $indexName, string $table): self
|
||||
{
|
||||
return new self(
|
||||
sprintf('An index with name "%s" was already defined on table "%s".', $indexName, $table),
|
||||
self::INDEX_ALREADY_EXISTS,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Schema\Exception;
|
||||
|
||||
use Doctrine\DBAL\Schema\SchemaException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/** @psalm-immutable */
|
||||
final class IndexDoesNotExist extends SchemaException
|
||||
{
|
||||
public static function new(string $indexName, string $table): self
|
||||
{
|
||||
return new self(
|
||||
sprintf('Index "%s" does not exist on table "%s".', $indexName, $table),
|
||||
self::INDEX_DOESNT_EXIST,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Schema\Exception;
|
||||
|
||||
use Doctrine\DBAL\Schema\SchemaException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/** @psalm-immutable */
|
||||
final class IndexNameInvalid extends SchemaException
|
||||
{
|
||||
public static function new(string $indexName): self
|
||||
{
|
||||
return new self(
|
||||
sprintf('Invalid index name "%s" given, has to be [a-zA-Z0-9_].', $indexName),
|
||||
self::INDEX_INVALID_NAME,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Schema\Exception;
|
||||
|
||||
use Doctrine\DBAL\Schema\SchemaException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/** @psalm-immutable */
|
||||
final class InvalidTableName extends SchemaException
|
||||
{
|
||||
public static function new(string $tableName): self
|
||||
{
|
||||
return new self(sprintf('Invalid table name specified "%s".', $tableName));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Schema\Exception;
|
||||
|
||||
use Doctrine\DBAL\Schema\ForeignKeyConstraint;
|
||||
use Doctrine\DBAL\Schema\SchemaException;
|
||||
use Doctrine\DBAL\Schema\Table;
|
||||
|
||||
use function implode;
|
||||
use function sprintf;
|
||||
|
||||
/** @psalm-immutable */
|
||||
final class NamedForeignKeyRequired extends SchemaException
|
||||
{
|
||||
public static function new(Table $localTable, ForeignKeyConstraint $foreignKey): self
|
||||
{
|
||||
return new self(
|
||||
sprintf(
|
||||
'The performed schema operation on "%s" requires a named foreign key, ' .
|
||||
'but the given foreign key from (%s) onto foreign table "%s" (%s) is currently unnamed.',
|
||||
$localTable->getName(),
|
||||
implode(', ', $foreignKey->getColumns()),
|
||||
$foreignKey->getForeignTableName(),
|
||||
implode(', ', $foreignKey->getForeignColumns()),
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Schema\Exception;
|
||||
|
||||
use Doctrine\DBAL\Schema\SchemaException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/** @psalm-immutable */
|
||||
final class NamespaceAlreadyExists extends SchemaException
|
||||
{
|
||||
public static function new(string $namespaceName): self
|
||||
{
|
||||
return new self(
|
||||
sprintf('The namespace with name "%s" already exists.', $namespaceName),
|
||||
self::NAMESPACE_ALREADY_EXISTS,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Schema\Exception;
|
||||
|
||||
use Doctrine\DBAL\Schema\SchemaException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/** @psalm-immutable */
|
||||
final class SequenceAlreadyExists extends SchemaException
|
||||
{
|
||||
public static function new(string $sequenceName): self
|
||||
{
|
||||
return new self(
|
||||
sprintf('The sequence "%s" already exists.', $sequenceName),
|
||||
self::SEQUENCE_ALREADY_EXISTS,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Schema\Exception;
|
||||
|
||||
use Doctrine\DBAL\Schema\SchemaException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/** @psalm-immutable */
|
||||
final class SequenceDoesNotExist extends SchemaException
|
||||
{
|
||||
public static function new(string $sequenceName): self
|
||||
{
|
||||
return new self(
|
||||
sprintf('There exists no sequence with the name "%s".', $sequenceName),
|
||||
self::SEQUENCE_DOENST_EXIST,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Schema\Exception;
|
||||
|
||||
use Doctrine\DBAL\Schema\SchemaException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/** @psalm-immutable */
|
||||
final class TableAlreadyExists extends SchemaException
|
||||
{
|
||||
public static function new(string $tableName): self
|
||||
{
|
||||
return new self(
|
||||
sprintf('The table with name "%s" already exists.', $tableName),
|
||||
self::TABLE_ALREADY_EXISTS,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Schema\Exception;
|
||||
|
||||
use Doctrine\DBAL\Schema\SchemaException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/** @psalm-immutable */
|
||||
final class TableDoesNotExist extends SchemaException
|
||||
{
|
||||
public static function new(string $tableName): self
|
||||
{
|
||||
return new self(
|
||||
sprintf('There is no table with name "%s" in the schema.', $tableName),
|
||||
self::TABLE_DOESNT_EXIST,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Schema\Exception;
|
||||
|
||||
use Doctrine\DBAL\Schema\SchemaException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/** @psalm-immutable */
|
||||
final class UniqueConstraintDoesNotExist extends SchemaException
|
||||
{
|
||||
public static function new(string $constraintName, string $table): self
|
||||
{
|
||||
return new self(
|
||||
sprintf('There exists no unique constraint with the name "%s" on table "%s".', $constraintName, $table),
|
||||
self::CONSTRAINT_DOESNT_EXIST,
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Schema\Exception;
|
||||
|
||||
use Doctrine\DBAL\Schema\SchemaException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/** @psalm-immutable */
|
||||
final class UnknownColumnOption extends SchemaException
|
||||
{
|
||||
public static function new(string $name): self
|
||||
{
|
||||
return new self(
|
||||
sprintf('The "%s" column option is not supported.', $name),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user