Skip to content

[TASK] Use native types in Settings #933

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
Feb 15, 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 @@ -26,7 +26,7 @@ Please also have a look at our
- Only allow `string` for some `OutputFormat` properties (#885)
- Make all non-private properties `@internal` (#886)
- Use more native type declarations and strict mode
(#641, #772, #774, #778, #804, #841, #873, #875, #891, #922, #923)
(#641, #772, #774, #778, #804, #841, #873, #875, #891, #922, #923, #933)
- Add visibility to all class/interface constants (#469)

### Deprecated
Expand Down
17 changes: 4 additions & 13 deletions src/Settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,10 +46,7 @@ private function __construct()
$this->bMultibyteSupport = \extension_loaded('mbstring');
}

/**
* @return self new instance
*/
public static function create(): Settings
public static function create(): self
{
return new Settings();
}
Expand All @@ -60,11 +57,9 @@ public static function create(): Settings
* If `true` (`mbstring` extension must be enabled), will use (slower) `mb_strlen`, `mb_convert_case`, `mb_substr`
* and `mb_strpos` functions. Otherwise, the normal (ASCII-Only) functions will be used.
*
* @param bool $bMultibyteSupport
*
* @return $this fluent interface
*/
public function withMultibyteSupport($bMultibyteSupport = true): self
public function withMultibyteSupport(bool $bMultibyteSupport = true): self
{
$this->bMultibyteSupport = $bMultibyteSupport;
return $this;
Expand All @@ -73,11 +68,9 @@ public function withMultibyteSupport($bMultibyteSupport = true): self
/**
* Sets the charset to be used if the CSS does not contain an `@charset` declaration.
*
* @param string $sDefaultCharset
*
* @return $this fluent interface
*/
public function withDefaultCharset($sDefaultCharset): self
public function withDefaultCharset(string $sDefaultCharset): self
{
$this->sDefaultCharset = $sDefaultCharset;
return $this;
Expand All @@ -86,11 +79,9 @@ public function withDefaultCharset($sDefaultCharset): self
/**
* Configures whether the parser should silently ignore invalid rules.
*
* @param bool $usesLenientParsing
*
* @return $this fluent interface
*/
public function withLenientParsing($usesLenientParsing = true): self
public function withLenientParsing(bool $usesLenientParsing = true): self
{
$this->bLenientParsing = $usesLenientParsing;
return $this;
Expand Down