Skip to content

Commit

Permalink
Fix psalm issues
Browse files Browse the repository at this point in the history
  • Loading branch information
roxblnfk committed May 18, 2024
1 parent 6c148a8 commit f9d1d5b
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 5 deletions.
6 changes: 6 additions & 0 deletions psalm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,12 @@
</ignoreFiles>
</projectFiles>
<issueHandlers>
<DeprecatedInterface>
<errorLevel type="suppress">
<file name="src/Commands/InfoCommand.php"/>
<file name="src/DeclarationLocator.php"/>
</errorLevel>
</DeprecatedInterface>
<PropertyNotSetInConstructor>
<errorLevel type="suppress">
<file name="src/Commands/Scaffolder/ActivityCommand.php"/>
Expand Down
1 change: 1 addition & 0 deletions src/Config/TemporalConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
*/
final class TemporalConfig extends InjectableConfig
{
/** @var non-empty-string */
public const CONFIG = 'temporal';

protected array $config = [
Expand Down
2 changes: 1 addition & 1 deletion src/Dispatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public function serve(): void
/**
* @var array<class-string<WorkflowInterface>|class-string<ActivityInterface>, ReflectionClass> $declarations
*/
$declarations = $this->container->get(DeclarationLocatorInterface::class)->getDeclarations();
$declarations = $this->container->get(DeclarationRegistryInterface::class)->getDeclarations();

// factory initiates and runs task queue specific activity and workflow workers
/** @var WorkerFactoryInterface $factory */
Expand Down
3 changes: 2 additions & 1 deletion src/Scaffolder/Declaration/ActivityDeclaration.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@

final class ActivityDeclaration extends AbstractDeclaration
{
/** @var non-empty-string */
public const TYPE = 'activity';

public function __construct(
ScaffolderConfig $config,
string $name,
?string $comment = null,
?string $namespace = null,
private ?string $activityName = null,
private readonly ?string $activityName = null,
) {
parent::__construct($config, $name, $comment, $namespace);
}
Expand Down
1 change: 1 addition & 0 deletions src/Scaffolder/Declaration/WorkflowDeclaration.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

final class WorkflowDeclaration extends AbstractDeclaration
{
/** @var non-empty-string */
public const TYPE = 'workflow';

public function __construct(
Expand Down
6 changes: 3 additions & 3 deletions tests/src/DispatcherTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
use Spiral\Attributes\AttributeReader;
use Spiral\RoadRunnerBridge\RoadRunnerMode;
use Spiral\TemporalBridge\Config\TemporalConfig;
use Spiral\TemporalBridge\DeclarationLocatorInterface;
use Spiral\TemporalBridge\DeclarationRegistryInterface;
use Spiral\TemporalBridge\DeclarationWorkerResolver;
use Spiral\TemporalBridge\Dispatcher;
use Spiral\TemporalBridge\Tests\App\SomeActivity;
Expand Down Expand Up @@ -41,7 +41,7 @@ protected function setUp(): void

public function testServeWithoutDeclarations(): void
{
$locator = $this->mockContainer(DeclarationLocatorInterface::class);
$locator = $this->mockContainer(DeclarationRegistryInterface::class);
$locator->shouldReceive('getDeclarations')->once()->andReturn([]);

$registry = $this->mockContainer(WorkersRegistryInterface::class);
Expand All @@ -59,7 +59,7 @@ public function testServeWithoutDeclarations(): void

public function testServeWithDeclarations(): void
{
$locator = $this->mockContainer(DeclarationLocatorInterface::class);
$locator = $this->mockContainer(DeclarationRegistryInterface::class);
$locator->shouldReceive('getDeclarations')->once()->andReturnUsing(function () {
yield WorkflowInterface::class => new \ReflectionClass(SomeWorkflow::class);
yield WorkflowInterface::class => new \ReflectionClass(SomeWorkflowWithMultipleWorkers::class);
Expand Down

0 comments on commit f9d1d5b

Please sign in to comment.