Completed
Push — master ( 2c7d6b...daeaf4 )
by Terzi
03:36
created

AcceptsCustomFormat::renderAs()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 1
dl 0
loc 5
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
     * @param \Closure $format
12
     *
13
     * @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...
14
     */
15
    public function renderAs(\Closure $format): self
16
    {
17
        $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...
18
19
        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...
20
    }
21
22
    /**
23
     * @param $args
24
     *
25
     * @return mixed
26
     */
27
    protected function callFormatter($args)
28
    {
29
        return call_user_func_array($this->format, $args);
30
    }
31
}
32