Skip to content
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 src/Event/EventTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public function on(string $event, callable $callable): static {
* @param callable|null $callable
* @return $this
*/
public function off(string $event = null, callable $callable = null): static {
public function off(?string $event = null, ?callable $callable = null): static {

if (is_null($event)) {

Expand Down
2 changes: 1 addition & 1 deletion src/Parser/Lexer.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class Lexer
* @param string $css
* @param object|null $context
*/
public function __construct(string $css = '', object $context = null)
public function __construct(string $css = '', ?object $context = null)
{

$this->css = rtrim($css);
Expand Down
2 changes: 1 addition & 1 deletion src/Process/MultiProcessing/Process.php
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ public function start(): void
/**
* @throws IllegalStateException
*/
public function stop(float $timeout = 10, int $signal = null): void
public function stop(float $timeout = 10, ?int $signal = null): void
{
if (!$this->started) {

Expand Down
2 changes: 1 addition & 1 deletion src/Process/ProcessInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface ProcessInterface extends EventInterface

public function start(): void;

public function stop(float $timeout = 10, int $signal = null): void;
public function stop(float $timeout = 10, ?int $signal = null): void;

public static function isSupported(): bool;

Expand Down
2 changes: 1 addition & 1 deletion src/Process/Thread/PCNTL/Thread.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ public function start(): void
}
}

public function stop(float $timeout = 10, int $signal = null): void
public function stop(float $timeout = 10, ?int $signal = null): void
{
if ($this->stopped || $this->terminated) {

Expand Down
2 changes: 1 addition & 1 deletion src/Property/PropertyList.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ class PropertyList implements IteratorAggregate
* @param RuleList|null $list
* @param array $options
*/
public function __construct(RuleList $list = null, array $options = [])
public function __construct(?RuleList $list = null, array $options = [])
{

$this->options = array_merge($this->options, $options);
Expand Down
2 changes: 1 addition & 1 deletion src/Renderer.php
Original file line number Diff line number Diff line change
Expand Up @@ -1066,7 +1066,7 @@ public function setOptions(array $options): static
* @param mixed|null $default return value
* @return array|string|bool
*/
public function getOptions(string $name = null, mixed $default = null): array|string|bool
public function getOptions(?string $name = null, mixed $default = null): array|string|bool
{

if (is_null($name)) {
Expand Down
4 changes: 2 additions & 2 deletions src/Value.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ protected static function matchDefaults($token): bool
* @param array $tokens
* @return bool
*/
public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, int $index = null, array $tokens = []): bool
public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, ?int $index = null, array $tokens = []): bool
{

return $token->type == static::type() || isset($token->value) && static::matchKeyword($token->value);
Expand Down Expand Up @@ -1380,7 +1380,7 @@ public static function keywords(): array
* @return string|null
* @ignore
*/
public static function matchKeyword(string $string, array $keywords = null): ?string
public static function matchKeyword(string $string, ?array $keywords = null): ?string
{

if (is_null($keywords)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Value/BackgroundColor.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public static function doParse(string $string, bool $capture_whitespace = true,
return static::reduce($tokens);
}

public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, int $index = null, array $tokens = []): bool
public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, ?int $index = null, array $tokens = []): bool
{
return $token->type == 'color';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Value/BackgroundImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ public static function doRender(object $data, array $options = [])
return $data->value ?? parent::doRender($data, $options);
}

public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, int $index = null, array $tokens = []): bool
public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, ?int $index = null, array $tokens = []): bool
{

return $token->type == static::type() || (isset($token->name) &&
Expand Down
2 changes: 1 addition & 1 deletion src/Value/BackgroundPosition.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ protected function __construct($data)
* @inheritDoc
*/

public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, int $index = null, array $tokens = []): bool
public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, ?int $index = null, array $tokens = []): bool
{

$test = false;
Expand Down
2 changes: 1 addition & 1 deletion src/Value/BackgroundRepeat.php
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ class BackgroundRepeat extends Value
*/
protected static array $defaults = ['repeat'];

public static function matchKeyword(string $string, array $keywords = null): ?string
public static function matchKeyword(string $string, ?array $keywords = null): ?string
{

$key = preg_replace('~(\s+)~', ' ', trim($string, ";\n\t\r "));
Expand Down
4 changes: 2 additions & 2 deletions src/Value/BackgroundSize.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class BackgroundSize extends Value
]
];

public static function matchKeyword(string $string, array $keywords = null): ?string
public static function matchKeyword(string $string, ?array $keywords = null): ?string
{
$string = trim($string, ";\n\t\r ");
$string = preg_replace('#\s+#', ' ', $string);
Expand All @@ -47,7 +47,7 @@ public static function matchKeyword(string $string, array $keywords = null): ?st
return parent::matchKeyword($string, $keywords);
}

public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, int $index = null, array $tokens = []): bool
public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, ?int $index = null, array $tokens = []): bool
{

return $token->type == 'unit' || ($token->type == 'css-string' && in_array($token->value, static::$keywords));
Expand Down
2 changes: 1 addition & 1 deletion src/Value/FontFamily.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class FontFamily extends ShortHand
/**
* @inheritDoc
*/
public static function matchToken ($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, int $index = null, array $tokens = []): bool {
public static function matchToken ($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, ?int $index = null, array $tokens = []): bool {

return $token->type == 'css-string' || $token->type == static::type();
}
Expand Down
2 changes: 1 addition & 1 deletion src/Value/FontStyle.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public static function match(object $data, $type): bool
/**
* @inheritDoc
*/
public static function matchToken ($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, int $index = null, array $tokens = []): bool {
public static function matchToken ($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, ?int $index = null, array $tokens = []): bool {

if ($token->type == 'css-string' && in_array(strtolower($token->value), static::$keywords)) {

Expand Down
2 changes: 1 addition & 1 deletion src/Value/FontVariant.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class FontVariant extends Value
/**
* @inheritDoc
*/
public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, int $index = null, array $tokens = []): bool
public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, ?int $index = null, array $tokens = []): bool
{

if ($token->type == 'css-string' && in_array(strtolower($token->value), static::$keywords)) {
Expand Down
2 changes: 1 addition & 1 deletion src/Value/FontWeight.php
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static function match(object $data, $type): bool
/**
* @inheritDoc
*/
public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, int $index = null, array $tokens = []): bool
public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, ?int $index = null, array $tokens = []): bool
{

if ($token->type == 'number' && $token->value > 0 && $token->value <= 1000) {
Expand Down
2 changes: 1 addition & 1 deletion src/Value/LineHeight.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class LineHeight extends Value
* @inheritDoc
* @throws Exception
*/
public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, int $index = null, array $tokens = []): bool
public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, ?int $index = null, array $tokens = []): bool
{

if (!is_null($previousToken) && $previousToken->type != 'separator' && (!isset($previousToken->value) || $previousToken->value != '/')) {
Expand Down
2 changes: 1 addition & 1 deletion src/Value/OutlineColor.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class OutlineColor extends Color
/**
* @inheritDoc
*/
public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, int $index = null, array $tokens = []): bool
public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, ?int $index = null, array $tokens = []): bool
{
return $token->type == 'color';
}
Expand Down
2 changes: 1 addition & 1 deletion src/Value/OutlineWidth.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class OutlineWidth extends Unit
/**
* @inheritDoc
*/
public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, int $index = null, array $tokens = []): bool
public static function matchToken($token, $previousToken = null, $previousValue = null, $nextToken = null, $nextValue = null, ?int $index = null, array $tokens = []): bool
{

return $token->type == 'unit' || ($token->type == 'number' && $token->value == 0);
Expand Down
Loading