UploadController   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
eloc 4
dl 0
loc 12
ccs 0
cts 5
cp 0
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A store() 0 3 1
A destroy() 0 5 1
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 "UploadController.php" doesn't match the expected filename "uploadcontroller.php"
Loading history...
2
0 ignored issues
show
Coding Style introduced by
Missing file doc comment
Loading history...
3
namespace UniSharp\Uploadable\Http\Controllers\Api\V1;
4
5
use Illuminate\Http\Request;
6
use UniSharp\Uploadable\File;
7
use UniSharp\Uploadable\Uploader;
8
use Illuminate\Routing\Controller;
9
10
class UploadController extends Controller
0 ignored issues
show
Coding Style Documentation introduced by
Missing class doc comment
Loading history...
11
{
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration for class UploadController
Loading history...
12
    public function store(Request $request)
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...
13
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
14
        return Uploader::upload(array_first($request->file()));
15
    }
0 ignored issues
show
Coding Style introduced by
Expected 2 blank lines after function; 1 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 store()
Loading history...
16
17
    public function destroy(File $file)
0 ignored issues
show
Coding Style introduced by
Missing function doc comment
Loading history...
18
    {
0 ignored issues
show
Coding Style introduced by
Opening brace should be on the same line as the declaration
Loading history...
19
        $file->remove();
20
21
        return ['success' => true];
0 ignored issues
show
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 true please use TRUE.
Loading history...
22
    }
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 destroy()
Loading history...
23
}
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...
24