Skip to content

Commit cb4f4c3

Browse files
darkterminalgithub-actions[bot]
authored andcommitted
Fix styling
1 parent cdc5bd5 commit cb4f4c3

13 files changed

+23
-29
lines changed

src/Database/LibSQLConnection.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
namespace Turso\Http\Laravel\Database;
44

5+
use Darkterminal\TursoHttp\LibSQL;
56
use Exception;
67
use Illuminate\Database\Connection;
78
use Illuminate\Filesystem\Filesystem;
8-
use Darkterminal\TursoHttp\LibSQL;
99

1010
class LibSQLConnection extends Connection
1111
{
@@ -47,7 +47,7 @@ public function statement($query, $bindings = []): bool
4747
{
4848
$res = $this->select($query, $bindings);
4949

50-
return !empty($res);
50+
return ! empty($res);
5151
}
5252

5353
public function getPdo(): LibSQLDatabase
@@ -110,7 +110,7 @@ public function select($query, $bindings = [], $useReadPdo = true)
110110

111111
$results = $statement->query($bindings);
112112

113-
return array_map(fn($result) => $result, $results);
113+
return array_map(fn ($result) => $result, $results);
114114
});
115115
}
116116

@@ -135,7 +135,7 @@ public function cursor($query, $bindings = [], $useReadPdo = true)
135135

136136
$preparedQuery = $this->getRawPdo()->prepare($query);
137137

138-
if (!$preparedQuery) {
138+
if (! $preparedQuery) {
139139
throw new Exception('Failed to prepare statement.');
140140
}
141141

@@ -319,6 +319,6 @@ public function quote($input)
319319
return 'NULL';
320320
}
321321

322-
return "'" . $this->escapeString($input) . "'";
322+
return "'".$this->escapeString($input)."'";
323323
}
324324
}

src/Database/LibSQLConnectionFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class LibSQLConnectionFactory extends ConnectionFactory
99
protected function createConnection($driver, $connection, $database, $prefix = '', array $config = [])
1010
{
1111
$config['driver'] = 'libsql';
12-
$config['url'] = 'file:' . $config['database'];
12+
$config['url'] = 'file:'.$config['database'];
1313
$connection = function () use ($config) {
1414
return new LibSQLDatabase($config);
1515
};

src/Database/LibSQLDatabase.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ public function inTransaction(): bool
106106

107107
public function sync(): void
108108
{
109-
throw new \Exception("[LibSQL: remote] Sync is only available for Remote Replica Connection in Native libSQL Extension.", 1);
109+
throw new \Exception('[LibSQL: remote] Sync is only available for Remote Replica Connection in Native libSQL Extension.', 1);
110110
}
111111

112112
public function getDb(): LibSQL
@@ -134,7 +134,7 @@ public function quote($input)
134134
return 'NULL';
135135
}
136136

137-
return "'" . $this->escapeString($input) . "'";
137+
return "'".$this->escapeString($input)."'";
138138
}
139139

140140
public function __destruct()

src/Database/LibSQLPDOStatement.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,7 @@ class LibSQLPDOStatement
2020
public function __construct(
2121
protected LibSQLDatabase $db,
2222
protected string $query
23-
) {
24-
}
23+
) {}
2524

2625
public function setFetchMode(int $mode, mixed ...$args): bool
2726
{

src/Database/LibSQLQueryGrammar.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44

55
use Illuminate\Database\Query\Grammars\SQLiteGrammar;
66

7-
class LibSQLQueryGrammar extends SQLiteGrammar
8-
{
9-
}
7+
class LibSQLQueryGrammar extends SQLiteGrammar {}

src/Database/LibSQLQueryProcessor.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ public function processTables($results): array
2020
public function processSelect(Builder $query, $results)
2121
{
2222
$results = $this->useAssoc($results);
23+
2324
return $results;
2425
}
2526

@@ -34,11 +35,13 @@ private function useAssoc(array $results)
3435
$arr_vals = [];
3536
$i = 0;
3637
foreach ($vals as $val) {
37-
if ($val['type'] === "null")
38+
if ($val['type'] === 'null') {
3839
$val['value'] = null;
40+
}
3941
$arr_vals[] = $val['value'];
4042
$i++;
4143
}
44+
4245
return $arr_vals;
4346
}, $results['rows']);
4447

src/Database/LibSQLSchemaState.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44

55
use Illuminate\Database\Schema\SqliteSchemaState;
66

7-
class LibSQLSchemaState extends SqliteSchemaState
8-
{
9-
}
7+
class LibSQLSchemaState extends SqliteSchemaState {}

src/Exceptions/ConfigurationIsNotFound.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44

55
use LogicException;
66

7-
class ConfigurationIsNotFound extends LogicException
8-
{
9-
}
7+
class ConfigurationIsNotFound extends LogicException {}

src/Exceptions/FeatureNotSupportedException.php

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,4 @@
44

55
use LogicException;
66

7-
class FeatureNotSupportedException extends LogicException
8-
{
9-
}
7+
class FeatureNotSupportedException extends LogicException {}

src/LibSQLHttpServiceProvider.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public function register(): void
4545
$db->extend('libsql', function ($config, $name) {
4646
$config = config('database.connections.libsql');
4747
$config['name'] = $name;
48-
if (!isset($config['driver'])) {
48+
if (! isset($config['driver'])) {
4949
$config['driver'] = 'libsql';
5050
}
5151

0 commit comments

Comments
 (0)