Skip to content

Commit 6cb27fa

Browse files
authored
[TASK] Use native type declarations for Comment (#923)
Part of #811
1 parent 8fcaa09 commit 6cb27fa

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Please also have a look at our
2626
- Only allow `string` for some `OutputFormat` properties (#885)
2727
- Make all non-private properties `@internal` (#886)
2828
- Use more native type declarations and strict mode
29-
(#641, #772, #774, #778, #804, #841, #873, #875, #891, #922)
29+
(#641, #772, #774, #778, #804, #841, #873, #875, #891, #922, #923)
3030
- Add visibility to all class/interface constants (#469)
3131

3232
### Deprecated

src/Comment/Comment.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,19 +24,15 @@ class Comment implements Renderable
2424
protected $commentText;
2525

2626
/**
27-
* @param string $commentText
2827
* @param int<0, max> $lineNumber
2928
*/
30-
public function __construct($commentText = '', $lineNumber = 0)
29+
public function __construct(string $commentText = '', int $lineNumber = 0)
3130
{
3231
$this->commentText = $commentText;
3332
$this->lineNumber = $lineNumber;
3433
}
3534

36-
/**
37-
* @return string
38-
*/
39-
public function getComment()
35+
public function getComment(): string
4036
{
4137
return $this->commentText;
4238
}
@@ -49,10 +45,7 @@ public function getLineNo(): int
4945
return $this->lineNumber;
5046
}
5147

52-
/**
53-
* @param string $commentText
54-
*/
55-
public function setComment($commentText): void
48+
public function setComment(string $commentText): void
5649
{
5750
$this->commentText = $commentText;
5851
}

0 commit comments

Comments
 (0)