ModelFractalPresenter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 2

Test Coverage

Coverage 0%

Importance

Changes 0
Metric Value
dl 0
loc 20
ccs 0
cts 7
cp 0
rs 10
c 0
b 0
f 0
wmc 2
lcom 0
cbo 2

1 Method

Rating   Name   Duplication   Size   Complexity  
A getTransformer() 0 9 2
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