Skip to content

Commit

Permalink
Fixing ddSql method (#549)
Browse files Browse the repository at this point in the history
* Fixing ddSql method

* Ensure the script does die
  • Loading branch information
srtfisher committed May 9, 2024
1 parent f297f2d commit e5b69fa
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/mantle/database/query/class-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ abstract public function dumpSql(): static;
/**
* Dump the SQL query for the request and stop execution.
*/
abstract public function ddSql(): void;
abstract public function ddSql(): never;

/**
* Get a model instance for the builder.
Expand Down
6 changes: 4 additions & 2 deletions src/mantle/database/query/class-post-query-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -340,7 +340,9 @@ function ( string $sql, \WP_Query $query ) use ( $die ) {
/**
* Dump the SQL query being executed and die.
*/
public function ddSql(): void {
$this->dumpSql( true );
public function ddSql(): never {
$this->dumpSql( true )->get();

die( 1 );
}
}
6 changes: 4 additions & 2 deletions src/mantle/database/query/class-term-query-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,9 @@ function ( mixed $terms, \WP_Term_Query $query ) use ( $die ) {
/**
* Dump the SQL query being executed and die.
*/
public function ddSql(): void {
$this->dumpSql( true );
public function ddSql(): never {
$this->dumpSql( true )->get();

die( 1 );
}
}

0 comments on commit e5b69fa

Please sign in to comment.