Skip to content

Commit 28776a0

Browse files
committed
[static-analysis] Fixes PHPStan errors minus - access to an undefined property object.
1 parent c9d7089 commit 28776a0

19 files changed

+556
-133
lines changed
Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
<?php
2+
3+
/**
4+
* @param mixed $object
5+
*
6+
* @return array<string, mixed>
7+
*/
8+
function fs_get_object_public_vars($object) {
9+
return [];
10+
}
11+
12+
class FS_Entity {
13+
14+
/**
15+
* @var int
16+
*/
17+
public $id;
18+
19+
/**
20+
* @var string
21+
*/
22+
public $updated;
23+
24+
/**
25+
* @var string
26+
*/
27+
public $created;
28+
29+
/**
30+
* FS_Entity constructor.
31+
* @param mixed $entity
32+
*/
33+
function __construct($entity = false) {
34+
// Implementation here
35+
}
36+
37+
/**
38+
* @return string
39+
*/
40+
static function get_type() {
41+
// Implementation here
42+
return '';
43+
}
44+
45+
/**
46+
* @param mixed $entity1
47+
* @param mixed $entity2
48+
* @return bool
49+
*/
50+
static function equals($entity1, $entity2) {
51+
// Implementation here
52+
return false;
53+
}
54+
55+
/**
56+
* @var bool
57+
*/
58+
private $_is_updated = false;
59+
60+
/**
61+
* @param string $key
62+
* @param bool $val
63+
* @return bool
64+
*/
65+
function update($key, $val = false) {
66+
return false;
67+
}
68+
69+
/**
70+
* @return bool
71+
*/
72+
function is_updated() {
73+
// Implementation here
74+
return $this->_is_updated;
75+
}
76+
77+
/**
78+
* @param int $id
79+
* @return bool
80+
*/
81+
static function is_valid_id($id) {
82+
// Implementation here
83+
return false;
84+
}
85+
86+
/**
87+
* @return string
88+
*/
89+
public static function get_class_name() {
90+
// Implementation here
91+
return '';
92+
}
93+
}
Lines changed: 129 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,129 @@
1+
<?php
2+
class FS_Plugin_Plan extends FS_Entity {
3+
4+
/**
5+
* @var int
6+
*/
7+
public $plugin_id;
8+
9+
/**
10+
* @var string
11+
*/
12+
public $name;
13+
14+
/**
15+
* @var string
16+
*/
17+
public $title;
18+
19+
/**
20+
* @var string
21+
*/
22+
public $description;
23+
24+
/**
25+
* @var bool
26+
*/
27+
public $is_free_localhost;
28+
29+
/**
30+
* @var bool
31+
*/
32+
public $is_block_features;
33+
34+
/**
35+
* @var string
36+
*/
37+
public $license_type;
38+
39+
/**
40+
* @var bool
41+
*/
42+
public $is_https_support;
43+
44+
/**
45+
* @var int
46+
*/
47+
public $trial_period;
48+
49+
/**
50+
* @var bool
51+
*/
52+
public $is_require_subscription;
53+
54+
/**
55+
* @var string
56+
*/
57+
public $support_kb;
58+
59+
/**
60+
* @var string
61+
*/
62+
public $support_forum;
63+
64+
/**
65+
* @var string
66+
*/
67+
public $support_email;
68+
69+
/**
70+
* @var string
71+
*/
72+
public $support_phone;
73+
74+
/**
75+
* @var string
76+
*/
77+
public $support_skype;
78+
79+
/**
80+
* @var bool
81+
*/
82+
public $is_success_manager;
83+
84+
/**
85+
* @var bool
86+
*/
87+
public $is_featured;
88+
89+
/**
90+
* @var bool
91+
*/
92+
public $is_hidden;
93+
94+
/**
95+
* @var array<string, mixed>
96+
*/
97+
public $pricing;
98+
99+
/**
100+
* @var array<string, mixed>
101+
*/
102+
public $features;
103+
104+
/**
105+
* FS_Plugin_Plan constructor.
106+
* @param object|bool $plan
107+
*/
108+
public function __construct($plan = false) {}
109+
110+
/**
111+
* @return string
112+
*/
113+
public static function get_type() {}
114+
115+
/**
116+
* @return bool
117+
*/
118+
public function is_free() {}
119+
120+
/**
121+
* @return bool
122+
*/
123+
public function has_technical_support() {}
124+
125+
/**
126+
* @return bool
127+
*/
128+
public function has_trial() {}
129+
}

0 commit comments

Comments
 (0)