Skip to content

[TASK] Add native type declarations for Charset #1178

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Please also have a look at our
- Use more native type declarations and strict mode
(#641, #772, #774, #778, #804, #841, #873, #875, #891, #922, #923, #933, #958,
#964, #967, #1000, #1044, #1134, #1136, #1137, #1139, #1140, #1141, #1145,
#1162, #1163, #1166, #1172, #1174)
#1162, #1163, #1166, #1172, #1174, #1178)
- Add visibility to all class/interface constants (#469)

### Deprecated
Expand Down
6 changes: 0 additions & 6 deletions config/phpstan-baseline.neon
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ parameters:
count: 1
path: ../src/Property/CSSNamespace.php

-
message: '#^Method Sabberworm\\CSS\\Property\\Charset\:\:atRuleArgs\(\) should return string but returns Sabberworm\\CSS\\Value\\CSSString\.$#'
identifier: return.type
count: 1
path: ../src/Property/Charset.php

-
message: '#^Only booleans are allowed in an if condition, Sabberworm\\CSS\\Value\\RuleValueList\|string\|null given\.$#'
identifier: if.condNotBoolean
Expand Down
10 changes: 2 additions & 8 deletions src/Property/Charset.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,10 +63,7 @@ public function setCharset($charset): void
$this->charset = $charset;
}

/**
* @return string
*/
public function getCharset()
public function getCharset(): string
{
return $this->charset->getString();
}
Expand All @@ -92,10 +89,7 @@ public function atRuleName(): string
return 'charset';
}

/**
* @return string
*/
public function atRuleArgs()
public function atRuleArgs(): CSSString
{
return $this->charset;
}
Expand Down