Issues (339)

src/Traits/Helpers.php (15 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 "Helpers.php" doesn't match the expected filename "helpers.php"
Loading history...
2
0 ignored issues
show
Missing file doc comment
Loading history...
3
namespace UniSharp\Uploadable\Traits;
4
5
use UniSharp\Uploadable\File;
6
7
trait Helpers
0 ignored issues
show
Missing class doc comment
Loading history...
8
{
0 ignored issues
show
Opening brace should be on the same line as the declaration for trait Helpers
Loading history...
9 8
    protected function bindUploadable(File $file, $extra = null): self
0 ignored issues
show
Expected 2 blank lines before function; 0 found
Loading history...
Missing function doc comment
Loading history...
TRUE, FALSE and NULL should be uppercase as per the configured coding-style; instead of null please use NULL.
Loading history...
10
    {
0 ignored issues
show
Opening brace should be on the same line as the declaration
Loading history...
11 8
        if ($extra) {
12 4
            $file->extra = $extra;
13
        }
14
15 8
        $file->uploadable()->associate($this)->save();
0 ignored issues
show
$this of type UniSharp\Uploadable\Traits\Helpers is incompatible with the type Illuminate\Database\Eloquent\Model expected by parameter $model of Illuminate\Database\Eloq...ns\MorphTo::associate(). ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-type  annotation

15
        $file->uploadable()->associate(/** @scrutinizer ignore-type */ $this)->save();
Loading history...
16
17 8
        return $this;
18
    }
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 bindUploadable()
Loading history...
19
}
0 ignored issues
show
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...
20