Test Failed
Push — master ( 98f74e...fae1a9 )
by Terzi
04:51
created

AcceptsCustomFormat::hasFormat()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Terranet\Administrator\Field\Traits;
4
5
trait AcceptsCustomFormat
6
{
7
    /** @var null\Closure */
0 ignored issues
show
Bug introduced by
The type Terranet\Administrator\Field\Traits\null\Closure was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
8
    protected $format;
9
10
    /**
11
     * @return bool
12
     */
13
    public function hasFormat()
14
    {
15
        return null !== $this->format;
16
    }
17
18
    /**
19
     * @param \Closure $format
20
     *
21
     * @return BelongsTo
0 ignored issues
show
Bug introduced by
The type Terranet\Administrator\Field\Traits\BelongsTo was not found. Maybe you did not declare it correctly or list all dependencies?

The issue could also be caused by a filter entry in the build configuration. If the path has been excluded in your configuration, e.g. excluded_paths: ["lib/*"], you can move it to the dependency path list as follows:

filter:
    dependency_paths: ["lib/*"]

For further information see https://scrutinizer-ci.com/docs/tools/php/php-scrutinizer/#list-dependency-paths

Loading history...
22
     */
23
    public function renderAs(\Closure $format): self
24
    {
25
        $this->format = $format;
0 ignored issues
show
Documentation Bug introduced by
It seems like $format of type Closure is incompatible with the declared type Terranet\Administrator\Field\Traits\null\Closure of property $format.

Our type inference engine has found an assignment to a property that is incompatible with the declared type of that property.

Either this assignment is in error or the assigned type should be added to the documentation/type hint for that property..

Loading history...
26
27
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type Terranet\Administrator\F...its\AcceptsCustomFormat which is incompatible with the documented return type Terranet\Administrator\Field\Traits\BelongsTo.
Loading history...
28
    }
29
30
    /**
31
     * @param $args
32
     *
33
     * @return mixed
34
     */
35
    protected function callFormatter($args)
36
    {
37
        return call_user_func_array($this->format, $args);
38
    }
39
}
40