Codacy removed unused code

This commit is contained in:
Matteo Gheza 2021-04-04 21:44:35 +02:00
parent 6600361315
commit 108b5d9b77
5 changed files with 9 additions and 13 deletions

View File

@ -217,7 +217,7 @@ $routeInfo = $dispatcher->dispatch($httpMethod, $uri);
function responseApi($content, $status_code=200)
{
global $responseFormat, $responseFormatType;
global $responseFormat;
if($status_code !== 200) {
http_response_code($status_code);
}

View File

@ -57,13 +57,6 @@ class StartCommand extends SystemCommand
$chat_id = $message->getChat()->getId();
$keyboard = new Keyboard(
['7', '8', '9'],
['4', '5', '6'],
['1', '2', '3'],
[' ', '0', ' ']
);
$text = 'Hi there!' . PHP_EOL . 'Type /help to see all commands!';
$data = [

View File

@ -469,7 +469,7 @@ class user
return array("autenticated" => $this->authenticated(), "id" => $this->auth->getUserId(), "name" => $this->name(), "full_viewer" => $this->requireRole(Role::FULL_VIEWER), "tester" => $this->requireRole(Role::TESTER), "developer" => $this->requireRole(Role::DEVELOPER));
}
public function login($name, $password, $remember_me, $twofa=null)
public function login($name, $password, $remember_me)
{
$this->tools->profiler_start("Login");
if(!empty($name)) {
@ -571,6 +571,8 @@ class user
public function add_user($email, $name, $username, $password, $phone_number, $birthday, $chief, $driver, $hidden, $disabled, $inserted_by)
{
//TODO: save birthday in db
bdump($birthday);
$this->tools->profiler_start("Add user");
$userId = $this->auth->admin()->createUserWithUniqueUsername($email, $password, $username);
if($userId) {
@ -753,7 +755,7 @@ class translations
} else {
$client_languages = explode(",", $client_languages);
$tmp_languages = [];
foreach($client_languages as $key=>$language){
foreach($client_languages as $language){
if(strpos($language, ';') == false) {
$tmp_languages[$language] = 1;
} else {
@ -875,6 +877,7 @@ function init_class($enableDebugger=true, $headers=true)
global $webpack_manifest_path;
$error = error_get_last();
if ($error) {
bdump($webpack_manifest_path);
require("error_page.php");
show_error_page(500);
}

View File

@ -12,7 +12,7 @@ function customErrorHandler(int $errNo, string $errMsg, string $file, int $line)
"file" => $file,
"line" => $line
];
$output_status = "error";
var_dump($output);
}
error_reporting(-1);
set_error_handler('customErrorHandler');

View File

@ -32,7 +32,7 @@ function client_languages()
} else {
$client_languages = explode(",", $client_languages);
$tmp_languages = [];
foreach($client_languages as $key=>$language){
foreach($client_languages as $language){
if(strpos($language, ';') == false) {
$tmp_languages[$language] = 1;
} else {
@ -659,7 +659,7 @@ function run_cli()
->setDescription(t("Destination path", false))
->setArgumentName('path')
->setValidation(
'is_writable', function ($operand, $value) {
'is_writable', function ($value) {
if(file_exists($value)) {
printf(t("%s is not writable. Directory permissions: %s"), $value, @fileperms($value));
exit(4);