Completed
Pull Request — master (#2)
by Pol
06:02
created

Provider   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 28
Duplicated Lines 0 %

Coupling/Cohesion

Dependencies 1

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
wmc 2
c 0
b 0
f 0
cbo 1
dl 0
loc 28
ccs 0
cts 10
cp 0
rs 10

2 Methods

Rating   Name   Duplication   Size   Complexity  
A withResource() 0 7 1
A getResource() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace drupol\Yaroc\Plugin\Method;
6
7
use drupol\Yaroc\Plugin\AbstractProvider;
8
use drupol\Yaroc\Plugin\ProviderInterface;
9
10
/**
11
 * Class Provider.
12
 */
13
class Provider extends AbstractProvider
14
{
15
    /**
16
     * @var string
17
     */
18
    private $resource;
19
20
    /**
21
     * @param string $resource
22
     *
23
     * @return \drupol\Yaroc\Plugin\ProviderInterface
24
     */
25
    public static function withResource(string $resource) :ProviderInterface
26
    {
27
        $clone = new static();
28
        $clone->resource = $resource;
29
30
        return $clone;
31
    }
32
33
    /**
34
     * @return string
35
     */
36
    public function getResource(): string
37
    {
38
        return $this->resource;
39
    }
40
}
41