12
12
use const PHP_EOL ;
13
13
use const PHP_MAJOR_VERSION ;
14
14
use const PHP_MINOR_VERSION ;
15
+ use const PHP_VERSION ;
15
16
use const PREG_OFFSET_CAPTURE ;
16
17
use const WSDL_CACHE_NONE ;
17
18
use function array_merge ;
28
29
use function is_array ;
29
30
use function is_object ;
30
31
use function md5 ;
31
- use function method_exists ;
32
32
use function mt_rand ;
33
33
use function preg_match ;
34
34
use function preg_match_all ;
42
42
use function strpos ;
43
43
use function substr ;
44
44
use function trait_exists ;
45
+ use function version_compare ;
45
46
use Exception ;
46
47
use Iterator ;
47
48
use IteratorAggregate ;
68
69
use ReflectionClass ;
69
70
use ReflectionMethod ;
70
71
use ReflectionObject ;
71
- use ReflectionProperty ;
72
72
use SebastianBergmann \Type \ReflectionMapper ;
73
73
use SebastianBergmann \Type \Type ;
74
74
use SoapClient ;
@@ -1218,7 +1218,7 @@ private function configurableMethods(MockMethodSet $methods, array $propertiesWi
1218
1218
*/
1219
1219
private function properties (?ReflectionClass $ class ): array
1220
1220
{
1221
- if (! method_exists (ReflectionProperty::class, ' isFinal ' )) {
1221
+ if (version_compare ( ' 8.4.1 ' , PHP_VERSION , ' > ' )) {
1222
1222
// @codeCoverageIgnoreStart
1223
1223
return [];
1224
1224
// @codeCoverageIgnoreEnd
@@ -1232,12 +1232,6 @@ private function properties(?ReflectionClass $class): array
1232
1232
$ properties = [];
1233
1233
1234
1234
foreach ($ class ->getProperties () as $ property ) {
1235
- assert (method_exists ($ property , 'getHook ' ));
1236
- assert (method_exists ($ property , 'hasHooks ' ));
1237
- assert (method_exists ($ property , 'hasHook ' ));
1238
- assert (method_exists ($ property , 'isFinal ' ));
1239
- assert (class_exists (PropertyHookType::class));
1240
-
1241
1235
if (!$ property ->isPublic ()) {
1242
1236
continue ;
1243
1237
}
0 commit comments