Skip to content

Commit 35a91ba

Browse files
committed
PHPCS fixes
1 parent 8c4e96f commit 35a91ba

File tree

3 files changed

+19
-20
lines changed

3 files changed

+19
-20
lines changed

phpcs.xml.dist

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@
5555
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedClassFound">
5656
<exclude-pattern>*/src/DB_Command\.php$</exclude-pattern>
5757
</rule>
58+
<rule ref="WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedTraitFound">
59+
<exclude-pattern>*/src/DB_Command_SQLite\.php$</exclude-pattern>
60+
</rule>
61+
62+
<rule ref="WordPress.DB.RestrictedClasses.mysql__PDO">
63+
<exclude-pattern>*/src/DB_Command_SQLite\.php$</exclude-pattern>
64+
</rule>
5865

5966
<exclude-pattern>/tests/phpstan/scan-files</exclude-pattern>
6067
</ruleset>

src/DB_Command.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ public function create( $_, $assoc_args ) {
8989
$this->maybe_load_sqlite_dropin();
9090

9191
if ( $this->is_sqlite() ) {
92-
$this->sqlite_create( $assoc_args );
92+
$this->sqlite_create();
9393
return;
9494
}
9595

@@ -130,7 +130,7 @@ public function drop( $_, $assoc_args ) {
130130
if ( $this->is_sqlite() ) {
131131
$db_path = $this->get_sqlite_db_path();
132132
WP_CLI::confirm( "Are you sure you want to drop the SQLite database at '{$db_path}'?", $assoc_args );
133-
$this->sqlite_drop( $assoc_args );
133+
$this->sqlite_drop();
134134
return;
135135
}
136136

@@ -173,7 +173,7 @@ public function reset( $_, $assoc_args ) {
173173
if ( $this->is_sqlite() ) {
174174
$db_path = $this->get_sqlite_db_path();
175175
WP_CLI::confirm( "Are you sure you want to reset the SQLite database at '{$db_path}'?", $assoc_args );
176-
$this->sqlite_reset( $assoc_args );
176+
$this->sqlite_reset();
177177
return;
178178
}
179179

@@ -568,7 +568,7 @@ public function query( $args, $assoc_args ) {
568568
WP_CLI::error( 'No query specified.' );
569569
}
570570

571-
$this->sqlite_query( $query, $assoc_args );
571+
$this->sqlite_query( $query );
572572
return;
573573
}
574574

@@ -888,7 +888,7 @@ public function import( $args, $assoc_args ) {
888888
}
889889

890890
if ( $this->is_sqlite() ) {
891-
$this->sqlite_import( $result_file, $assoc_args );
891+
$this->sqlite_import( $result_file );
892892
return;
893893
}
894894

src/DB_Command_SQLite.php

Lines changed: 7 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,8 @@ protected function get_sqlite_pdo() {
102102

103103
/**
104104
* Create SQLite database.
105-
*
106-
* @param array $assoc_args Associative arguments (unused for SQLite).
107105
*/
108-
protected function sqlite_create( $assoc_args ) {
106+
protected function sqlite_create() {
109107
$db_path = $this->get_sqlite_db_path();
110108
$db_dir = dirname( $db_path );
111109

@@ -137,10 +135,8 @@ protected function sqlite_create( $assoc_args ) {
137135

138136
/**
139137
* Drop SQLite database.
140-
*
141-
* @param array $assoc_args Associative arguments (unused for SQLite).
142138
*/
143-
protected function sqlite_drop( $assoc_args ) {
139+
protected function sqlite_drop() {
144140
$db_path = $this->get_sqlite_db_path();
145141

146142
if ( ! file_exists( $db_path ) ) {
@@ -156,10 +152,8 @@ protected function sqlite_drop( $assoc_args ) {
156152

157153
/**
158154
* Reset SQLite database.
159-
*
160-
* @param array $assoc_args Associative arguments (unused for SQLite).
161155
*/
162-
protected function sqlite_reset( $assoc_args ) {
156+
protected function sqlite_reset() {
163157
$db_path = $this->get_sqlite_db_path();
164158

165159
// Delete if exists.
@@ -194,10 +188,9 @@ protected function sqlite_reset( $assoc_args ) {
194188
/**
195189
* Execute a query against the SQLite database.
196190
*
197-
* @param string $query SQL query to execute.
198-
* @param array $assoc_args Associative arguments.
191+
* @param string $query SQL query to execute.
199192
*/
200-
protected function sqlite_query( $query, $assoc_args ) {
193+
protected function sqlite_query( $query ) {
201194
$pdo = $this->get_sqlite_pdo();
202195

203196
if ( ! $pdo ) {
@@ -357,10 +350,9 @@ protected function sqlite_export( $file, $assoc_args ) {
357350
/**
358351
* Import SQL into SQLite database.
359352
*
360-
* @param string $file Input file path.
361-
* @param array $assoc_args Associative arguments.
353+
* @param string $file Input file path.
362354
*/
363-
protected function sqlite_import( $file, $assoc_args ) {
355+
protected function sqlite_import( $file ) {
364356
$pdo = $this->get_sqlite_pdo();
365357

366358
if ( ! $pdo ) {

0 commit comments

Comments
 (0)