Repository navigation
Expand file tree
/
Copy pathphpstan-bootstrap.php
More file actions
179 lines (149 loc) · 3.94 KB
/
Copy pathphpstan-bootstrap.php
File metadata and controls
179 lines (149 loc) · 3.94 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
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
<?php
/**
* PHPStan bootstrap file
* PHPStan 启动文件
*/
// Define constants for FreshRSS if not already defined
if (!defined('FRESHRSS_PATH')) {
define('FRESHRSS_PATH', __DIR__ . '/../../..');
}
// Define XML constants if not already defined
if (!defined('XML_ELEMENT_NODE')) {
define('XML_ELEMENT_NODE', 1);
}
if (!defined('XML_TEXT_NODE')) {
define('XML_TEXT_NODE', 3);
}
// Mock FreshRSS classes for static analysis
if (!class_exists('FreshRSS_Context')) {
class FreshRSS_Context {
public static $user_conf;
}
}
if (!class_exists('FreshRSS_Entry')) {
class FreshRSS_Entry {
public function id(): string {
return '';
}
public function title(): string {
return '';
}
public function author(): string {
return '';
}
public function content(): string {
return '';
}
public function _content(string $content): void {
}
}
}
if (!class_exists('FreshRSS_Factory')) {
class FreshRSS_Factory {
public static function createEntryDao() {
return null;
}
}
}
if (!class_exists('Minz_Extension')) {
class Minz_Extension {
protected array $csp_policies = [];
public function init(): void {
}
public function registerHook(string $hook, callable $callback): void {
}
public function registerController(string $name): void {
}
public function registerTranslates(string $path): void {
}
public function getFileUrl(string $file, string $type): string {
return '';
}
public function handleConfigureAction(): void {
}
}
}
if (!class_exists('Minz_ActionController')) {
class Minz_ActionController {
public $view;
public function __construct() {
$this->view = new stdClass();
}
}
}
if (!class_exists('Minz_Request')) {
class Minz_Request {
public static function param(string $name, $default = null) {
return $default;
}
public static function isPost(): bool {
return false;
}
}
}
if (!class_exists('Minz_Url')) {
class Minz_Url {
public static function display(array $params): string {
return '';
}
}
}
if (!class_exists('Minz_View')) {
class Minz_View {
public static function appendStyle(string $url): void {
}
public static function appendScript(string $url): void {
}
}
}
if (!class_exists('Minz_HookType')) {
class Minz_HookType {
public const EntryBeforeDisplay = 'entry_before_display';
}
}
if (!class_exists('DOMNode')) {
class DOMNode {
public int $nodeType;
public string $nodeName;
public string $nodeValue;
public iterable $childNodes;
public ?DOMNode $firstChild;
public function getAttribute(string $name): string {
return '';
}
public function hasChildNodes(): bool {
return false;
}
public function getFirstChild(): ?DOMNode {
return null;
}
}
}
if (!class_exists('DOMDocument')) {
class DOMDocument {
public function loadHTML(string $html): bool {
return true;
}
}
}
if (!class_exists('DOMXPath')) {
class DOMXPath {
public function __construct() {
}
public function query(string $expression): DOMNodeList {
return new DOMNodeList();
}
}
}
if (!class_exists('DOMNodeList')) {
class DOMNodeList implements IteratorAggregate {
public function getIterator(): Traversable {
return new ArrayIterator([]);
}
}
}
if (!function_exists('_t')) {
function _t(string $key, ...$args): string {
return $key;
}
}