Skip to content

Commit

Permalink
Merge pull request #28 from rmunate/analysis-4wO4Rk
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
rmunate authored Dec 17, 2023
2 parents 2ed9021 + da1fa8a commit 431bc4b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/Response/SQLServerRow.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

}
4 changes: 3 additions & 1 deletion src/Traits/Methods.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down Expand Up @@ -55,6 +55,7 @@ public function first()

if (!empty($this->response)) {
$first = reset($this->response);

return new SQLServerRow($first);
}

Expand All @@ -72,6 +73,7 @@ public function last()

if (!empty($this->response)) {
$first = end($this->response);

return new SQLServerRow($first);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Validator/StatementsValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down

0 comments on commit 431bc4b

Please sign in to comment.