DesarrollosWeb/documentofacil

View on GitHub
redirect.php

Summary

Maintainability
A
0 mins
Test Coverage

Showing 17 of 17 total issues

syntax error, unexpected '=>' (T_DOUBLE_ARROW), expecting ',' or ')'
Open

$files_path = array_map(fn($element) => $element["file_path"], $user_files["data"]);
Severity: Critical
Found in redirect.php by phan

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 29 and the first side effect is on line 4.
Open

<?php
Severity: Minor
Found in redirect.php by phpcodesniffer

The parameter $folder_name is not named in camelCase.
Open

function create_user_folder(Client $client, string $folder_id, string $folder_name): ?DriveItemProxy
{
try {
$folder = $client->getMyDrive()->getDriveItemById($folder_id);
$folder = $folder->createFolder($folder_name);
Severity: Minor
Found in redirect.php by phpmd

The parameter $folder_id is not named in camelCase.
Open

function create_user_folder(Client $client, string $folder_id, string $folder_name): ?DriveItemProxy
{
try {
$folder = $client->getMyDrive()->getDriveItemById($folder_id);
$folder = $folder->createFolder($folder_name);
Severity: Minor
Found in redirect.php by phpmd

Line exceeds 120 characters; contains 136 characters
Open

return $procedure["document_type"] . $procedure["document_number"] . "_" . $procedure["first_name"] . "-" . $procedure["last_name"];
Severity: Minor
Found in redirect.php by phpcodesniffer

Line exceeds 120 characters; contains 133 characters
Open

$items[$filename] = $folder->upload($filename, fopen($file, "r"), ["conflictBehavior" => ConflictBehavior::REPLACE]);
Severity: Minor
Found in redirect.php by phpcodesniffer

Line exceeds 120 characters; contains 149 characters
Open

<option value="<?= $child->id ?>"><?= $child->name . " (" . $child->folder->childCount . ")"; ?></option>
Severity: Minor
Found in redirect.php by phpcodesniffer

Expected 1 space after closing parenthesis; found 0
Open

<?php foreach ($items as $item): ?>
Severity: Minor
Found in redirect.php by phpcodesniffer

Expected 1 space after ELSE keyword; 0 found
Open

<?php else: ?>
Severity: Minor
Found in redirect.php by phpcodesniffer

Expected 0 spaces after opening bracket; newline found
Open

if (
Severity: Minor
Found in redirect.php by phpcodesniffer

Opening parenthesis of a multi-line function call must be the last content on the line
Open

$client = Onedrive::client(ONEDRIVE_CLIENT_ID,
Severity: Minor
Found in redirect.php by phpcodesniffer

Expected 1 space after closing parenthesis; found 0
Open

<?php foreach ($children as $child): ?>
Severity: Minor
Found in redirect.php by phpcodesniffer

Expected 1 space after closing parenthesis; found 0
Open

<?php if (isset($items)): ?>
Severity: Minor
Found in redirect.php by phpcodesniffer

The variable $folder_name is not named in camelCase.
Open

function create_user_folder(Client $client, string $folder_id, string $folder_name): ?DriveItemProxy
{
try {
$folder = $client->getMyDrive()->getDriveItemById($folder_id);
$folder = $folder->createFolder($folder_name);
Severity: Minor
Found in redirect.php by phpmd

The variable $folder_id is not named in camelCase.
Open

function create_user_folder(Client $client, string $folder_id, string $folder_name): ?DriveItemProxy
{
try {
$folder = $client->getMyDrive()->getDriveItemById($folder_id);
$folder = $folder->createFolder($folder_name);
Severity: Minor
Found in redirect.php by phpmd

The variable $folder_name is not named in camelCase.
Open

function create_user_folder(Client $client, string $folder_id, string $folder_name): ?DriveItemProxy
{
try {
$folder = $client->getMyDrive()->getDriveItemById($folder_id);
$folder = $folder->createFolder($folder_name);
Severity: Minor
Found in redirect.php by phpmd

The variable $folder_name is not named in camelCase.
Open

function create_user_folder(Client $client, string $folder_id, string $folder_name): ?DriveItemProxy
{
try {
$folder = $client->getMyDrive()->getDriveItemById($folder_id);
$folder = $folder->createFolder($folder_name);
Severity: Minor
Found in redirect.php by phpmd
Category
Status