ModelFractalPresenter::getTransformer()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 7
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 3
dl 0
loc 7
rs 10
c 1
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
namespace Salah3id\Domains\Repository\Presenter;
3
4
use Exception;
5
use Salah3id\Domains\Repository\Transformer\ModelTransformer;
6
7
/**
8
 * Class ModelFractalPresenter
9
 * @package Salah3id\Domains\Repository\Presenter
10
 * @author Anderson Andrade <[email protected]>
11
 */
12
class ModelFractalPresenter extends FractalPresenter
13
{
14
15
    /**
16
     * Transformer
17
     *
18
     * @return ModelTransformer
19
     * @throws Exception
20
     */
21
    public function getTransformer()
22
    {
23
        if (!class_exists('League\Fractal\Manager')) {
24
            throw new Exception("Package required. Please install: 'composer require league/fractal' (0.12.*)");
25
        }
26
27
        return new ModelTransformer();
28
    }
29
}
30