Skip to content

Commit dbc3def

Browse files
committed
update pint rules
1 parent abd485e commit dbc3def

59 files changed

Lines changed: 241 additions & 231 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.idea/codeStyles/Project.xml

Lines changed: 30 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/php.xml

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/prettier.xml

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pint.json

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,28 @@
11
{
22
"preset": "per",
3-
"exclude": ["cli"]
3+
"exclude": ["cli"],
4+
"rules": {
5+
"array_push": true,
6+
"combine_consecutive_issets": true,
7+
"combine_consecutive_unsets": true,
8+
"combine_nested_dirname": true,
9+
"date_time_immutable": true,
10+
"explicit_indirect_variable": true,
11+
"explicit_string_variable": true,
12+
"function_to_constant": true,
13+
"heredoc_to_nowdoc": true,
14+
"indentation_type": true,
15+
"is_null": true,
16+
"lambda_not_used_import": true,
17+
"mb_str_functions": true,
18+
"modernize_strpos": true,
19+
"multiline_comment_opening_closing": true,
20+
"no_superfluous_elseif": true,
21+
"non_printable_character": true,
22+
"single_quote": true,
23+
"static_lambda": true,
24+
"strict_param": true,
25+
"use_arrow_functions": true,
26+
"void_return": true
27+
}
428
}

src/DurableLogger.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ public function __construct(private ?LoggerInterface $logger = null, private str
5252
//$handler->setFormatter(new ConsoleFormatter(allowInlineLineBreaks: true));
5353
$handler->setFormatter(
5454
new class (new ConsoleFormatter(
55-
format: $this->name ? "%channel%.%level_name%: %message% %context% %extra%" : "[%datetime%] %level_name%: %message% %context% %extra%",
55+
format: $this->name ? '%channel%.%level_name%: %message% %context% %extra%' : '[%datetime%] %level_name%: %message% %context% %extra%',
5656
allowInlineLineBreaks: true,
5757
ignoreEmptyContextAndExtra: true,
5858
), $this->name) implements FormatterInterface {
@@ -81,7 +81,7 @@ public function format(LogRecord $record): string
8181
#[\Override]
8282
public function formatBatch(array $records): string
8383
{
84-
return implode("", array_map($this->format(...), $records));
84+
return implode('', array_map($this->format(...), $records));
8585
}
8686
},
8787
);

src/Events/EventDescription.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ private function describe(Event $event): void
142142

143143
public static function fromStream(string $data): self
144144
{
145-
$data = base64_decode($data);
145+
$data = base64_decode($data, true);
146146
$data = function_exists('gzdecode') ? gzdecode($data) : $data;
147147
$data = function_exists('igbinary_unserialize') ? igbinary_unserialize($data) : unserialize($data);
148148

src/Events/EventQueue.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ public function __construct()
4646
$this->keys = new SplQueue();
4747
}
4848

49-
public function setCancellation(DeferredCancellation $cancellation)
49+
public function setCancellation(DeferredCancellation $cancellation): void
5050
{
5151
$this->cancellation = $cancellation;
5252
}
@@ -97,7 +97,7 @@ public function enqueue(string $key, Event $event): void
9797
{
9898
$delay = $this->getDelay($event);
9999
if ($delay->inSeconds() > 0) {
100-
EventLoop::delay($delay->inSeconds(), function () use ($key, $event) {
100+
EventLoop::delay($delay->inSeconds(), function () use ($key, $event): void {
101101
$this->enqueue($key, $event);
102102
if ($this->cancellation !== null) {
103103
$this->cancellation?->cancel();

src/Events/GiveOwnership.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,6 @@ public static function withUser(string $userId): self
3939

4040
public function __toString()
4141
{
42-
return sprintf("GiveOwnership(user: %s)", $this->userId);
42+
return sprintf('GiveOwnership(user: %s)', $this->userId);
4343
}
4444
}

src/Events/RevokeRole.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,6 @@ public function Completely(string $role): self
4242

4343
public function __toString()
4444
{
45-
return sprintf("Revoke(role: %s)", $this->role, );
45+
return sprintf('Revoke(role: %s)', $this->role, );
4646
}
4747
}

src/Events/RevokeUser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,6 @@ public function Completely(StateId $target, string $userId): self
4343

4444
public function __toString()
4545
{
46-
return sprintf("Revoke(user: %s)", $this->userId);
46+
return sprintf('Revoke(user: %s)', $this->userId);
4747
}
4848
}

0 commit comments

Comments
 (0)