Passed
Push — master ( 0ec5dd...682a54 )
by
unknown
01:50
created

functions.php ➔ cf_redirect()   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
use CarbonFramework\Response;
4
5
if ( ! function_exists( 'cf_response' ) ) {
6
	/**
7
	 * @see Response::response()
8
	 * @codeCoverageIgnore
9
	 */
10
	function cf_response() {
11
		return Response::response();
12
	}
13
}
14
15
if ( ! function_exists( 'cf_output' ) ) {
16
	/**
17
	 * @see Response::output()
18
	 * @codeCoverageIgnore
19
	 */
20
	function cf_output( $output ) {
21
		return Response::output( cf_response(), $output );
22
	}
23
}
24
25
if ( ! function_exists( 'cf_template' ) ) {
26
	/**
27
	 * @see Response::template()
28
	 * @codeCoverageIgnore
29
	 */
30
	function cf_template( $templates, $context = array() ) {
31
		return Response::template( cf_response(), $templates, $context );
32
	}
33
}
34
35
if ( ! function_exists( 'cf_json' ) ) {
36
	/**
37
	 * @see Response::json()
38
	 * @codeCoverageIgnore
39
	 */
40
	function cf_json( $data ) {
41
		return Response::json( cf_response(), $data );
42
	}
43
}
44
45
if ( ! function_exists( 'cf_redirect' ) ) {
46
	/**
47
	 * @see Response::redirect()
48
	 * @codeCoverageIgnore
49
	 */
50
	function cf_redirect( $url, $status = 302 ) {
51
		return Response::redirect( cf_response(), $url, $status );
52
	}
53
}
54
55
if ( ! function_exists( 'cf_error' ) ) {
56
	/**
57
	 * @see Response::error()
58
	 * @codeCoverageIgnore
59
	 */
60
	function cf_error( $code ) {
61
		return Response::error( cf_response(), $code );
62
	}
63
}
64