Skip to content

Commit 8f82bf3

Browse files
authored
[TASK] Add native type declarations for AtRuleSet (#1192)
Part of #811
1 parent 2db8991 commit 8f82bf3

File tree

3 files changed

+4
-14
lines changed

3 files changed

+4
-14
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Please also have a look at our
3535
(#641, #772, #774, #778, #804, #841, #873, #875, #891, #922, #923, #933, #958,
3636
#964, #967, #1000, #1044, #1134, #1136, #1137, #1139, #1140, #1141, #1145,
3737
#1162, #1163, #1166, #1172, #1174, #1178, #1179, #1181, #1183, #1184, #1186,
38-
#1187, #1190)
38+
#1187, #1190, #1192)
3939
- Add visibility to all class/interface constants (#469)
4040

4141
### Deprecated

config/phpstan-baseline.neon

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,6 @@ parameters:
3636
count: 1
3737
path: ../src/Rule/Rule.php
3838

39-
-
40-
message: '#^Only booleans are allowed in an if condition, string given\.$#'
41-
identifier: if.condNotBoolean
42-
count: 1
43-
path: ../src/RuleSet/AtRuleSet.php
44-
4539
-
4640
message: '#^Loose comparison via "\!\=" is not allowed\.$#'
4741
identifier: notEqual.notAllowed

src/RuleSet/AtRuleSet.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -27,10 +27,9 @@ class AtRuleSet extends RuleSet implements AtRule
2727

2828
/**
2929
* @param non-empty-string $type
30-
* @param string $arguments
3130
* @param int<0, max> $lineNumber
3231
*/
33-
public function __construct($type, $arguments = '', int $lineNumber = 0)
32+
public function __construct(string $type, string $arguments = '', int $lineNumber = 0)
3433
{
3534
parent::__construct($lineNumber);
3635
$this->type = $type;
@@ -45,10 +44,7 @@ public function atRuleName(): string
4544
return $this->type;
4645
}
4746

48-
/**
49-
* @return string
50-
*/
51-
public function atRuleArgs()
47+
public function atRuleArgs(): string
5248
{
5349
return $this->arguments;
5450
}
@@ -58,7 +54,7 @@ public function render(OutputFormat $outputFormat): string
5854
$formatter = $outputFormat->getFormatter();
5955
$result = $formatter->comments($this);
6056
$arguments = $this->arguments;
61-
if ($arguments) {
57+
if ($arguments !== '') {
6258
$arguments = ' ' . $arguments;
6359
}
6460
$result .= "@{$this->type}$arguments{$formatter->spaceBeforeOpeningBrace()}{";

0 commit comments

Comments
 (0)