Completed
Pull Request — 2.0 (#18)
by David
02:19
created

ZohoUserService::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
dl 0
loc 4
rs 10
c 1
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
1
<?php
2
3
4
namespace Wabel\Zoho\CRM\Copy;
5
6
use Wabel\Zoho\CRM\Request\Response;
7
use Wabel\Zoho\CRM\ZohoClient;
8
9
/**
10
 * This class acts as a cache for fetching users from Zoho.
11
 */
12
class ZohoUserService
13
{
14
15
    /**
16
     * @var ZohoClient
17
     */
18
    private $zohoClient;
19
20
    /**
21
     * @var Response
22
     */
23
    private $usersResponse;
24
25
    public function __construct(ZohoClient $zohoClient)
26
    {
27
        $this->zohoClient = $zohoClient;
28
    }
29
30
    /**
31
     * @return Response
32
     */
33
    public function getUsers()
34
    {
35
        if ($this->usersResponse !== null) {
36
            return $this->usersResponse();
0 ignored issues
show
Bug introduced by
The method usersResponse() does not seem to exist on object<Wabel\Zoho\CRM\Copy\ZohoUserService>.

This check looks for calls to methods that do not seem to exist on a given type. It looks for the method on the type itself as well as in inherited classes or implemented interfaces.

This is most likely a typographical error or the method has been renamed.

Loading history...
37
        }
38
39
        $this->usersResponse = $this->zohoClient->getUsers();
40
        return $this->usersResponse;
41
    }
42
}
43