Ignore defined + empty check php stan errors

This commit is contained in:
Clemens Schwaighofer
2021-11-02 10:06:30 +09:00
parent 0f38cb4f89
commit f9072f64f1
3 changed files with 7 additions and 2 deletions

View File

@@ -48,7 +48,7 @@ parameters:
# ignore errores with
ignoreErrors:
# this is ignored for now
- '#Expression in empty\(\) is always falsy.#'
# - '#Expression in empty\(\) is always falsy.#'
# -
# message: '#Reflection error: [a-zA-Z0-9\\_]+ not found.#'
# path: www/includes/edit_base.php

View File

@@ -191,7 +191,8 @@ class Login extends \CoreLibs\DB\IO
exit;
}
// set global is ajax page for if we show the data directly, or need to pass it back
// set global is ajax page for if we show the data directly,
// or need to pass it back
// to the continue AJAX class for output back to the user
$this->login_is_ajax_page = isset($GLOBALS['AJAX_PAGE']) && $GLOBALS['AJAX_PAGE'] ? true : false;
// set the default lang
@@ -207,6 +208,7 @@ class Login extends \CoreLibs\DB\IO
// check what schema to use. if there is a login schema use this, else check
// if there is a schema set in the config, or fall back to DB_SCHEMA
// if this exists, if this also does not exists use public schema
/** @phpstan-ignore-next-line */
if (defined('LOGIN_DB_SCHEMA') && !empty(LOGIN_DB_SCHEMA)) {
$SCHEMA = LOGIN_DB_SCHEMA;
} elseif (isset($db_config['db_schema']) && $db_config['db_schema']) {
@@ -216,6 +218,7 @@ class Login extends \CoreLibs\DB\IO
} else {
$SCHEMA = 'public';
}
// echo "<h1>*****SCHEMA******</h1>: $SCHEMA<br>";
// set schema if schema differs to schema set in db conneciton
if ($this->dbGetSchema() && $this->dbGetSchema() != $SCHEMA) {
$this->dbExec("SET search_path TO " . $SCHEMA);

View File

@@ -208,6 +208,7 @@ class Backend extends \CoreLibs\DB\IO
// check schema
$SCHEMA = 'public';
/** @phpstan-ignore-next-line */
if (defined('LOGIN_DB_SCHEMA') && !empty(LOGIN_DB_SCHEMA)) {
$SCHEMA = LOGIN_DB_SCHEMA;
} elseif ($this->dbGetSchema()) {
@@ -511,6 +512,7 @@ class Backend extends \CoreLibs\DB\IO
string $associate = null,
string $file = null
): void {
/** @phpstan-ignore-next-line */
if (defined('GLOBAL_DB_SCHEMA') && !empty(GLOBAL_DB_SCHEMA)) {
$SCHEMA = GLOBAL_DB_SCHEMA;
} elseif ($this->dbGetSchema()) {