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 ;
@@ -1220,7 +1220,7 @@ private function configurableMethods(MockMethodSet $methods, array $propertiesWi
1220
1220
*/
1221
1221
private function properties (?ReflectionClass $ class ): array
1222
1222
{
1223
- if (! method_exists (ReflectionProperty::class, ' isFinal ' )) {
1223
+ if (version_compare ( ' 8.4.1 ' , PHP_VERSION , ' > ' )) {
1224
1224
// @codeCoverageIgnoreStart
1225
1225
return [];
1226
1226
// @codeCoverageIgnoreEnd
@@ -1234,12 +1234,6 @@ private function properties(?ReflectionClass $class): array
1234
1234
$ properties = [];
1235
1235
1236
1236
foreach ($ class ->getProperties () as $ property ) {
1237
- assert (method_exists ($ property , 'getHook ' ));
1238
- assert (method_exists ($ property , 'hasHooks ' ));
1239
- assert (method_exists ($ property , 'hasHook ' ));
1240
- assert (method_exists ($ property , 'isFinal ' ));
1241
- assert (class_exists (PropertyHookType::class));
1242
-
1243
1237
if (!$ property ->isPublic ()) {
1244
1238
continue ;
1245
1239
}
0 commit comments