Helpers   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 11
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A bindUploadable() 0 9 2
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 "Helpers.php" doesn't match the expected filename "helpers.php"
Loading history...
2
0 ignored issues
show
Coding Style introduced by
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
Coding Style introduced by
Missing class doc comment
Loading history...
8
{
0 ignored issues
show
Coding Style introduced by
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
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
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
Coding Style introduced by
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
Bug introduced by
$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
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 bindUploadable()
Loading history...
19
}
0 ignored issues
show
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...
20