Completed
Push — master ( 4358fc...59fc37 )
by Andrii
16:30 queued 01:25
created

MethodDeleteAction   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 14
Duplicated Lines 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
eloc 3
c 1
b 0
f 0
dl 0
loc 14
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __invoke() 0 2 1
A __construct() 0 3 1
1
<?php
2
3
namespace hiqdev\billing\hiapi\method\Delete;
4
5
use hiqdev\billing\hiapi\method\Create\MethodCreateCommand;
6
use hiqdev\billing\hiapi\method\MethodRepository;
7
use hiqdev\php\billing\method\Method;
0 ignored issues
show
Bug introduced by
The type hiqdev\php\billing\method\Method 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
9
class MethodDeleteAction
10
{
11
    /**
12
     * @var MethodRepository
13
     */
14
    private $repo;
15
16
    public function __construct(MethodRepository $repo)
17
    {
18
        $this->repo = $repo;
19
    }
20
21
    public function __invoke(MethodCreateCommand $command): Method
22
    {
23
    }
0 ignored issues
show
Bug Best Practice introduced by
In this branch, the function will implicitly return null which is incompatible with the type-hinted return hiqdev\php\billing\method\Method. Consider adding a return statement or allowing null as return value.

For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example:

interface ReturnsInt {
    public function returnsIntHinted(): int;
}

class MyClass implements ReturnsInt {
    public function returnsIntHinted(): int
    {
        if (foo()) {
            return 123;
        }
        // here: null is implicitly returned
    }
}
Loading history...
24
}
25