PhpEngine   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 38
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 3

Importance

Changes 0
Metric Value
wmc 2
lcom 1
cbo 3
dl 0
loc 38
rs 10
c 0
b 0
f 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A get() 0 6 1
A handleViewException() 0 9 1
1
<?php
2
3
namespace Facade\Ignition\Views\Engines;
4
5
use Exception;
6
use Facade\Ignition\Exceptions\ViewException;
7
use Facade\Ignition\Views\Concerns\CollectsViewExceptions;
8
use Throwable;
9
10
class PhpEngine extends \Illuminate\View\Engines\PhpEngine
11
{
12
    use CollectsViewExceptions;
13
14
    /**
15
     * Get the evaluated contents of the view.
16
     *
17
     * @param  string  $path
18
     * @param  array   $data
19
     * @return string
20
     */
21
    public function get($path, array $data = [])
22
    {
23
        $this->collectViewData($path, $data);
24
25
        return parent::get($path, $data);
26
    }
27
28
    /**
29
     * Handle a view exception.
30
     *
31
     * @param  \Exception  $baseException
32
     * @param  int  $obLevel
33
     *
34
     * @return void
35
     *
36
     * @throws \Exception
37
     */
38
    protected function handleViewException(Throwable $baseException, $obLevel)
39
    {
40
        $exception = new ViewException($baseException->getMessage(), 0, 1, $baseException->getFile(), $baseException->getLine(), $baseException);
41
42
        $exception->setView($this->getCompiledViewName($baseException->getFile()));
43
        $exception->setViewData($this->getCompiledViewData($baseException->getFile()));
44
45
        parent::handleViewException($exception, $obLevel);
46
    }
47
}
48