Skip to content

Commit

Permalink
Apply php8.0 in Rector preset (#1139)
Browse files Browse the repository at this point in the history
  • Loading branch information
spiralbot committed Sep 6, 2024
1 parent 65b938d commit 33fe9c8
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 18 deletions.
5 changes: 1 addition & 4 deletions src/Attribute/Queueable.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@
#[\Attribute(\Attribute::TARGET_CLASS), NamedArgumentConstructor]
final class Queueable
{
public ?string $queue = null;

public function __construct(string $queue = null)
public function __construct(public ?string $queue = null)
{
$this->queue = $queue;
}
}
2 changes: 1 addition & 1 deletion src/Interceptor/Push/Core.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ private function getTracer(): TracerInterface
{
try {
return ContainerScope::getContainer()->get(TracerInterface::class);
} catch (\Throwable $e) {
} catch (\Throwable) {
return new NullTracer();
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/JobHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public function handle(string $name, string $id, mixed $payload, array $headers

$this->invoker->invoke([$this, $this->getHandlerMethod()], $params);
} catch (\Throwable $e) {
$message = \sprintf('[%s] %s', $this::class, $e->getMessage());
$message = \sprintf('[%s] %s', static::class, $e->getMessage());
throw new JobException($message, (int)$e->getCode(), $e);
}
}
Expand Down
5 changes: 1 addition & 4 deletions src/QueueableDetector.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,8 @@

final class QueueableDetector
{
private ReaderInterface $reader;

public function __construct(ReaderInterface $reader)
public function __construct(private ReaderInterface $reader)
{
$this->reader = $reader;
}

/**
Expand Down
10 changes: 2 additions & 8 deletions tests/Job/ObjectJobTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,8 @@ public function testPayloadObjectValueShouldBeObject(): void
public function testHandleWithHandleMethod(): void
{
$object = new class($this) {
private $testCase;

public function __construct($testCase)
public function __construct(private $testCase)
{
$this->testCase = $testCase;
}

public function handle(string $name, string $id, ContainerInterface $container): void
Expand All @@ -65,11 +62,8 @@ public function handle(string $name, string $id, ContainerInterface $container):
public function testHandleWithInvokeMethod(): void
{
$object = new class($this) {
private $testCase;

public function __construct($testCase)
public function __construct(private $testCase)
{
$this->testCase = $testCase;
}

public function __invoke(string $name, string $id, ContainerInterface $container): void
Expand Down

0 comments on commit 33fe9c8

Please sign in to comment.