Passed
Branch feature/php-layouts (77346e)
by Atanas
02:58
created

app_layout_content()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
nc 1
nop 0
dl 0
loc 2
rs 10
c 1
b 0
f 0
1
<?php
2
3
use WPEmerge\Facades\Response;
4
use WPEmerge\Facades\View;
5
6
if ( ! function_exists( 'app_response' ) ) {
7
	/**
8
	 * @codeCoverageIgnore
9
	 * @see \WPEmerge\Responses\ResponseService::response()
10
	 * @return \Psr\Http\Message\ResponseInterface
11
	 */
12
	function app_response() {
13
		return call_user_func_array( [Response::class, 'response'], func_get_args() );
14
	}
15
}
16
17
if ( ! function_exists( 'app_output' ) ) {
18
	/**
19
	 * @codeCoverageIgnore
20
	 * @see \WPEmerge\Responses\ResponseService::output()
21
	 * @return \Psr\Http\Message\ResponseInterface
22
	 */
23
	function app_output( $output ) {
24
		return call_user_func_array( [Response::class, 'output'], func_get_args() );
25
	}
26
}
27
28
if ( ! function_exists( 'app_json' ) ) {
29
	/**
30
	 * @codeCoverageIgnore
31
	 * @see \WPEmerge\Responses\ResponseService::json()
32
	 * @return \Psr\Http\Message\ResponseInterface
33
	 */
34
	function app_json( $data ) {
35
		return call_user_func_array( [Response::class, 'json'], func_get_args() );
36
	}
37
}
38
39
if ( ! function_exists( 'app_redirect' ) ) {
40
	/**
41
	 * @codeCoverageIgnore
42
	 * @see \WPEmerge\Responses\ResponseService::redirect()
43
	 * @return \Psr\Http\Message\ResponseInterface
44
	 */
45
	function app_redirect() {
46
		return call_user_func_array( [Response::class, 'redirect'], func_get_args() );
47
	}
48
}
49
50
if ( ! function_exists( 'app_view' ) ) {
51
	/**
52
	 * @codeCoverageIgnore
53
	 * @see \WPEmerge\Responses\ResponseService::view()
54
	 * @return \WPEmerge\View\ViewInterface
55
	 */
56
	function app_view( $views ) {
57
		return call_user_func_array( [Response::class, 'view'], func_get_args() );
58
	}
59
}
60
61
if ( ! function_exists( 'app_error' ) ) {
62
	/**
63
	 * @codeCoverageIgnore
64
	 * @see \WPEmerge\Responses\ResponseService::error()
65
	 * @return \Psr\Http\Message\ResponseInterface
66
	 */
67
	function app_error( $code ) {
68
		return call_user_func_array( [Response::class, 'error'], func_get_args() );
69
	}
70
}
71
72
if ( ! function_exists( 'app_partial' ) ) {
73
	/**
74
	 * @codeCoverageIgnore
75
	 * @see \WPEmerge\View\ViewService::make()
76
	 * @see \WPEmerge\View\ViewInterface::toString()
77
	 * @return void
78
	 */
79
	function app_partial( $views, $context = [] ) {
80
	    echo View::make( $views )
81
            ->with( $context )
82
            ->toString();
83
	}
84
}
85
86
if ( ! function_exists( 'app_layout_content' ) ) {
87
	/**
88
	 * @codeCoverageIgnore
89
	 * @see \WPEmerge\View\PhpView::getLayoutContent()
90
	 * @return void
91
	 */
92
	function app_layout_content() {
93
		echo \WPEmerge\View\PhpView::getLayoutContent();
94
	}
95
}
96