From c32f73bfc607f4e01cb03a2d4ef4eeba97ce534d Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Thu, 23 May 2024 01:37:48 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Bases/BaseSQLServer.php | 4 ---- src/Response/SQLServerResponse.php | 5 +---- src/Response/SQLServerRow.php | 5 +---- src/Singleton/SQLServerSingleton.php | 11 ----------- 4 files changed, 2 insertions(+), 23 deletions(-) diff --git a/src/Bases/BaseSQLServer.php b/src/Bases/BaseSQLServer.php index 46ea800..dbf4afc 100644 --- a/src/Bases/BaseSQLServer.php +++ b/src/Bases/BaseSQLServer.php @@ -52,7 +52,6 @@ public static function status(string $connection, int $loginTimeout = 3) (new SQLServerValidator($data, $connection))->verify(); try { - $instance = new static((object) $data, $connection, $loginTimeout); return new SQLServerStatus([ @@ -60,15 +59,12 @@ public static function status(string $connection, int $loginTimeout = 3) 'message' => 'Connection Successful', 'query' => $instance, ]); - } catch (\Throwable $th) { - return new SQLServerStatus([ 'status' => false, 'message' => $th->getMessage(), 'query' => null, ]); - } } } diff --git a/src/Response/SQLServerResponse.php b/src/Response/SQLServerResponse.php index e335aba..6418860 100644 --- a/src/Response/SQLServerResponse.php +++ b/src/Response/SQLServerResponse.php @@ -5,15 +5,12 @@ use Illuminate\Support\Collection; /** - * Class SQLServerResponse + * Class SQLServerResponse. * * This class represents a response from a SQL Server query. * It extends the Illuminate\Support\Collection class to leverage * Laravel's powerful collection functionalities. - * - * @package Rmunate\SqlServerLite\Response */ - class SQLServerResponse extends Collection { /** diff --git a/src/Response/SQLServerRow.php b/src/Response/SQLServerRow.php index 8ba4113..e574246 100644 --- a/src/Response/SQLServerRow.php +++ b/src/Response/SQLServerRow.php @@ -3,14 +3,11 @@ namespace Rmunate\SqlServerLite\Response; /** - * Class SQLServerRow + * Class SQLServerRow. * * This class represents a single row of data from a SQL Server query. * It dynamically assigns properties based on the provided associative array. - * - * @package Rmunate\SqlServerLite\Response */ - class SQLServerRow { /** diff --git a/src/Singleton/SQLServerSingleton.php b/src/Singleton/SQLServerSingleton.php index 6c445e3..0607210 100644 --- a/src/Singleton/SQLServerSingleton.php +++ b/src/Singleton/SQLServerSingleton.php @@ -51,11 +51,8 @@ public static function mount($credentials, string $connection, int $loginTimeout } self::$instance[$connection] = $conection; - } catch (PDOException $e) { - throw SQLServerException::create($e->getMessage()); - } } @@ -86,17 +83,13 @@ public static function beginTransaction() public static function commit() { if (!empty(self::$instance)) { - foreach (self::$instance as $key => $instance) { $instance->commit(); } self::$beginTransaction = false; - } else { - throw SQLServerException::create('The connection to the database is not initialized.'); - } } @@ -108,17 +101,13 @@ public static function commit() public static function rollback() { if (!empty(self::$instance)) { - foreach (self::$instance as $key => $instance) { $instance->rollBack(); } self::$beginTransaction = false; - } else { - throw SQLServerException::create('The connection to the database is not initialized.'); - } } }