Issues (339)

src/UploaderManager.php (19 issues)

1
<?php
0 ignored issues
show
This file is missing a doc comment.
Loading history...
The PHP open tag does not have a corresponding PHP close tag
Loading history...
Filename "UploaderManager.php" doesn't match the expected filename "uploadermanager.php"
Loading history...
2
namespace UniSharp\Uploadable;
0 ignored issues
show
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
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
Expected 2 blank lines before function; 0 found
Loading history...
Missing function doc comment
Loading history...
Short array syntax is not allowed
Loading history...
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
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
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
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');
19
            }
20
21
            if ($callback) {
22
                $callback();
23
            }
24
        });
0 ignored issues
show
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
Expected 2 blank lines after function; 0 found
Loading history...
Expected 1 blank line before closing function brace; 0 found
Loading history...
Expected //end route()
Loading history...
26
}
0 ignored issues
show
Expected //end class
Loading history...
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