Skip to content

Commit

Permalink
standards(phpstan) Standards fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
borkweb committed Sep 15, 2022
1 parent ac94b56 commit d5b22e7
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 12 deletions.
10 changes: 5 additions & 5 deletions src/DB/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

namespace StellarWP\DB;

use Database\Exceptions\DatabaseQueryException;
use StellarWP\DB\Database\Exceptions\DatabaseQueryException;

class Config {
/**
Expand All @@ -21,7 +21,7 @@ class Config {
* @return string
*/
public static function getDatabaseQueryException() {
return static::$databaseQueryException;
return self::$databaseQueryException;
}

/**
Expand All @@ -30,7 +30,7 @@ public static function getDatabaseQueryException() {
* @return string
*/
public static function getHookPrefix() {
return static::$hookPrefix;
return self::$hookPrefix;
}

/**
Expand All @@ -41,7 +41,7 @@ public static function getHookPrefix() {
* @return void
*/
public static function setDatabaseQueryException( string $class ) {
static::$databaseQueryException = $class;
self::$databaseQueryException = $class;
}

/**
Expand All @@ -52,6 +52,6 @@ public static function setDatabaseQueryException( string $class ) {
* @return void
*/
public static function setHookPrefix( string $prefix ) {
static::$hookPrefix = $prefix;
self::$hookPrefix = $prefix;
}
}
14 changes: 8 additions & 6 deletions src/DB/DB.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,13 @@ class DB {
* @since 1.0.0
*/
public static function init(): void {
if ( ! static::$initialized ) {
if ( ! self::$initialized ) {
return;
}

static::$provider = new Database\Provider();
static::$provider->register();
static::$initialized = true;
self::$provider = new Database\Provider();
self::$provider->register();
self::$initialized = true;
}

/**
Expand Down Expand Up @@ -121,7 +121,8 @@ static function () use ( $name, $arguments ) {
*
* @since 1.0.0
*
* @param string $argument
* @param string $argument First argument passed to the $wpdb method.
* @param string $hook_prefix Prefix for the hook.
*/
do_action( "{$hook_prefix}_stellarwp_db_pre_query", current( $arguments ), $hook_prefix );
}
Expand All @@ -131,7 +132,8 @@ static function () use ( $name, $arguments ) {
*
* @since 1.0.0
*
* @param string $argument
* @param string $argument First argument passed to the $wpdb method.
* @param string $hook_prefix Prefix for the hook.
*/
do_action( 'stellarwp_db_pre_query', current( $arguments ), $hook_prefix );
}
Expand Down
2 changes: 1 addition & 1 deletion src/DB/Database/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public function register() {
* Fires the EnableBigSqlSelects action.
*/
public function enable_big_sql_selects() {
if ( ! $this->action_enable_big_sql_selects ) {
if ( $this->action_enable_big_sql_selects === null ) {
$this->action_enable_big_sql_selects = new Actions\EnableBigSqlSelects();
}

Expand Down

0 comments on commit d5b22e7

Please sign in to comment.