diff --git a/src/AsyncMysql/AsyncMysqlQueryErrorResult.hack b/src/AsyncMysql/AsyncMysqlQueryErrorResult.hack new file mode 100644 index 0000000..0b352bc --- /dev/null +++ b/src/AsyncMysql/AsyncMysqlQueryErrorResult.hack @@ -0,0 +1,20 @@ +namespace Slack\SQLFake; + +<<__MockClass>> +final class AsyncMysqlQueryErrorResult extends \AsyncMysqlQueryErrorResult { + + /* HH_IGNORE_ERROR[3012] I don't want to call parent::construct */ + public function __construct(private int $mysql_errno = 1105, private string $mysql_error = 'ERUnknownError') {} + + <<__Override>> + // HHAST_IGNORE_ERROR[CamelCasedMethodsUnderscoredFunctions] + public function mysql_errno(): int { + return $this->mysql_errno; + } + + <<__Override>> + // HHAST_IGNORE_ERROR[CamelCasedMethodsUnderscoredFunctions] + public function mysql_error(): string { + return $this->mysql_error; + } +} diff --git a/src/Exception.php b/src/Exception.php index bf13aea..13bdac6 100644 --- a/src/Exception.php +++ b/src/Exception.php @@ -8,3 +8,11 @@ final class SQLFakeParseException extends SQLFakeException {} final class SQLFakeRuntimeException extends SQLFakeException {} final class SQLFakeUniqueKeyViolation extends SQLFakeException {} final class SQLFakeVitessQueryViolation extends SQLFakeException {} +final class SQLFakeAsyncMysqlException extends SQLFakeException { + public function __construct(private \AsyncMysqlErrorResult $result) { + parent::__construct(); + } + public function getResult(): \AsyncMysqlErrorResult { + return $this->result; + } +}