Passed
Push — master ( 517cb3...2c2725 )
by Atanas
02:15
created

WordPress   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 12
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
dl 0
loc 12
rs 10
c 0
b 0
f 0
wmc 1
lcom 0
cbo 1

1 Method

Rating   Name   Duplication   Size   Complexity  
A handle() 0 3 1
1
<?php
2
3
namespace WPEmerge\Controllers;
4
5
use WPEmerge\Request;
6
use Psr\Http\Message\ResponseInterface;
7
8
/**
9
 * Handles normal WordPress requests without interfering
10
 * Useful if you only want to add a middleware to a route without handling the output
11
 *
12
 * @codeCoverageIgnore
13
 */
14
class WordPress {
15
	/**
16
	 * Default WordPress handler
17
	 *
18
	 * @param  Request           $request
19
	 * @param  string            $template
20
	 * @return ResponseInterface
21
	 */
22
	public function handle( Request $request, $template ) {
23
		return wpm_template( $template )->withStatus( http_response_code() );
24
	}
25
}
26