update_user_info accesses the super-global variable $_POST.
public function update_user_info(WP_User $user, array $user_info)
{
array_pop($user_info);
foreach ($user_info as $key => $value) {
add_user_meta($user->ID, $key, $value, true);
update_user_info accesses the super-global variable $_POST.
public function update_user_info(WP_User $user, array $user_info)
{
array_pop($user_info);
foreach ($user_info as $key => $value) {
add_user_meta($user->ID, $key, $value, true);
update_user_info accesses the super-global variable $_POST.
public function update_user_info(WP_User $user, array $user_info)
{
array_pop($user_info);
foreach ($user_info as $key => $value) {
add_user_meta($user->ID, $key, $value, true);
update_user_info accesses the super-global variable $_POST.
public function update_user_info(WP_User $user, array $user_info)
{
array_pop($user_info);
foreach ($user_info as $key => $value) {
add_user_meta($user->ID, $key, $value, true);
update_user_info accesses the super-global variable $_POST.
public function update_user_info(WP_User $user, array $user_info)
{
array_pop($user_info);
foreach ($user_info as $key => $value) {
add_user_meta($user->ID, $key, $value, true);
File Procedure.php
has 271 lines of code (exceeds 250 allowed). Consider refactoring.
<?php
include_once 'vendor/autoload.php';
include_once "Db.php";
Method get_order_and_procedure
has 41 lines of code (exceeds 25 allowed). Consider refactoring.
public function get_order_and_procedure(string $procedure_id): array
{
$procedure_data = $this->db->get_query("select p.id,
creation_date,
update_date,
Method process
has 32 lines of code (exceeds 25 allowed). Consider refactoring.
public function process(array $post, array $files): array
{
if (IS_DEVELOPMENT) {
krumo($post);
krumo($files);
Method get_orders_current_user
has 27 lines of code (exceeds 25 allowed). Consider refactoring.
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
{
$user_type = $this->get_user_type($this->email);
$params = [];
if (isset($user_type["rol"]["administrator"])) {
Function process
has a Cognitive Complexity of 8 (exceeds 5 allowed). Consider refactoring.
public function process(array $post, array $files): array
{
if (IS_DEVELOPMENT) {
krumo($post);
krumo($files);
Function get_user_type
has a Cognitive Complexity of 6 (exceeds 5 allowed). Consider refactoring.
public function get_user_type(string $email): array
{
if (empty($email)) {
$email = $this->email;
}
Missing class import via use statement (line '102', column '23').
throw new Exception("User $email not found");
Missing class import via use statement (line '78', column '78').
return DateTime::createFromFormat("Y-m-d H:i:s", $creation_date, new DateTimeZone('UTC'));
Avoid using static access to class 'URLify' in method 'get_user_type'.
$user_type[self::DATA][$i]["display_name"] = URLify::slug($user_type[self::DATA][$i]["display_name"]);
The method get_orders_current_user uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
} else {
$query = $this->client_query;
$params["email"] = $this->email;
$count_orders_query = $this->db->get_scalar("select count(p.id) as orders from wp_procedure p
inner join wpsw_users u on p.user_id = u.ID
Avoid using static access to class 'DB' in method '__construct'.
$this->db = DB::getInstance();
Avoid using static access to class 'DateTime' in method 'createDateTimeFromString'.
return DateTime::createFromFormat("Y-m-d H:i:s", $creation_date, new DateTimeZone('UTC'));
The method get_user_type uses an else expression. Else clauses are basically not necessary and you can simplify the code by not using them.
} else {
throw new Exception("User $email not found");
}
Avoid using static access to class 'URLify' in method 'process'.
$path = "tramites" . "/" . URLify::slug($post["user"]) . "/";
The method get_orders_current_user() contains an exit expression.
die($user_orders["error"]);
Avoid using count() function in for loops.
for ($i = 0; $i < count($user_type[self::DATA]); $i++) {
$user_type[self::DATA][$i]["rol"] = unserialize($user_type[self::DATA][$i]["rol"]);
$user_type[self::DATA][$i]["display_name"] = URLify::slug($user_type[self::DATA][$i]["display_name"]);
}
Avoid using count() function in for loops.
for ($i = 0; $i < count($procedure_data[self::DATA]); $i++) {
$procedure_data[self::DATA][$i]["creation_date"] = self::createDateTimeFromString($procedure_data[self::DATA][$i]["creation_date"]);
$procedure_data[self::DATA][$i]["update_date"] = self::createDateTimeFromString($procedure_data[self::DATA][$i]["update_date"]);
}
Avoid using count() function in for loops.
for ($i = 0; $i < count($user_orders[self::DATA]); $i++) {
$user_orders[self::DATA][$i]["creation_date"] = self::createDateTimeFromString($user_orders[self::DATA][$i]["creation_date"]);
$user_orders[self::DATA][$i]["update_date"] = self::createDateTimeFromString($user_orders[self::DATA][$i]["update_date"]);
}
syntax error, unexpected 'string' (T_STRING), expecting function (T_FUNCTION) or const (T_CONST)
private string $email;
Similar blocks of code found in 2 locations. Consider refactoring.
for ($i = 0; $i < count($user_orders[self::DATA]); $i++) {
$user_orders[self::DATA][$i]["creation_date"] = self::createDateTimeFromString($user_orders[self::DATA][$i]["creation_date"]);
$user_orders[self::DATA][$i]["update_date"] = self::createDateTimeFromString($user_orders[self::DATA][$i]["update_date"]);
}
Similar blocks of code found in 2 locations. Consider refactoring.
for ($i = 0; $i < count($procedure_data[self::DATA]); $i++) {
$procedure_data[self::DATA][$i]["creation_date"] = self::createDateTimeFromString($procedure_data[self::DATA][$i]["creation_date"]);
$procedure_data[self::DATA][$i]["update_date"] = self::createDateTimeFromString($procedure_data[self::DATA][$i]["update_date"]);
}
Each class must be in a namespace of at least one level (a top-level vendor name)
class Procedure
The property $order_statuses is not named in camelCase.
class Procedure
{
const DATA = "data";
private string $email;
Avoid variables with short names like $db. Configured minimum length is 3.
private Db $db;
A file should declare new symbols (classes, functions, constants, etc.) and cause no other side effects, or it should execute logic with side effects, but should not do both. The first symbol is defined on line 9 and the first side effect is on line 4.
<?php
The property $admin_query is not named in camelCase.
class Procedure
{
const DATA = "data";
private string $email;
The parameter $user_info is not named in camelCase.
public function update_user_info(WP_User $user, array $user_info)
{
array_pop($user_info);
foreach ($user_info as $key => $value) {
add_user_meta($user->ID, $key, $value, true);
The parameter $document_name is not named in camelCase.
public function add_user_file(string $user_email, string $file, int $type, string $document_name = ""): bool
{
$sql = "INSERT INTO wp_procedure_file(user_email, file_path, type, document_name)
VALUES(:user_email, :file, :type, :document_name)";
return $this->db->execute_query($sql, [
The parameter $user_id is not named in camelCase.
public function create_procedure(int $user_id, int $procedure_type, float $amount, string $payment_info): bool
{
return $this->db->execute_query(" insert into wp_procedure(user_id,status_id,procedure_type,amount,payment_info)
values(:user_id, :status_id, :procedure_type, :amount, :payment_info) ",
[
The parameter $creation_date is not named in camelCase.
private static function createDateTimeFromString(string $creation_date)
{
return DateTime::createFromFormat("Y-m-d H:i:s", $creation_date, new DateTimeZone('UTC'));
}
The property $procedure_statuses is not named in camelCase.
class Procedure
{
const DATA = "data";
private string $email;
The property $client_query is not named in camelCase.
class Procedure
{
const DATA = "data";
private string $email;
The parameter $user_email is not named in camelCase.
public function add_user_file(string $user_email, string $file, int $type, string $document_name = ""): bool
{
$sql = "INSERT INTO wp_procedure_file(user_email, file_path, type, document_name)
VALUES(:user_email, :file, :type, :document_name)";
return $this->db->execute_query($sql, [
The parameter $procedure_type is not named in camelCase.
public function create_procedure(int $user_id, int $procedure_type, float $amount, string $payment_info): bool
{
return $this->db->execute_query(" insert into wp_procedure(user_id,status_id,procedure_type,amount,payment_info)
values(:user_id, :status_id, :procedure_type, :amount, :payment_info) ",
[
The parameter $procedure_id is not named in camelCase.
public function change_procedure_status(string $procedure_id, int $status): bool
{
return $this->db->execute_query("update wp_procedure set status_id = :status where id = :procedure_id",
["status" => $status, "procedure_id" => $procedure_id]);
}
The parameter $payment_info is not named in camelCase.
public function create_procedure(int $user_id, int $procedure_type, float $amount, string $payment_info): bool
{
return $this->db->execute_query(" insert into wp_procedure(user_id,status_id,procedure_type,amount,payment_info)
values(:user_id, :status_id, :procedure_type, :amount, :payment_info) ",
[
The parameter $procedure_id is not named in camelCase.
public function get_order_and_procedure(string $procedure_id): array
{
$procedure_data = $this->db->get_query("select p.id,
creation_date,
update_date,
The parameter $procedure_id is not named in camelCase.
public function remove_procedure_file(string $procedure_id, string $file_id): bool
{
return $this->db->execute_query("delete from wp_procedure_file where procedure_id = :procedure_id and id= :file_id",
["procedure_id" => $procedure_id, "file_id" => $file_id]);
}
The parameter $file_id is not named in camelCase.
public function remove_procedure_file(string $procedure_id, string $file_id): bool
{
return $this->db->execute_query("delete from wp_procedure_file where procedure_id = :procedure_id and id= :file_id",
["procedure_id" => $procedure_id, "file_id" => $file_id]);
}
The parameter $user_email is not named in camelCase.
public function get_user_files(?string $user_email = ""): array
{
if (!empty($user_email)) {
$this->email = $user_email;
}
Method name "Procedure::get_identification__types" is not in camel caps format
public static function get_identification__types(): array
Method name "Procedure::remove_procedure_file" is not in camel caps format
public function remove_procedure_file(string $procedure_id, string $file_id): bool
Method name "Procedure::get_user_type" is not in camel caps format
public function get_user_type(string $email): array
Method name "Procedure::get_document_types" is not in camel caps format
public function get_document_types(): array
Method name "Procedure::get_procedure_status" is not in camel caps format
public function get_procedure_status()
Method name "Procedure::get_user_files" is not in camel caps format
public function get_user_files(?string $user_email = ""): array
Method name "Procedure::add_user_file" is not in camel caps format
public function add_user_file(string $user_email, string $file, int $type, string $document_name = ""): bool
Method name "Procedure::change_procedure_status" is not in camel caps format
public function change_procedure_status(string $procedure_id, int $status): bool
Method name "Procedure::update_user_info" is not in camel caps format
public function update_user_info(WP_User $user, array $user_info)
Method name "Procedure::get_order_and_procedure" is not in camel caps format
public function get_order_and_procedure(string $procedure_id): array
Method name "Procedure::get_procedure_types" is not in camel caps format
public function get_procedure_types(): array
Method name "Procedure::create_procedure" is not in camel caps format
public function create_procedure(int $user_id, int $procedure_type, float $amount, string $payment_info): bool
Method name "Procedure::get_document_types_string" is not in camel caps format
public function get_document_types_string(): string
Method name "Procedure::get_orders_current_user" is not in camel caps format
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
Line exceeds 120 characters; contains 121 characters
return $this->db->execute_query(" insert into wp_procedure(user_id,status_id,procedure_type,amount,payment_info)
Line exceeds 120 characters; contains 134 characters
$user_orders[self::DATA][$i]["update_date"] = self::createDateTimeFromString($user_orders[self::DATA][$i]["update_date"]);
Line exceeds 120 characters; contains 124 characters
return $this->db->execute_query("delete from wp_procedure_file where procedure_id = :procedure_id and id= :file_id",
Line exceeds 120 characters; contains 144 characters
$procedure_data[self::DATA][$i]["creation_date"] = self::createDateTimeFromString($procedure_data[self::DATA][$i]["creation_date"]);
Line exceeds 120 characters; contains 140 characters
$procedure_data[self::DATA][$i]["update_date"] = self::createDateTimeFromString($procedure_data[self::DATA][$i]["update_date"]);
Line exceeds 120 characters; contains 138 characters
$user_orders[self::DATA][$i]["creation_date"] = self::createDateTimeFromString($user_orders[self::DATA][$i]["creation_date"]);
Line exceeds 120 characters; contains 122 characters
on pf.type = ft.id where pf.user_email= :user_email", ["user_email" => $procedure_data[self::DATA][0]["email"]]);
Multi-line function call not indented correctly; expected 8 spaces but found 12
]);
Multi-line function call not indented correctly; expected 8 spaces but found 12
["status" => $status, "procedure_id" => $procedure_id]);
Closing parenthesis of a multi-line function call must be on a line by itself
["user_email" => $this->email]);
Opening parenthesis of a multi-line function call must be the last content on the line
return $this->db->execute_query("update wp_procedure set status_id = :status where id = :procedure_id",
Closing parenthesis of a multi-line function call must be on a line by itself
["status" => $status, "procedure_id" => $procedure_id]);
Closing parenthesis of a multi-line function call must be on a line by itself
$post["document_name"][$i]);
Opening parenthesis of a multi-line function call must be the last content on the line
return $this->db->get_query("select pf.id, file_path, wpft.type, document_name
Multi-line function call not indented correctly; expected 8 spaces but found 12
["procedure_id" => $procedure_id, "file_id" => $file_id]);
Closing parenthesis of a multi-line function call must be on a line by itself
["procedure_id" => $procedure_id, "file_id" => $file_id]);
Opening parenthesis of a multi-line function call must be the last content on the line
return $this->db->execute_query(" insert into wp_procedure(user_id,status_id,procedure_type,amount,payment_info)
Closing parenthesis of a multi-line function call must be on a line by itself
]);
Multi-line function call not indented correctly; expected 16 spaces but found 20
$post["document_name"][$i]);
Multi-line function call not indented correctly; expected 8 spaces but found 12
["user_email" => $this->email]);
Opening parenthesis of a multi-line function call must be the last content on the line
$db_result[$i] = $this->add_user_file($this->email,
Opening parenthesis of a multi-line function call must be the last content on the line
return $this->db->execute_query("delete from wp_procedure_file where procedure_id = :procedure_id and id= :file_id",
The variable $user_type is not named in camelCase.
public function get_user_type(string $email): array
{
if (empty($email)) {
$email = $this->email;
}
The variable $user_orders is not named in camelCase.
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
{
$user_type = $this->get_user_type($this->email);
$params = [];
if (isset($user_type["rol"]["administrator"])) {
The variable $creation_date is not named in camelCase.
private static function createDateTimeFromString(string $creation_date)
{
return DateTime::createFromFormat("Y-m-d H:i:s", $creation_date, new DateTimeZone('UTC'));
}
The variable $user_type is not named in camelCase.
public function get_user_type(string $email): array
{
if (empty($email)) {
$email = $this->email;
}
The variable $procedure_files is not named in camelCase.
public function get_order_and_procedure(string $procedure_id): array
{
$procedure_data = $this->db->get_query("select p.id,
creation_date,
update_date,
The variable $procedure_data is not named in camelCase.
public function get_order_and_procedure(string $procedure_id): array
{
$procedure_data = $this->db->get_query("select p.id,
creation_date,
update_date,
The variable $user_email is not named in camelCase.
public function get_user_files(?string $user_email = ""): array
{
if (!empty($user_email)) {
$this->email = $user_email;
}
The variable $user_email is not named in camelCase.
public function add_user_file(string $user_email, string $file, int $type, string $document_name = ""): bool
{
$sql = "INSERT INTO wp_procedure_file(user_email, file_path, type, document_name)
VALUES(:user_email, :file, :type, :document_name)";
return $this->db->execute_query($sql, [
The variable $db_result is not named in camelCase.
public function process(array $post, array $files): array
{
if (IS_DEVELOPMENT) {
krumo($post);
krumo($files);
The variable $files_count is not named in camelCase.
public function process(array $post, array $files): array
{
if (IS_DEVELOPMENT) {
krumo($post);
krumo($files);
The variable $count_orders_query is not named in camelCase.
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
{
$user_type = $this->get_user_type($this->email);
$params = [];
if (isset($user_type["rol"]["administrator"])) {
The variable $user_type is not named in camelCase.
public function get_user_type(string $email): array
{
if (empty($email)) {
$email = $this->email;
}
The variable $count_orders_query is not named in camelCase.
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
{
$user_type = $this->get_user_type($this->email);
$params = [];
if (isset($user_type["rol"]["administrator"])) {
The variable $user_type is not named in camelCase.
public function get_user_type(string $email): array
{
if (empty($email)) {
$email = $this->email;
}
The variable $user_orders is not named in camelCase.
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
{
$user_type = $this->get_user_type($this->email);
$params = [];
if (isset($user_type["rol"]["administrator"])) {
The variable $user_id is not named in camelCase.
public function create_procedure(int $user_id, int $procedure_type, float $amount, string $payment_info): bool
{
return $this->db->execute_query(" insert into wp_procedure(user_id,status_id,procedure_type,amount,payment_info)
values(:user_id, :status_id, :procedure_type, :amount, :payment_info) ",
[
The variable $user_orders is not named in camelCase.
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
{
$user_type = $this->get_user_type($this->email);
$params = [];
if (isset($user_type["rol"]["administrator"])) {
The variable $procedure_data is not named in camelCase.
public function get_order_and_procedure(string $procedure_id): array
{
$procedure_data = $this->db->get_query("select p.id,
creation_date,
update_date,
The variable $procedure_id is not named in camelCase.
public function remove_procedure_file(string $procedure_id, string $file_id): bool
{
return $this->db->execute_query("delete from wp_procedure_file where procedure_id = :procedure_id and id= :file_id",
["procedure_id" => $procedure_id, "file_id" => $file_id]);
}
The variable $file_id is not named in camelCase.
public function remove_procedure_file(string $procedure_id, string $file_id): bool
{
return $this->db->execute_query("delete from wp_procedure_file where procedure_id = :procedure_id and id= :file_id",
["procedure_id" => $procedure_id, "file_id" => $file_id]);
}
The variable $user_type is not named in camelCase.
public function get_user_type(string $email): array
{
if (empty($email)) {
$email = $this->email;
}
The variable $user_orders is not named in camelCase.
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
{
$user_type = $this->get_user_type($this->email);
$params = [];
if (isset($user_type["rol"]["administrator"])) {
The variable $user_orders is not named in camelCase.
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
{
$user_type = $this->get_user_type($this->email);
$params = [];
if (isset($user_type["rol"]["administrator"])) {
The variable $user_orders is not named in camelCase.
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
{
$user_type = $this->get_user_type($this->email);
$params = [];
if (isset($user_type["rol"]["administrator"])) {
The variable $procedure_data is not named in camelCase.
public function get_order_and_procedure(string $procedure_id): array
{
$procedure_data = $this->db->get_query("select p.id,
creation_date,
update_date,
The variable $count_orders_query is not named in camelCase.
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
{
$user_type = $this->get_user_type($this->email);
$params = [];
if (isset($user_type["rol"]["administrator"])) {
The variable $user_email is not named in camelCase.
public function get_user_files(?string $user_email = ""): array
{
if (!empty($user_email)) {
$this->email = $user_email;
}
The variable $document_types is not named in camelCase.
public function get_document_types_string(): string
{
$document_types = $this->get_document_types();
$array_string = array_map(fn(array $value) => '"' . $value["type"] . '"', $document_types);
return implode(",", $array_string);
The variable $array_string is not named in camelCase.
public function get_document_types_string(): string
{
$document_types = $this->get_document_types();
$array_string = array_map(fn(array $value) => '"' . $value["type"] . '"', $document_types);
return implode(",", $array_string);
The variable $document_types is not named in camelCase.
public function get_document_types_string(): string
{
$document_types = $this->get_document_types();
$array_string = array_map(fn(array $value) => '"' . $value["type"] . '"', $document_types);
return implode(",", $array_string);
The variable $db_result is not named in camelCase.
public function process(array $post, array $files): array
{
if (IS_DEVELOPMENT) {
krumo($post);
krumo($files);
The variable $user_type is not named in camelCase.
public function get_user_type(string $email): array
{
if (empty($email)) {
$email = $this->email;
}
The variable $user_orders is not named in camelCase.
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
{
$user_type = $this->get_user_type($this->email);
$params = [];
if (isset($user_type["rol"]["administrator"])) {
The variable $procedure_data is not named in camelCase.
public function get_order_and_procedure(string $procedure_id): array
{
$procedure_data = $this->db->get_query("select p.id,
creation_date,
update_date,
The variable $procedure_data is not named in camelCase.
public function get_order_and_procedure(string $procedure_id): array
{
$procedure_data = $this->db->get_query("select p.id,
creation_date,
update_date,
The variable $procedure_type is not named in camelCase.
public function create_procedure(int $user_id, int $procedure_type, float $amount, string $payment_info): bool
{
return $this->db->execute_query(" insert into wp_procedure(user_id,status_id,procedure_type,amount,payment_info)
values(:user_id, :status_id, :procedure_type, :amount, :payment_info) ",
[
The variable $user_info is not named in camelCase.
public function update_user_info(WP_User $user, array $user_info)
{
array_pop($user_info);
foreach ($user_info as $key => $value) {
add_user_meta($user->ID, $key, $value, true);
The variable $user_orders is not named in camelCase.
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
{
$user_type = $this->get_user_type($this->email);
$params = [];
if (isset($user_type["rol"]["administrator"])) {
The variable $user_type is not named in camelCase.
public function get_user_type(string $email): array
{
if (empty($email)) {
$email = $this->email;
}
The variable $user_type is not named in camelCase.
public function get_user_type(string $email): array
{
if (empty($email)) {
$email = $this->email;
}
The variable $user_orders is not named in camelCase.
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
{
$user_type = $this->get_user_type($this->email);
$params = [];
if (isset($user_type["rol"]["administrator"])) {
The variable $user_type is not named in camelCase.
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
{
$user_type = $this->get_user_type($this->email);
$params = [];
if (isset($user_type["rol"]["administrator"])) {
The variable $procedure_files is not named in camelCase.
public function get_order_and_procedure(string $procedure_id): array
{
$procedure_data = $this->db->get_query("select p.id,
creation_date,
update_date,
The variable $procedure_data is not named in camelCase.
public function get_order_and_procedure(string $procedure_id): array
{
$procedure_data = $this->db->get_query("select p.id,
creation_date,
update_date,
The variable $document_name is not named in camelCase.
public function add_user_file(string $user_email, string $file, int $type, string $document_name = ""): bool
{
$sql = "INSERT INTO wp_procedure_file(user_email, file_path, type, document_name)
VALUES(:user_email, :file, :type, :document_name)";
return $this->db->execute_query($sql, [
The variable $files_count is not named in camelCase.
public function process(array $post, array $files): array
{
if (IS_DEVELOPMENT) {
krumo($post);
krumo($files);
The variable $user_type is not named in camelCase.
public function get_user_type(string $email): array
{
if (empty($email)) {
$email = $this->email;
}
The variable $procedure_data is not named in camelCase.
public function get_order_and_procedure(string $procedure_id): array
{
$procedure_data = $this->db->get_query("select p.id,
creation_date,
update_date,
The variable $user_type is not named in camelCase.
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
{
$user_type = $this->get_user_type($this->email);
$params = [];
if (isset($user_type["rol"]["administrator"])) {
The variable $user_orders is not named in camelCase.
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
{
$user_type = $this->get_user_type($this->email);
$params = [];
if (isset($user_type["rol"]["administrator"])) {
The variable $array_string is not named in camelCase.
public function get_document_types_string(): string
{
$document_types = $this->get_document_types();
$array_string = array_map(fn(array $value) => '"' . $value["type"] . '"', $document_types);
return implode(",", $array_string);
The variable $payment_info is not named in camelCase.
public function create_procedure(int $user_id, int $procedure_type, float $amount, string $payment_info): bool
{
return $this->db->execute_query(" insert into wp_procedure(user_id,status_id,procedure_type,amount,payment_info)
values(:user_id, :status_id, :procedure_type, :amount, :payment_info) ",
[
The variable $procedure_id is not named in camelCase.
public function get_order_and_procedure(string $procedure_id): array
{
$procedure_data = $this->db->get_query("select p.id,
creation_date,
update_date,
The variable $procedure_data is not named in camelCase.
public function get_order_and_procedure(string $procedure_id): array
{
$procedure_data = $this->db->get_query("select p.id,
creation_date,
update_date,
The variable $procedure_files is not named in camelCase.
public function get_order_and_procedure(string $procedure_id): array
{
$procedure_data = $this->db->get_query("select p.id,
creation_date,
update_date,
The variable $user_info is not named in camelCase.
public function update_user_info(WP_User $user, array $user_info)
{
array_pop($user_info);
foreach ($user_info as $key => $value) {
add_user_meta($user->ID, $key, $value, true);
The variable $user_orders is not named in camelCase.
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
{
$user_type = $this->get_user_type($this->email);
$params = [];
if (isset($user_type["rol"]["administrator"])) {
The variable $db_result is not named in camelCase.
public function process(array $post, array $files): array
{
if (IS_DEVELOPMENT) {
krumo($post);
krumo($files);
The variable $procedure_data is not named in camelCase.
public function get_order_and_procedure(string $procedure_id): array
{
$procedure_data = $this->db->get_query("select p.id,
creation_date,
update_date,
The variable $procedure_id is not named in camelCase.
public function change_procedure_status(string $procedure_id, int $status): bool
{
return $this->db->execute_query("update wp_procedure set status_id = :status where id = :procedure_id",
["status" => $status, "procedure_id" => $procedure_id]);
}
The method get_user_type is not named in camelCase.
public function get_user_type(string $email): array
{
if (empty($email)) {
$email = $this->email;
}
The method get_orders_current_user is not named in camelCase.
public function get_orders_current_user(array $limit = ["start" => 0, "items" => 10]): array
{
$user_type = $this->get_user_type($this->email);
$params = [];
if (isset($user_type["rol"]["administrator"])) {
The method change_procedure_status is not named in camelCase.
public function change_procedure_status(string $procedure_id, int $status): bool
{
return $this->db->execute_query("update wp_procedure set status_id = :status where id = :procedure_id",
["status" => $status, "procedure_id" => $procedure_id]);
}
The method get_user_files is not named in camelCase.
public function get_user_files(?string $user_email = ""): array
{
if (!empty($user_email)) {
$this->email = $user_email;
}
The method get_document_types_string is not named in camelCase.
public function get_document_types_string(): string
{
$document_types = $this->get_document_types();
$array_string = array_map(fn(array $value) => '"' . $value["type"] . '"', $document_types);
return implode(",", $array_string);
The method get_procedure_types is not named in camelCase.
public function get_procedure_types(): array
{
return $this->db->get_query("select id, name from wp_procedure_type")[self::DATA];
}
The method add_user_file is not named in camelCase.
public function add_user_file(string $user_email, string $file, int $type, string $document_name = ""): bool
{
$sql = "INSERT INTO wp_procedure_file(user_email, file_path, type, document_name)
VALUES(:user_email, :file, :type, :document_name)";
return $this->db->execute_query($sql, [
The method get_document_types is not named in camelCase.
public function get_document_types(): array
{
return $this->db->get_query("select id, type from wp_procedure_file_type")[self::DATA];
}
The method update_user_info is not named in camelCase.
public function update_user_info(WP_User $user, array $user_info)
{
array_pop($user_info);
foreach ($user_info as $key => $value) {
add_user_meta($user->ID, $key, $value, true);
The method get_procedure_status is not named in camelCase.
public function get_procedure_status()
{
return $this->db->get_query("select id, status from wp_procedure_status")[self::DATA];
}
The method get_order_and_procedure is not named in camelCase.
public function get_order_and_procedure(string $procedure_id): array
{
$procedure_data = $this->db->get_query("select p.id,
creation_date,
update_date,
The method create_procedure is not named in camelCase.
public function create_procedure(int $user_id, int $procedure_type, float $amount, string $payment_info): bool
{
return $this->db->execute_query(" insert into wp_procedure(user_id,status_id,procedure_type,amount,payment_info)
values(:user_id, :status_id, :procedure_type, :amount, :payment_info) ",
[
The method remove_procedure_file is not named in camelCase.
public function remove_procedure_file(string $procedure_id, string $file_id): bool
{
return $this->db->execute_query("delete from wp_procedure_file where procedure_id = :procedure_id and id= :file_id",
["procedure_id" => $procedure_id, "file_id" => $file_id]);
}
The method get_identification__types is not named in camelCase.
public static function get_identification__types(): array
{
return ["NIE" => "NIE", "DNI" => "DNI", "PASAPORTE" => "PASAPORTE"];
}
There are no issues that match your filters.