Skip to content

Commit

Permalink
Remove abstract hooks, they are no longer included in the RFC
Browse files Browse the repository at this point in the history
  • Loading branch information
thekid committed May 18, 2024
1 parent deb3329 commit 33d6f86
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
3 changes: 0 additions & 3 deletions src/main/php/lang/ast/syntax/PHP.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -1350,9 +1350,6 @@ private function properties($parse, &$body, $meta, $modifiers, $type) {
if ('final' === $parse->token->value) {
$modifiers= ['final'];
$parse->forward();
} else if ('abstract' === $parse->token->value) {
$modifiers= ['abstract'];
$parse->forward();
} else {
$modifiers= [];
}
Expand Down
6 changes: 3 additions & 3 deletions src/test/php/lang/ast/unittest/parse/MembersTest.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -197,12 +197,12 @@ public function property_with_final_hook() {
#[Test]
public function property_with_abstract_hook() {
$class= new ClassDeclaration(['abstract'], new IsValue('\\A'), null, [], [], null, null, self::LINE);
$prop= new Property(['public'], 'a', null, null, null, null, self::LINE);
$prop= new Property(['public', 'abstract'], 'a', null, null, null, null, self::LINE);
$parameter= new Parameter('value', new IsLiteral('string'), null, false, false, null, null, null, self::LINE);
$prop->hooks['set']= new Hook(['abstract'], 'set', null, false, $parameter, self::LINE);
$prop->hooks['set']= new Hook([], 'set', null, false, $parameter, self::LINE);
$class->declare($prop);

$this->assertParsed([$class], 'abstract class A { public $a { abstract set(string $value); } }');
$this->assertParsed([$class], 'abstract class A { public abstract $a { set(string $value); } }');
}

#[Test]
Expand Down

0 comments on commit 33d6f86

Please sign in to comment.