Skip to content

Commit

Permalink
Clean code Exceptions::class. (#546)
Browse files Browse the repository at this point in the history
  • Loading branch information
terabytesoftw committed Feb 27, 2023
1 parent 21fd145 commit 6ca53fe
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/Exception/ConvertException.php
Expand Up @@ -28,7 +28,8 @@ public function __construct(private \Exception $e, private string $rawSql)
public function run(): Exception
{
$message = $this->e->getMessage() . PHP_EOL . 'The SQL being executed was: ' . $this->rawSql;
/** @var array|null */

/** @var array|null $errorInfo */
$errorInfo = $this->e instanceof PDOException ? $this->e->errorInfo : null;

return match (
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/Exception.php
Expand Up @@ -18,7 +18,7 @@ public function __construct(string $message, public array|null $errorInfo = [],
}

/**
* @return string readable representation of exception
* @return string Readable representation of exception.
*/
public function __toString(): string
{
Expand Down

0 comments on commit 6ca53fe

Please sign in to comment.