1 | <?php |
||
15 | class LSX_Rest_Helper { |
||
16 | |||
17 | /** |
||
18 | * Holds class instance |
||
19 | * |
||
20 | * @since 1.0.0 |
||
21 | * @var object |
||
22 | */ |
||
23 | protected static $instance = null; |
||
24 | |||
25 | /** |
||
26 | * Holds the conditional. |
||
27 | * |
||
28 | * @var boolean |
||
29 | */ |
||
30 | protected $is_rest_request = false; |
||
31 | |||
32 | /** |
||
33 | * Constructor. |
||
34 | */ |
||
35 | public function __construct() { |
||
38 | /** |
||
39 | * Return an instance of this class. |
||
40 | * |
||
41 | * @since 1.0.0 |
||
42 | * @return object A single instance of this class. |
||
43 | */ |
||
44 | public static function get_instance() { |
||
51 | |||
52 | /** |
||
53 | * This will set the 'is_rest_request' variable as true if it runs. Tribe has already done the checkes for us. |
||
54 | * |
||
55 | * @param array $params |
||
56 | * @param array $request |
||
57 | * @return void |
||
58 | */ |
||
59 | public function check_event_request( $params, $request ) { |
||
63 | |||
64 | /** |
||
65 | * Determines if the request is an REST API request. |
||
66 | * |
||
67 | * @return bool True if it's a REST API request, false otherwise. |
||
68 | */ |
||
69 | public function is_rest_api_request() { |
||
81 | } |
||
82 | $rest_helper = LSX_Rest_Helper::get_instance(); |
||
83 |
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.