Skip to content

Commit 8bb6c26

Browse files
committed
Merge remote-tracking branch 'origin/guidelines-galore' into guidelines-galore
2 parents 8c5d8b4 + 2560872 commit 8bb6c26

File tree

9 files changed

+30
-28
lines changed

9 files changed

+30
-28
lines changed

src/Mcp/Tools/ApplicationInfo.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@
1515
#[IsReadOnly]
1616
class ApplicationInfo extends Tool
1717
{
18-
public function __construct(protected Roster $roster, protected GuidelineAssist $guidelineAssist) {}
18+
public function __construct(protected Roster $roster, protected GuidelineAssist $guidelineAssist)
19+
{
20+
}
1921

2022
public function description(): string
2123
{

src/Mcp/Tools/DatabaseSchema.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -169,4 +169,4 @@ protected function getGlobalStructure(?string $connection): array
169169
'sequences' => $driver->getSequences(),
170170
];
171171
}
172-
}
172+
}

src/Mcp/Tools/DatabaseSchema/DatabaseSchemaDriver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@ abstract public function getStoredProcedures(): array;
1919

2020
abstract public function getFunctions(): array;
2121

22-
abstract public function getTriggers(string $table = null): array;
22+
abstract public function getTriggers(?string $table = null): array;
2323

2424
abstract public function getCheckConstraints(string $table): array;
2525

2626
abstract public function getSequences(): array;
27-
}
27+
}

src/Mcp/Tools/DatabaseSchema/MySQLSchemaDriver.php

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ class MySQLSchemaDriver extends DatabaseSchemaDriver
1111
public function getViews(): array
1212
{
1313
try {
14-
return DB::connection($this->connection)->select("
14+
return DB::connection($this->connection)->select('
1515
SELECT TABLE_NAME as name, VIEW_DEFINITION as definition
1616
FROM information_schema.VIEWS
1717
WHERE TABLE_SCHEMA = DATABASE()
18-
");
18+
');
1919
} catch (\Exception $e) {
2020
return [];
2121
}
@@ -24,7 +24,7 @@ public function getViews(): array
2424
public function getStoredProcedures(): array
2525
{
2626
try {
27-
return DB::connection($this->connection)->select("SHOW PROCEDURE STATUS WHERE Db = DATABASE()");
27+
return DB::connection($this->connection)->select('SHOW PROCEDURE STATUS WHERE Db = DATABASE()');
2828
} catch (\Exception $e) {
2929
return [];
3030
}
@@ -33,20 +33,20 @@ public function getStoredProcedures(): array
3333
public function getFunctions(): array
3434
{
3535
try {
36-
return DB::connection($this->connection)->select("SHOW FUNCTION STATUS WHERE Db = DATABASE()");
36+
return DB::connection($this->connection)->select('SHOW FUNCTION STATUS WHERE Db = DATABASE()');
3737
} catch (\Exception $e) {
3838
return [];
3939
}
4040
}
4141

42-
public function getTriggers(string $table = null): array
42+
public function getTriggers(?string $table = null): array
4343
{
4444
try {
4545
if ($table) {
46-
return DB::connection($this->connection)->select("SHOW TRIGGERS WHERE `Table` = ?", [$table]);
46+
return DB::connection($this->connection)->select('SHOW TRIGGERS WHERE `Table` = ?', [$table]);
4747
}
4848

49-
return DB::connection($this->connection)->select("SHOW TRIGGERS");
49+
return DB::connection($this->connection)->select('SHOW TRIGGERS');
5050
} catch (\Exception $e) {
5151
return [];
5252
}
@@ -55,12 +55,12 @@ public function getTriggers(string $table = null): array
5555
public function getCheckConstraints(string $table): array
5656
{
5757
try {
58-
return DB::connection($this->connection)->select("
58+
return DB::connection($this->connection)->select('
5959
SELECT CONSTRAINT_NAME, CHECK_CLAUSE
6060
FROM information_schema.CHECK_CONSTRAINTS
6161
WHERE CONSTRAINT_SCHEMA = DATABASE()
6262
AND TABLE_NAME = ?
63-
", [$table]);
63+
', [$table]);
6464
} catch (\Exception $e) {
6565
return [];
6666
}
@@ -70,4 +70,4 @@ public function getSequences(): array
7070
{
7171
return [];
7272
}
73-
}
73+
}

src/Mcp/Tools/DatabaseSchema/NullSchemaDriver.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ public function getFunctions(): array
2121
return [];
2222
}
2323

24-
public function getTriggers(string $table = null): array
24+
public function getTriggers(?string $table = null): array
2525
{
2626
return [];
2727
}
@@ -35,4 +35,4 @@ public function getSequences(): array
3535
{
3636
return [];
3737
}
38-
}
38+
}

src/Mcp/Tools/DatabaseSchema/PostgreSQLSchemaDriver.php

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -51,16 +51,16 @@ public function getFunctions(): array
5151
}
5252
}
5353

54-
public function getTriggers(string $table = null): array
54+
public function getTriggers(?string $table = null): array
5555
{
5656
try {
57-
$sql = "
57+
$sql = '
5858
SELECT trigger_name, event_manipulation, event_object_table, action_statement
5959
FROM information_schema.triggers
6060
WHERE trigger_schema = current_schema()
61-
";
61+
';
6262
if ($table) {
63-
$sql .= " AND event_object_table = ?";
63+
$sql .= ' AND event_object_table = ?';
6464

6565
return DB::connection($this->connection)->select($sql, [$table]);
6666
}
@@ -88,13 +88,13 @@ public function getCheckConstraints(string $table): array
8888
public function getSequences(): array
8989
{
9090
try {
91-
return DB::connection($this->connection)->select("
91+
return DB::connection($this->connection)->select('
9292
SELECT sequence_name, start_value, minimum_value, maximum_value, increment
9393
FROM information_schema.sequences
9494
WHERE sequence_schema = current_schema()
95-
");
95+
');
9696
} catch (\Exception $e) {
9797
return [];
9898
}
9999
}
100-
}
100+
}

src/Mcp/Tools/DatabaseSchema/SQLiteSchemaDriver.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,12 @@ public function getFunctions(): array
3131
return [];
3232
}
3333

34-
public function getTriggers(string $table = null): array
34+
public function getTriggers(?string $table = null): array
3535
{
3636
try {
3737
$sql = "SELECT name, sql FROM sqlite_master WHERE type = 'trigger'";
3838
if ($table) {
39-
$sql .= " AND tbl_name = ?";
39+
$sql .= ' AND tbl_name = ?';
4040

4141
return DB::connection($this->connection)->select($sql, [$table]);
4242
}
@@ -56,4 +56,4 @@ public function getSequences(): array
5656
{
5757
return [];
5858
}
59-
}
59+
}

src/Mcp/Tools/DatabaseSchema/SchemaDriverFactory.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,4 @@ public static function make(?string $connection = null): DatabaseSchemaDriver
1919
default => new NullSchemaDriver($connection),
2020
};
2121
}
22-
}
22+
}

tests/Feature/Mcp/Tools/DatabaseSchemaTest.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,4 +94,4 @@
9494

9595
expect($schemaArray['tables'])->toHaveKey('users');
9696
expect($schemaArray['tables'])->not->toHaveKey('examples');
97-
});
97+
});

0 commit comments

Comments
 (0)