ModelFractalPresenter::getTransformer()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 9
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
eloc 4
nc 2
nop 0
dl 0
loc 9
ccs 0
cts 7
cp 0
crap 6
rs 9.6666
c 0
b 0
f 0
1
<?php
2
/*
3
 * This file is part of the Laravel Platfourm package.
4
 *
5
 * (c) Avtandil Kikabidze aka LONGMAN <[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 Longman\Platfourm\Repository\Presenter;
12
13
use Exception;
14
use Longman\Platfourm\Repository\Transformer\ModelTransformer;
15
16
/**
17
 * Class ModelFractalPresenter.
18
 */
19
class ModelFractalPresenter extends FractalPresenter
20
{
21
    /**
22
     * Transformer.
23
     *
24
     * @throws Exception
25
     *
26
     * @return ModelTransformer
27
     */
28
    public function getTransformer()
29
    {
30
31
        if (!class_exists('League\Fractal\Manager')) {
32
            throw new Exception("Package required. Please install: 'composer require league/fractal' (0.12.*)");
33
        }
34
35
        return new ModelTransformer();
36
    }
37
38
}
39