GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — 3.x ( 854d93...81f322 )
by Jindřich
01:52
created

WebServiceFactory::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 8

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 4
CRAP Score 2.032

Importance

Changes 0
Metric Value
dl 0
loc 8
ccs 4
cts 5
cp 0.8
rs 10
c 0
b 0
f 0
cc 2
nc 2
nop 1
crap 2.032
1
<?php
2
declare(strict_types = 1);
3
4
namespace Skautis\Wsdl;
5
6
use Skautis\InvalidArgumentException;
7
8
/**
9
 * @inheritdoc
10
 */
11
class WebServiceFactory implements WebServiceFactoryInterface
12
{
13
14
    /** @var string Třída webové služby */
15
    protected $class;
16
17
18 2
    public function __construct(string $className = WebService::class)
19
    {
20 2
       if (!is_a($className, WebServiceInterface::class, true)) {
21
         throw new InvalidArgumentException("Argument must be class name of a class implementing WebServiceInterface. '$className' given");
22
       }
23
24 2
        $this->class = $className;
25 2
    }
26
27
    /**
28
     * @inheritdoc
29
     */
30 1
    public function createWebService(string $url, array $options): WebServiceInterface
31
    {
32 1
        return new $this->class($url, $options);
33
    }
34
}
35