Skip to content

Commit

Permalink
fix psalm
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Nov 9, 2024
1 parent 1286f54 commit f9be7bd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 15 deletions.
11 changes: 0 additions & 11 deletions psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,6 @@
<code><![CDATA[$url]]></code>
</PossiblyInvalidArgument>
</file>
<file src="src/Service/Action.php">
<PossiblyNullArgument>
<code><![CDATA[$class]]></code>
<code><![CDATA[$config]]></code>
<code><![CDATA[$name]]></code>
<code><![CDATA[$name]]></code>
</PossiblyNullArgument>
<PossiblyNullReference>
<code><![CDATA[getAll]]></code>
</PossiblyNullReference>
</file>
<file src="src/Service/App.php">
<PossiblyNullArgument>
<code><![CDATA[$app->getName()]]></code>
Expand Down
8 changes: 4 additions & 4 deletions src/Service/Action.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ public function create(ActionCreate $action, UserContext $context): int
{
$this->validator->assert($action, $context->getTenantId());

$name = $action->getName();
$class = $action->getClass();
$name = $action->getName() ?? throw new StatusCode\BadRequestException('Provided no action name');
$class = $action->getClass() ?? throw new StatusCode\BadRequestException('Provided no action class');

// check source
$config = $action->getConfig() ? $action->getConfig()->getAll() : [];
$config = $action->getConfig()?->getAll() ?? [];
$parameters = new Parameters($config);
$handler = $this->newAction($class);

Expand Down Expand Up @@ -125,7 +125,7 @@ public function update(string $actionId, ActionUpdate $action, UserContext $cont

// check source
$config = $action->getConfig()?->getAll() ?? self::unserializeConfig($existing->getConfig());
$parameters = new Parameters($config);
$parameters = new Parameters($config ?? []);
$handler = $this->newAction($class);

// call lifecycle
Expand Down

0 comments on commit f9be7bd

Please sign in to comment.