From ad30b120b77085967e932edfa582725bd04495bc Mon Sep 17 00:00:00 2001 From: Joey Smith Date: Sat, 10 Oct 2026 03:53:44 -0500 Subject: [PATCH] fix: import the phpdb exception marker from its current location PhpDb\Sql\Exception\ExceptionInterface no longer exists. Commit 01a9406b in php-db/phpdb made PhpDb\Exception\ExceptionInterface the only marker and removed the Sql namespaced one. The removed interface is not a supertype of the new one, so an import pointing at it leaves analyze with nothing to match: the class cannot be resolved, and every throwable in the hierarchy becomes unhandled because no @throws tag can cover it. Two files referenced it. InitDbCommand aliases it as SqlException, and PhpDbHandler used it directly for the write() docblock. The replacement is a stricter marker, not a looser one. Every exception in the hierarchy now implements PhpDb\Exception\ExceptionInterface, including PhpDb\Sql\Exception\InvalidArgumentException and RuntimeException, which extend their PhpDb\Exception counterparts, and that interface extends Throwable. This is a prerequisite for the lock file maintenance PR, which crosses the removal commit and currently fails analyze for these two imports. --- src/Console/InitDbCommand.php | 2 +- src/Handler/PhpDbHandler.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Console/InitDbCommand.php b/src/Console/InitDbCommand.php index 9a36c1d..ce1aff6 100644 --- a/src/Console/InitDbCommand.php +++ b/src/Console/InitDbCommand.php @@ -16,9 +16,9 @@ use Override; use PhpDb\Adapter\AdapterInterface; +use PhpDb\Exception\ExceptionInterface as SqlException; use PhpDb\Sql\Ddl\CreateTable; use PhpDb\Sql\Ddl\DropTable; -use PhpDb\Sql\Exception\ExceptionInterface as SqlException; use PhpDb\Sql\Sql; use Symfony\Component\Console\Attribute\AsCommand; use Symfony\Component\Console\Command\Command; diff --git a/src/Handler/PhpDbHandler.php b/src/Handler/PhpDbHandler.php index 6b2b23e..539cd2f 100644 --- a/src/Handler/PhpDbHandler.php +++ b/src/Handler/PhpDbHandler.php @@ -18,7 +18,7 @@ use Monolog\LogRecord; use Override; use PhpDb\Adapter\AdapterInterface; -use PhpDb\Sql\Exception\ExceptionInterface; +use PhpDb\Exception\ExceptionInterface; use PhpDb\Sql\Sql; use function array_diff_key;