Completed
Push — issue/96 ( 8680e7...cc85b0 )
by Alex
02:21
created

Json::canHandle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 1
crap 1
1
<?php
2
/*
3
 * This file is part of the feed-io package.
4
 *
5
 * (c) Alexandre Debril <[email protected]>
6
 *
7
 * For the full copyright and license information, please view the LICENSE
8
 * file that was distributed with this source code.
9
 */
10
11
namespace FeedIo\Standard;
12
13
14
use FeedIo\Formatter\JsonFormatter;
15
use FeedIo\Reader\Document;
16
use FeedIo\StandardAbstract;
17
18
class Json extends StandardAbstract
19
{
20
21
    const SYNTAX_FORMAT = 'Json';
22
23
    /**
24
     * @param Document $document
25
     * @return bool
26
     */
27 2
    public function canHandle(Document $document)
28
    {
29 2
        return $document->isJson();
30
    }
31
32
    /**
33
     * @return JsonFormatter
34
     */
35
    public function getFormatter()
36
    {
37
        return new JsonFormatter();
38
    }
39
40
}