From da1fa8ad87bc9c37d683f3c4c550e4e557040301 Mon Sep 17 00:00:00 2001 From: StyleCI Bot Date: Sun, 17 Dec 2023 18:33:19 +0000 Subject: [PATCH] Apply fixes from StyleCI --- src/Response/SQLServerRow.php | 4 ++-- src/Traits/Methods.php | 4 +++- src/Validator/StatementsValidator.php | 2 +- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/Response/SQLServerRow.php b/src/Response/SQLServerRow.php index a1fbda5..c5a2dd1 100644 --- a/src/Response/SQLServerRow.php +++ b/src/Response/SQLServerRow.php @@ -7,10 +7,10 @@ class SQLServerRow /** * @param array $values */ - public function __construct(array $values) { + public function __construct(array $values) + { foreach ($values as $key => $value) { $this->{$key} = $value; } } - } diff --git a/src/Traits/Methods.php b/src/Traits/Methods.php index e717262..067f13e 100644 --- a/src/Traits/Methods.php +++ b/src/Traits/Methods.php @@ -3,8 +3,8 @@ namespace Rmunate\SqlServerLite\Traits; use Closure; -use Rmunate\SqlServerLite\Response\SQLServerRow; use Rmunate\SqlServerLite\Response\SQLServerResponse; +use Rmunate\SqlServerLite\Response\SQLServerRow; trait Methods { @@ -55,6 +55,7 @@ public function first() if (!empty($this->response)) { $first = reset($this->response); + return new SQLServerRow($first); } @@ -72,6 +73,7 @@ public function last() if (!empty($this->response)) { $first = end($this->response); + return new SQLServerRow($first); } diff --git a/src/Validator/StatementsValidator.php b/src/Validator/StatementsValidator.php index 11448bf..217576e 100644 --- a/src/Validator/StatementsValidator.php +++ b/src/Validator/StatementsValidator.php @@ -28,7 +28,7 @@ public static function withoutComments(string $statement) $statement = preg_replace('/\/\*.*?\*\//s', '', $statement); // Check for forbidden comment strings - $forbiddenCommentPatterns = ["/*", "*/", "//", "--", "<-", "->"]; + $forbiddenCommentPatterns = ['/*', '*/', '//', '--', '<-', '->']; foreach ($forbiddenCommentPatterns as $commentPattern) { if (stripos($statement, $commentPattern)) { throw SQLServerException::create("The statement contains comments ($commentPattern); please remove them to proceed.");