Completed
Pull Request — master (#98)
by
unknown
02:12
created

Put::__construct()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 12
Code Lines 7

Duplication

Lines 12
Ratio 100 %

Code Coverage

Tests 7
CRAP Score 2.0078

Importance

Changes 0
Metric Value
dl 12
loc 12
ccs 7
cts 8
cp 0.875
rs 9.4285
c 0
b 0
f 0
cc 2
eloc 7
nc 2
nop 2
crap 2.0078
1
<?php
2
declare(strict_types=1);
3
namespace Zewa\HTTP;
4
5
use Zewa\Container;
6
use Zewa\Security;
7
8 View Code Duplication
final class Put extends SuperGlobal
0 ignored issues
show
Duplication introduced by
This class seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
9
{
10 8
    public function __construct(Container $container, Security $security)
11
    {
12 8
        parent::__construct($container, $security);
13
14 8
        if ($_SERVER['REQUEST_METHOD'] === "PUT") {
15 5
            parse_str(file_get_contents('php://input', "r"), $put);
16
            $_POST = [];
17
        }
18
19 3
        $put = $put ?? [];
20 3
        $this->registerGlobal($put);
21 3
    }
22
}
23