Passed
Push — master ( b7467b...db04eb )
by Atanas
02:41
created

WordPress::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 2
nc 1
nop 2
dl 0
loc 3
rs 10
c 0
b 0
f 0
1
<?php
2
3
namespace Obsidian\Controllers;
4
5
use Obsidian\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 cf_template( $template )->withStatus( http_response_code() );
24
	}
25
}
26