Completed
Push — master ( a775f9...497487 )
by Alex
07:59
created

Json::canHandle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 4
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 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
    protected $mandatoryFields = ['version', 'title', 'items'];
24
25
    /**
26
     * @param Document $document
27
     * @return bool
28
     */
29
    public function canHandle(Document $document)
30
    {
31
        return $document->isJson();
32
    }
33
34
    /**
35
     * @return JsonFormatter
36
     */
37
    public function getFormatter()
38
    {
39
        return new JsonFormatter();
40
    }
41
42
}
43