DisplaysExceptions   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 29
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 3
lcom 1
cbo 0
dl 0
loc 29
rs 10
c 1
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A displayExceptions() 0 12 3
1
<?php namespace Cerbero\Auth\Exceptions;
2
3
use \Exception;
4
5
/**
6
 * Trait to render the exceptions.
7
 *
8
 * @author	Andrea Marco Sartori
9
 */
10
trait DisplaysExceptions {
11
12
	/**
13
	 * @author	Andrea Marco Sartori
14
	 * @var		array	$display	Exceptions to display to the user.
15
	 */
16
	protected $display = array();
17
18
	/**
19
	 * Determine how to render the DisplayException.
20
	 *
21
	 * @author	Andrea Marco Sartori
22
	 * @param	\Exception	$e
23
	 * @return	Illuminate\Http\RedirectResponse
24
	 */
25
	protected function displayExceptions(Exception $e)
26
	{
27
		$this->display[] = 'Cerbero\Auth\Exceptions\DisplayException';
28
29
		foreach ($this->display as $exception)
30
		{
31
			if($e instanceof $exception)
32
			{
33
				return back()->withInput()->withError($e->getMessage());
34
			}
35
		}
36
	}
37
38
}
39