phpstan level 1 errors reduction
This commit is contained in:
@@ -1,5 +1,13 @@
|
||||
<?php
|
||||
/// @file common settings and includes for the participo api
|
||||
|
||||
/** @var array $CONFIG basic configurations (defined via bootstraping) */
|
||||
/** @var array $SECRETS passwords and other stuff worth of protection (defined via bootstraping) */
|
||||
require_once "bootstrap.php";
|
||||
|
||||
require_once "participoLib/event.php";
|
||||
participo::init($CONFIG["cwsvJudo"], $SECRETS["cwsvJudo"]);
|
||||
|
||||
/// - set locale to german
|
||||
setlocale(LC_ALL, "de_DE@euro", "de_DE", "de", "ge");
|
||||
/// - extend the include search path for
|
||||
@@ -23,6 +31,7 @@ require_once "participoLib/dbConnector.php";
|
||||
|
||||
function authorize()
|
||||
{
|
||||
$allowKey = null;
|
||||
if (array_key_exists("HTTP_AUTHORIZATION", $_SERVER)) {
|
||||
if (!empty($_SERVER["HTTP_AUTHORIZATION"])) {
|
||||
$auth = explode(" ", $_SERVER["HTTP_AUTHORIZATION"]);
|
||||
@@ -41,15 +50,3 @@ function authorize()
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/// - initialize the database connection
|
||||
dbConnector::setOptions([
|
||||
"dbCharset" => $cwsvJudoConfig["dbCharset"] ?? "UTF-8",
|
||||
"outCharset" => $cwsvJudoConfig["outCharset"] ?? "UTF-8",
|
||||
]);
|
||||
dbConnector::connect(
|
||||
$cwsvJudoConfig["db"]["host"],
|
||||
$cwsvJudoConfig["db"]["name"],
|
||||
$cwsvJudoConfig["db"]["user"],
|
||||
$cwsvJudoConfig["db"]["password"],
|
||||
);
|
||||
|
||||
@@ -1,5 +1,8 @@
|
||||
<?php
|
||||
/** @var array $CONFIG basic configurations (defined via bootstraping) */
|
||||
/** @var array $SECRETS passwords and other stuff worth of protection (defined via bootstraping) */
|
||||
require_once "bootstrap.php";
|
||||
|
||||
require_once "participoLib/participo.php";
|
||||
|
||||
function init($config, $secrets)
|
||||
@@ -18,6 +21,7 @@ function init($config, $secrets)
|
||||
|
||||
function authorize()
|
||||
{
|
||||
$allowKey = null;
|
||||
if (array_key_exists("HTTP_AUTHORIZATION", $_SERVER)) {
|
||||
if (!empty($_SERVER["HTTP_AUTHORIZATION"])) {
|
||||
$auth = explode(" ", $_SERVER["HTTP_AUTHORIZATION"]);
|
||||
|
||||
Reference in New Issue
Block a user