mirror of
https://github.com/proelements/proelements.git
synced 2026-04-05 20:13:47 +00:00
v3.34.0
This commit is contained in:
@@ -26,7 +26,7 @@ class Model_Query_Builder extends Query_Builder {
|
||||
* @param string $model_classname - Model to use inside the builder.
|
||||
* @param \wpdb|null $connection - MySQL connection.
|
||||
*/
|
||||
public function __construct( $model_classname, \wpdb $connection = null ) {
|
||||
public function __construct( $model_classname, ?\wpdb $connection = null ) {
|
||||
$this->set_model( $model_classname );
|
||||
|
||||
parent::__construct( $connection );
|
||||
|
||||
@@ -134,7 +134,7 @@ class Query_Builder {
|
||||
*
|
||||
* @param \wpdb|null $connection - The Mysql connection instance to use.
|
||||
*/
|
||||
public function __construct( \wpdb $connection = null ) {
|
||||
public function __construct( ?\wpdb $connection = null ) {
|
||||
if ( $connection ) {
|
||||
$this->connection = $connection;
|
||||
return;
|
||||
@@ -265,7 +265,7 @@ class Query_Builder {
|
||||
*
|
||||
* @return $this
|
||||
*/
|
||||
public function when( $condition, callable $true_callback, callable $false_callback = null ) {
|
||||
public function when( $condition, callable $true_callback, ?callable $false_callback = null ) {
|
||||
if ( $condition ) {
|
||||
call_user_func( $true_callback, $this, $condition );
|
||||
} elseif ( $false_callback instanceof \Closure ) {
|
||||
|
||||
Reference in New Issue
Block a user