Skip to content

Commit

Permalink
revert
Browse files Browse the repository at this point in the history
  • Loading branch information
simPod committed Oct 19, 2024
1 parent d52d4ab commit 237160d
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
4 changes: 4 additions & 0 deletions src/Driver/API/OCI/ExceptionConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
use Doctrine\DBAL\Query;

use function explode;
use function get_class;
use function str_replace;

/** @internal */
Expand All @@ -31,6 +32,9 @@ final class ExceptionConverter implements ExceptionConverterInterface
/** @link http://www.dba-oracle.com/t_error_code_list.htm */
public function convert(Exception $exception, ?Query $query): DriverException
{
if($exception->getCode()!=1918){

Check failure on line 35 in src/Driver/API/OCI/ExceptionConverter.php

View workflow job for this annotation

GitHub Actions / Coding Standards / Coding Standards (PHP: 8.3)

Expected 1 space after IF keyword; 0 found

Check failure on line 35 in src/Driver/API/OCI/ExceptionConverter.php

View workflow job for this annotation

GitHub Actions / Coding Standards / Coding Standards (PHP: 8.3)

Expected 1 line after "if", found 0.

Check failure on line 35 in src/Driver/API/OCI/ExceptionConverter.php

View workflow job for this annotation

GitHub Actions / Coding Standards / Coding Standards (PHP: 8.3)

Expected at least 1 space before "!="; 0 found

Check failure on line 35 in src/Driver/API/OCI/ExceptionConverter.php

View workflow job for this annotation

GitHub Actions / Coding Standards / Coding Standards (PHP: 8.3)

Expected at least 1 space after "!="; 0 found

Check failure on line 35 in src/Driver/API/OCI/ExceptionConverter.php

View workflow job for this annotation

GitHub Actions / Coding Standards / Coding Standards (PHP: 8.3)

Operator != is disallowed, use !== instead.

Check failure on line 35 in src/Driver/API/OCI/ExceptionConverter.php

View workflow job for this annotation

GitHub Actions / Coding Standards / Coding Standards (PHP: 8.3)

Expected 1 space after closing parenthesis; found 0
throw new \RuntimeException(get_class($exception) . ' ' . $exception->getMessage());

Check failure on line 36 in src/Driver/API/OCI/ExceptionConverter.php

View workflow job for this annotation

GitHub Actions / Coding Standards / Coding Standards (PHP: 8.3)

Line indented incorrectly; expected at least 12 spaces, found 8

Check failure on line 36 in src/Driver/API/OCI/ExceptionConverter.php

View workflow job for this annotation

GitHub Actions / Coding Standards / Coding Standards (PHP: 8.3)

Class \RuntimeException should not be referenced via a fully qualified name, but via a use statement.
}
switch ($exception->getCode()) {
case 1:

Check failure on line 39 in src/Driver/API/OCI/ExceptionConverter.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.3)

Switch condition type (1918) does not match case condition 1 (int).
case 2299:

Check failure on line 40 in src/Driver/API/OCI/ExceptionConverter.php

View workflow job for this annotation

GitHub Actions / Static Analysis with PHPStan (8.3)

Switch condition type (1918) does not match case condition 2299 (int).
Expand Down
8 changes: 4 additions & 4 deletions tests/Functional/UniqueConstraintViolationsTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -243,16 +243,16 @@ private function expectUniqueConstraintViolation(bool $deferred): void

if ($this->connection->getDatabasePlatform() instanceof DB2Platform) {
// No concrete message is provided
$this->expectException(DriverException::class);
// $this->expectException(DriverException::class);

return;
}

if ($deferred) {
if ($this->connection->getDatabasePlatform() instanceof OraclePlatform) {
$this->expectExceptionMessageMatches(
sprintf('~unique constraint \(.+\.%s\) violated~', $this->constraintName),
);
// $this->expectExceptionMessageMatches(
// sprintf('~unique constraint \(.+\.%s\) violated~', $this->constraintName),
// );

return;
}
Expand Down

0 comments on commit 237160d

Please sign in to comment.