Skip to content

Commit bdebc0b

Browse files
authored
[TASK] Add native type declarations for CSSString (#1179)
Part of #811
1 parent 4312c56 commit bdebc0b

File tree

3 files changed

+4
-17
lines changed

3 files changed

+4
-17
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Please also have a look at our
3434
- Use more native type declarations and strict mode
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,
37-
#1162, #1163, #1166, #1172, #1174, #1178)
37+
#1162, #1163, #1166, #1172, #1174, #1178, #1179)
3838
- Add visibility to all class/interface constants (#469)
3939

4040
### Deprecated

config/phpstan-baseline.neon

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -114,12 +114,6 @@ parameters:
114114
count: 1
115115
path: ../src/RuleSet/RuleSet.php
116116

117-
-
118-
message: '#^Parameters should have "string" types as the only types passed to this method$#'
119-
identifier: typePerfect.narrowPublicClassMethodParamType
120-
count: 1
121-
path: ../src/Value/CSSString.php
122-
123117
-
124118
message: '#^Loose comparison via "\!\=" is not allowed\.$#'
125119
identifier: notEqual.notAllowed

src/Value/CSSString.php

Lines changed: 3 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,9 @@ class CSSString extends PrimitiveValue
2323
private $string;
2424

2525
/**
26-
* @param string $string
2726
* @param int<0, max> $lineNumber
2827
*/
29-
public function __construct($string, int $lineNumber = 0)
28+
public function __construct(string $string, int $lineNumber = 0)
3029
{
3130
$this->string = $string;
3231
parent::__construct($lineNumber);
@@ -74,18 +73,12 @@ public static function parse(ParserState $parserState): CSSString
7473
return new CSSString($result, $parserState->currentLine());
7574
}
7675

77-
/**
78-
* @param string $string
79-
*/
80-
public function setString($string): void
76+
public function setString(string $string): void
8177
{
8278
$this->string = $string;
8379
}
8480

85-
/**
86-
* @return string
87-
*/
88-
public function getString()
81+
public function getString(): string
8982
{
9083
return $this->string;
9184
}

0 commit comments

Comments
 (0)