welcome back to dyb-tech
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\OCI8\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
|
||||
use function assert;
|
||||
use function oci_error;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class ConnectionFailed extends AbstractException
|
||||
{
|
||||
public static function new(): self
|
||||
{
|
||||
$error = oci_error();
|
||||
assert($error !== false);
|
||||
|
||||
return new self($error['message'], null, $error['code']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\OCI8\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
|
||||
use function assert;
|
||||
use function oci_error;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class Error extends AbstractException
|
||||
{
|
||||
/** @param resource $resource */
|
||||
public static function new($resource): self
|
||||
{
|
||||
$error = oci_error($resource);
|
||||
assert($error !== false);
|
||||
|
||||
return new self($error['message'], null, $error['code']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\OCI8\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class InvalidConfiguration extends AbstractException
|
||||
{
|
||||
public static function forPersistentAndExclusive(): self
|
||||
{
|
||||
return new self('The "persistent" parameter and the "exclusive" driver option are mutually exclusive');
|
||||
}
|
||||
}
|
||||
+27
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\OCI8\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class NonTerminatedStringLiteral extends AbstractException
|
||||
{
|
||||
public static function new(int $offset): self
|
||||
{
|
||||
return new self(
|
||||
sprintf(
|
||||
'The statement contains non-terminated string literal starting at offset %d.',
|
||||
$offset,
|
||||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\OCI8\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class SequenceDoesNotExist extends AbstractException
|
||||
{
|
||||
public static function new(): self
|
||||
{
|
||||
return new self('lastInsertId failed: Query was executed but no result was returned.');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Doctrine\DBAL\Driver\OCI8\Exception;
|
||||
|
||||
use Doctrine\DBAL\Driver\AbstractException;
|
||||
|
||||
use function sprintf;
|
||||
|
||||
/**
|
||||
* @internal
|
||||
*
|
||||
* @psalm-immutable
|
||||
*/
|
||||
final class UnknownParameterIndex extends AbstractException
|
||||
{
|
||||
public static function new(int $index): self
|
||||
{
|
||||
return new self(
|
||||
sprintf('Could not find variable mapping with index %d, in the SQL statement', $index),
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user