UploaderManager   A
last analyzed

Complexity

Total Complexity 4

Size/Duplication

Total Lines 17
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 4
eloc 9
dl 0
loc 17
ccs 0
cts 8
cp 0
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A route() 0 15 4
1
<?php
0 ignored issues
show
Coding Style introduced by
This file is missing a doc comment.
Loading history...
Coding Style introduced by
The PHP open tag does not have a corresponding PHP close tag
Loading history...
Coding Style introduced by
Filename "UploaderManager.php" doesn't match the expected filename "uploadermanager.php"
Loading history...
2
namespace UniSharp\Uploadable;
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
4
use Illuminate\Support\Facades\Route;
5
6
class UploaderManager
0 ignored issues
show
Coding Style Documentation introduced by
Missing class doc comment
Loading history...
7
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class UploaderManager
Loading history...
8
    public static function route($enable = ['store', 'delete'], callable $callback = null): void
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines before function; 0 found
Loading history...
Coding Style introduced by
Missing function doc comment
Loading history...
Coding Style introduced by
Short array syntax is not allowed
Loading history...
Coding Style introduced by
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
9
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
10
        Route::prefix('files')->group(function () use ($enable, $callback) {
0 ignored issues
show
Coding Style introduced by
The opening parenthesis of a multi-line function call should be the last content on the line.
Loading history...
11
            $namespace = '\\UniSharp\\Uploadable\\Http\\Controllers\\Api\\V1\\';
12
13
            if (in_array('store', $enable)) {
14
                Route::post('/', $namespace . 'UploadController@store');
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
15
            }
16
17
            if (in_array('delete', $enable)) {
18
                Route::delete('{file}', $namespace . 'UploadController@destroy');
0 ignored issues
show
Coding Style introduced by
Concat operator must not be surrounded by spaces
Loading history...
19
            }
20
21
            if ($callback) {
22
                $callback();
23
            }
24
        });
0 ignored issues
show
Coding Style introduced by
For multi-line function calls, the closing parenthesis should be on a new line.

If a function call spawns multiple lines, the coding standard suggests to move the closing parenthesis to a new line:

someFunctionCall(
    $firstArgument,
    $secondArgument,
    $thirdArgument
); // Closing parenthesis on a new line.
Loading history...
25
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 0 found
Loading history...
Coding Style introduced by
Expected 1 blank line before closing function brace; 0 found
Loading history...
Coding Style introduced by
Expected //end route()
Loading history...
26
}
0 ignored issues
show
Coding Style introduced by
Expected //end class
Loading history...
Coding Style introduced by
As per coding style, files should not end with a newline character.

This check marks files that end in a newline character, i.e. an empy line.

Loading history...
27