ErrorMiddleware   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 20
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 1

Importance

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

2 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 3 1
A afterException() 0 3 1
1
<?php
2
3
namespace OCA\Chat\Middleware;
4
5
use \OCP\AppFramework\Middleware;
6
use \OCA\Chat\App\Chat;
7
8
class ErrorMiddleware extends Middleware {
9
10
	/**
11
	 * @var Chat
12
	 */
13
	private $app;
14
15
	public function __construct(Chat $app){
16
		$this->app = $app;
17
	}
18
19
20
	/**
21
	 * this replaces "bad words" with "********" in the output
22
	 */
23
	public function afterException($controller, $methodName, \Exception $e){
24
		$this->app->exceptionHandler($e);
25
	}
26
27
}