Repository navigation
Expand file tree
/
Copy pathphpstan-bootstrap.php
More file actions
141 lines (124 loc) · 2.84 KB
/
Copy pathphpstan-bootstrap.php
File metadata and controls
141 lines (124 loc) · 2.84 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
<?php
/**
* Constants and optional plugin stubs for PHPStan analysis.
*/
declare( strict_types=1 );
if ( ! defined( 'ABSPATH' ) ) {
define( 'ABSPATH', '/tmp/wordpress/' );
}
require_once __DIR__ . '/inc/bootstrap/version.php';
if ( ! defined( 'NEXTORA_DIR' ) ) {
define( 'NEXTORA_DIR', __DIR__ );
}
if ( ! defined( 'NEXTORA_URI' ) ) {
define( 'NEXTORA_URI', 'https://example.test/wp-content/themes/nextora' );
}
if ( ! class_exists( 'WC_Cart', false ) ) {
/**
* Minimal WooCommerce cart stub (optional plugin).
*/
class WC_Cart {
public function get_cart_contents_count(): int {
return 0;
}
}
}
if ( ! function_exists( 'woocommerce_mini_cart' ) ) {
/**
* @param array<string, mixed> $args
*/
function woocommerce_mini_cart( $args = array() ): void {
}
}
if ( ! function_exists( 'WC' ) ) {
/**
* @return object{cart: WC_Cart|null}
*/
function WC(): object {
static $instance = null;
if ( null === $instance ) {
$instance = (object) array( 'cart' => new WC_Cart() );
}
return $instance;
}
}
if ( ! function_exists( 'wc_load_cart' ) ) {
function wc_load_cart(): void {
}
}
if ( ! function_exists( 'wc_get_cart_url' ) ) {
function wc_get_cart_url(): string {
return '';
}
}
if ( ! function_exists( 'wc_get_account_endpoint_url' ) ) {
function wc_get_account_endpoint_url( string $endpoint ): string {
return '';
}
}
if ( ! function_exists( 'tribe_get_events' ) ) {
/**
* The Events Calendar plugin (optional) stub.
*
* @param array<string, mixed> $args
*
* @return array<int, WP_Post>
*/
function tribe_get_events( $args = array() ): array {
return array();
}
}
if ( ! function_exists( 'tribe_get_start_date' ) ) {
/**
* @param int|WP_Post|null $event
*/
function tribe_get_start_date( $event = null, bool $display_time = true, string $date_format = 'Y-m-d' ): string {
return '';
}
}
if ( ! function_exists( 'tribe_get_venue' ) ) {
/**
* @param int|WP_Post|null $event
*/
function tribe_get_venue( $event = null ): string {
return '';
}
}
if ( ! function_exists( 'tribe_get_city' ) ) {
/**
* @param int|WP_Post|null $event
*/
function tribe_get_city( $event = null ): string {
return '';
}
}
if ( ! function_exists( 'tribe_get_cost' ) ) {
/**
* @param int|WP_Post|null $event
*/
function tribe_get_cost( $event = null, bool $with_currency_symbol = false ): string {
return '';
}
}
if ( ! function_exists( 'giftflow_get_donor_account_page' ) ) {
/**
* GiftFlow plugin (optional) stub.
*
* @return int|string
*/
function giftflow_get_donor_account_page() {
return 0;
}
}
if ( ! function_exists( 'giftflow_prepare_campaign_status_bar_data' ) ) {
/**
* GiftFlow plugin (optional) stub.
*
* @param int|WP_Post|null $campaign
*
* @return array<string, mixed>
*/
function giftflow_prepare_campaign_status_bar_data( $campaign = null ): array {
return array();
}
}