Passed
Push — main ( dd7998...bae415 )
by Dylan
03:01
created

ApiResource   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A getClient() 0 3 1
A setClient() 0 4 1
1
<?php
2
3
namespace Lifeboat\Resource;
4
5
use Lifeboat\Connector;
6
7
/**
8
 * Class ApiResource
9
 * @package Lifeboat\Resource
10
 *
11
 * @property Connector|null $_client
12
 */
13
abstract class ApiResource implements \ArrayAccess, \Countable {
14
15
    private $_client;
16
17
    /**
18
     * @param Connector $_client
19
     * @return $this
20
     */
21
    public function setClient(Connector $_client): ApiResouce
0 ignored issues
show
Bug introduced by
The type Lifeboat\Resource\ApiResouce 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
        $this->_client = $_client;
24
        return $this;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this returns the type Lifeboat\Resource\ApiResource which is incompatible with the type-hinted return Lifeboat\Resource\ApiResouce.
Loading history...
25
    }
26
27
    /**
28
     * @return Connector
29
     */
30
    public function getClient(): Connector
31
    {
32
        return $this->_client;
0 ignored issues
show
Bug Best Practice introduced by
The expression return $this->_client could return the type null which is incompatible with the type-hinted return Lifeboat\Connector. Consider adding an additional type-check to rule them out.
Loading history...
33
    }
34
}
35