Completed
Push — master ( 7d8379...bf3c75 )
by Dominik
04:40 queued 03:00
created

AllowOriginExact   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 25
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Test Coverage

Coverage 100%

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
A match() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Chubbyphp\Cors\Negotiation\Origin;
6
7
final class AllowOriginExact implements AllowOriginInterface
8
{
9
    /**
10
     * @var string
11
     */
12
    private $value;
13
14
    /**
15
     * @param string $value
16
     */
17 2
    public function __construct(string $value)
18
    {
19 2
        $this->value = $value;
20 2
    }
21
22
    /**
23
     * @param string $origin
24
     *
25
     * @return bool
26
     */
27 2
    public function match(string $origin): bool
28
    {
29 2
        return $this->value === $origin;
30
    }
31
}
32