Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit e31fc92

Browse files
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

Lines changed: 2 additions & 3 deletions
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

Lines changed: 0 additions & 3 deletions
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)

AltStyle によって変換されたページ (->オリジナル) /