Completed
Pull Request — master (#1)
by Bogdan
06:53 queued 03:12
created

ThrowSpec   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 37
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Test Coverage

Coverage 50%

Importance

Changes 0
Metric Value
wmc 3
lcom 0
cbo 0
dl 0
loc 37
ccs 4
cts 8
cp 0.5
rs 10
c 0
b 0
f 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getClass() 0 4 1
A getHandler() 0 4 1
1
<?php declare(strict_types=1);
2
3
/*
4
 * This file is part of the pinepain/js-sandbox PHP library.
5
 *
6
 * Copyright (c) 2016-2017 Bogdan Padalko <[email protected]>
7
 *
8
 * Licensed under the MIT license: http://opensource.org/licenses/MIT
9
 *
10
 * For the full copyright and license information, please view the
11
 * LICENSE file that was distributed with this source or visit
12
 * http://opensource.org/licenses/MIT
13
 */
14
15
16
namespace Pinepain\JsSandbox\Specs\ThrowSpec;
17
18
19
use Pinepain\JsSandbox\Specs\ExceptionHandlers\ExceptionHandlerInterface;
20
21
22
class ThrowSpec implements ThrowSpecInterface
23
{
24
    /**
25
     * @var string
26
     */
27
    private $class;
28
    /**
29
     * @var ExceptionHandlerInterface
30
     */
31
    private $handler;
32
33
    /**
34
     * @param string                    $class
35
     * @param ExceptionHandlerInterface $handler
36
     */
37 1
    public function __construct(string $class, ExceptionHandlerInterface $handler)
38
    {
39 1
        $this->class   = $class;
40 1
        $this->handler = $handler;
41 1
    }
42
43
    /**
44
     * {@inheritdoc}
45
     */
46
    public function getClass(): string
47
    {
48
        return $this->class;
49
    }
50
51
    /**
52
     * {@inheritdoc}
53
     */
54
    public function getHandler(): ExceptionHandlerInterface
55
    {
56
        return $this->handler;
57
    }
58
}
59