Passed
Push — master ( fa63c5...708113 )
by
unknown
01:57
created

WordPress::handle()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

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
ccs 0
cts 2
cp 0
crap 2
1
<?php
2
3
namespace CarbonFramework\Controllers;
4
5
use CarbonFramework\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
class WordPress {
13
	/**
14
	 * Default WordPress handler
15
	 *
16
	 * @param  Request           $file
0 ignored issues
show
Bug introduced by
There is no parameter named $file. Was it maybe removed?

This check looks for PHPDoc comments describing methods or function parameters that do not exist on the corresponding method or function.

Consider the following example. The parameter $italy is not defined by the method finale(...).

/**
 * @param array $germany
 * @param array $island
 * @param array $italy
 */
function finale($germany, $island) {
    return "2:1";
}

The most likely cause is that the parameter was removed, but the annotation was not.

Loading history...
17
	 * @param  string            $template
18
	 * @return ResponseInterface
19
	 */
20
	public function handle( Request $request, $template ) {
21
		return cf_template( $template )->withStatus( http_response_code() );
22
	}
23
}
24