-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfixtures.php
104 lines (92 loc) · 2.46 KB
/
fixtures.php
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
<?php
declare(strict_types=1);
$fixtures = [
'$global' => [
'functions' => [],
'classes' => [],
'interfaces' => [],
],
];
$fixtures['$global']['functions']['apply_filters'] = <<<'PHP'
/**
* @param string $hook_name
* @param mixed $value
* @param mixed ...$args
* @return mixed
*/
function apply_filters($hook_name, $value, ...$args) {};
PHP;
$fixtures['$global']['functions']['do_action'] = <<<'PHP'
/**
* @param string $hook_name
* @param mixed ...$args
* @return true
*/
function do_action($hook_name, ...$args) {};
PHP;
$fixtures['$global']['functions']['wp_die'] = <<<'PHP'
/**
* @template T
* @param string|WP_Error $message
* @param string|int $title
* @param string|array{exit?: T}|int $args
* @psalm-return (T is null|true ? never : void)
*/
function wp_die($message = '', $title = '', $args = []) {};
PHP;
$fixtures['$global']['functions']['wp_send_json'] = <<<'PHP'
/**
* @param mixed $response
* @param int|null $status_code
* @param int $options
* @psalm-return never
*/
function wp_send_json($response, $status_code = null, $options = 0) {};
PHP;
$fixtures['$global']['functions']['wp_send_json_success'] = <<<'PHP'
/**
* @param mixed $data
* @param int|null $status_code
* @param int $options
* @psalm-return never
*/
function wp_send_json_success($data = null, $status_code = null, $options = 0) {};
PHP;
$fixtures['$global']['functions']['wp_send_json_error'] = <<<'PHP'
/**
* @param mixed $data
* @param int|null $status_code
* @param int $options
* @psalm-return never
*/
function wp_send_json_error($data = null, $status_code = null, $options = 0) {};
PHP;
$fixtures['$global']['functions']['is_wp_error'] = <<<'PHP'
/**
* @param mixed $thing
* @return bool
* @psalm-assert-if-true \WP_Error $thing
*/
function is_wp_error($thing) {};
PHP;
$fixtures['$global']['functions']['get_post_types'] = <<<'PHP'
/**
* @template T of 'names'|'objects'
* @param array $args
* @param T $output
* @param string $operator
* @return (T is 'names' ? array<string> : array<\WP_Post_Type>)
*/
function get_post_types($args = array(), $output = 'names', $operator = 'and') {};
PHP;
$fixtures['$global']['functions']['get_taxonomies'] = <<<'PHP'
/**
* @template T of 'names'|'objects'
* @param array $args
* @param T $output
* @param string $operator
* @return (T is 'names' ? array<string> : array<\WP_Taxonomy>)
*/
function get_taxonomies( $args = array(), $output = 'names', $operator = 'and' ) {};
PHP;
return $fixtures;