Skip to content

Commit e31fc92

Browse files
committed
remove default
1 parent 71c813d commit e31fc92

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

src/Ast/BaseNode.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -23,16 +23,15 @@ public function hasAttribute(string $key): bool
2323
}
2424

2525
/**
26-
* @param mixed|null $default
2726
* @return mixed|null
2827
*/
29-
public function getAttribute(string $key, $default = null)
28+
public function getAttribute(string $key)
3029
{
3130
if ($this->hasAttribute($key)) {
3231
return $this->attributes[$key];
3332
}
3433

35-
return $default;
34+
return null;
3635
}
3736

3837
}

tests/PHPStan/Ast/Attributes/AttributesTest.php

-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,6 @@ protected function setUp(): void
3030

3131
public function testGetAttribute(): void
3232
{
33-
$defaultValue = $this->phpDocNode->getAttribute('unknown_with_default', 100);
34-
$this->assertSame(100, $defaultValue);
35-
3633
$unKnownValue = $this->phpDocNode->getAttribute('unknown');
3734
$this->assertNull($unKnownValue);
3835
}

0 commit comments

Comments
 (0)