Skip to content

Commit ab07d7c

Browse files
committed
Remove emitProperty() following hooks and asymmetric visibility are both merged
See #182 (comment)
1 parent 12ae79a commit ab07d7c

File tree

1 file changed

+0
-26
lines changed

1 file changed

+0
-26
lines changed

src/main/php/lang/ast/emit/PHP84.class.php

-26
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
<?php namespace lang\ast\emit;
22

3-
use ReflectionProperty;
43
use lang\ast\types\{
54
IsArray,
65
IsFunction,
@@ -20,10 +19,6 @@
2019
*/
2120
class PHP84 extends PHP {
2221
use RewriteBlockLambdaExpressions;
23-
use PropertyHooks, AsymmetricVisibility {
24-
PropertyHooks::emitProperty as emitPropertyHooks;
25-
AsymmetricVisibility::emitProperty as emitAsymmetricVisibility;
26-
}
2722

2823
public $targetVersion= 80400;
2924

@@ -58,25 +53,4 @@ public function __construct() {
5853
IsGeneric::class => function($t) { return null; }
5954
];
6055
}
61-
62-
protected function emitProperty($result, $property) {
63-
static $asymmetric= null;
64-
static $hooks= null;
65-
66-
// TODO Remove once https://github.com/php/php-src/pull/15063 and
67-
// https://github.com/php/php-src/pull/13455 are merged
68-
if (
69-
!($asymmetric ?? $asymmetric= method_exists(ReflectionProperty::class, 'isPrivateSet')) &&
70-
array_intersect($property->modifiers, ['private(set)', 'protected(set)', 'public(set)'])
71-
) {
72-
return $this->emitAsymmetricVisibility($result, $property);
73-
} else if (
74-
!($hooks ?? $hooks= method_exists(ReflectionProperty::class, 'getHooks')) &&
75-
$property->hooks
76-
) {
77-
return $this->emitPropertyHooks($result, $property);
78-
}
79-
80-
parent::emitProperty($result, $property);
81-
}
8256
}

0 commit comments

Comments
 (0)