Code Duplication    Length = 16-16 lines in 2 locations

Zewa/HTTP/Delete.php 1 location

@@ 8-23 (lines=16) @@
5
use Zewa\Container;
6
use Zewa\Security;
7
8
final class Delete extends SuperGlobal
9
{
10
    public function __construct(Container $container, Security $security)
11
    {
12
        parent::__construct($container, $security);
13
14
        if ($_SERVER['REQUEST_METHOD'] === "DELETE") {
15
            parse_str(file_get_contents('php://input', "r"), $delete);
16
            $_POST = [];
17
        }
18
19
        $delete = $delete ?? [];
20
        $this->registerGlobal($delete);
21
    }
22
}
23

Zewa/HTTP/Put.php 1 location

@@ 8-23 (lines=16) @@
5
use Zewa\Container;
6
use Zewa\Security;
7
8
final class Put extends SuperGlobal
9
{
10
    public function __construct(Container $container, Security $security)
11
    {
12
        parent::__construct($container, $security);
13
14
        if ($_SERVER['REQUEST_METHOD'] === "PUT") {
15
            parse_str(file_get_contents('php://input', "r"), $put);
16
            $_POST = [];
17
        }
18
19
        $put = $put ?? [];
20
        $this->registerGlobal($put);
21
    }
22
}
23