Completed
Push — master ( a2f223...c69a80 )
by
unknown
30s
created

Delete   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

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

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 12 2
1
<?php
2
declare(strict_types=1);
3
namespace Zewa\HTTP;
4
5
use Zewa\Container;
6
use Zewa\Security;
7
8
final class Delete extends SuperGlobal
9
{
10 8
    public function __construct(Container $container, Security $security)
11
    {
12 8
        parent::__construct($container, $security);
13
14 8
        if ($_SERVER['REQUEST_METHOD'] === "DELETE") {
15 1
            parse_str(file_get_contents('php://input'), $delete);
16 1
            $_POST = [];
17
        }
18
19 8
        $delete = $delete ?? [];
20 8
        $this->registerGlobal($delete);
21 8
    }
22
}
23