Completed
Push — 3.x ( e32815...7c4255 )
by Ryota
09:26 queued 05:13
created

Status::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5

Duplication

Lines 5
Ratio 100 %

Importance

Changes 0
Metric Value
dl 5
loc 5
rs 10
c 0
b 0
f 0
cc 1
nc 1
nop 2
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Polidog\Chatwork\Api\My;
6
7
use Polidog\Chatwork\Client\ClientInterface;
8
use Polidog\Chatwork\Entity\Factory\StatusFactory;
9
10 View Code Duplication
class Status
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
11
{
12
    /**
13
     * @var ClientInterface
14
     */
15
    private $client;
16
17
    /**
18
     * @var StatusFactory
19
     */
20
    private $factory;
21
22
    /**
23
     * Status constructor.
24
     *
25
     * @param ClientInterface $client
26
     * @param StatusFactory   $factory
27
     */
28
    public function __construct(ClientInterface $client, StatusFactory $factory)
29
    {
30
        $this->client = $client;
31
        $this->factory = $factory;
32
    }
33
34
    public function show()
35
    {
36
        return $this->factory->entity(
37
            $this->client->get('my/status')
38
        );
39
    }
40
}
41