Passed
Branch feature/latest-scrutinizer (959bf9)
by htmlBurger
02:42
created

app_json()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 1
nc 1
nop 1
dl 0
loc 2
c 0
b 0
f 0
cc 1
rs 10
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 ) {
1 ignored issue
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
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 ) {
1 ignored issue
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
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() {
1 ignored issue
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
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 \Psr\Http\Message\ResponseInterface
55
	 */
56
	function app_view( $views, $context = [] ) {
1 ignored issue
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
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 ) {
1 ignored issue
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
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::toString()
76
	 * @return void
77
	 */
78
	function app_partial( $views, $context = [] ) {
1 ignored issue
show
Best Practice introduced by
It is generally recommended to explicitly declare the visibility for methods.

Adding explicit visibility (private, protected, or public) is generally recommend to communicate to other developers how, and from where this method is intended to be used.

Loading history...
79
		echo call_user_func_array( [View::class, 'toString'], func_get_args() );
80
	}
81
}
82