Completed
Push — master ( 7d8cfa...b405b6 )
by Woody
10s
created

JsonContentHandler::__construct()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 3
1
<?php
2
3
namespace Equip\Handler;
4
5
use Equip\Exception\HttpException;
6
use Relay\Middleware\JsonContentHandler as AbstractHandler;
7
8
/**
9
 * @deprecated 1.4.0 Switched to Relay.Middleware
10
 */
11
class JsonContentHandler extends AbstractHandler
12
{
13
    /**
14
     * @inheritDoc
15
     */
16
    public function __construct($assoc = true, $maxDepth = 512, $options = 0)
17
    {
18
        return parent::__construct($assoc, $maxDepth, $options);
19
    }
20
21
    /**
22
     * @inheritDoc
23
     */
24
    protected function isApplicableMimeType($mime)
25
    {
26
        return preg_match('~^application/([a-z.]+\+)?json$~', $mime);
27
    }
28
29
    /**
30
     * @inheritDoc
31
     */
32
    protected function throwException($message)
33
    {
34
        throw HttpException::badRequest($message);
35
    }
36
}
37