Skip to content

Commit 9c2f888

Browse files
committed
Fix psalm errors
Signed-off-by: Côme Chilliet <[email protected]>
1 parent b579454 commit 9c2f888

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

lib/Listener/RegisterFlowOperationsListener.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@
3737
use OCP\WorkflowEngine\Events\RegisterOperationsEvent;
3838
use Psr\Container\ContainerInterface;
3939

40+
/**
41+
* @template-implements IEventListener<RegisterOperationsEvent>
42+
*/
4043
class RegisterFlowOperationsListener implements IEventListener {
4144
public function __construct(
4245
private ContainerInterface $container,

lib/Operation.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ private static function computePrincipalUri(string $userId): string {
214214
}
215215

216216
private static function getUserIdFromPrincipalUri(string $userUri): string {
217-
return explode('/', $userUri, 3)[2];
217+
return explode('/', $userUri, 3)[2] ?? throw new \InvalidArgumentException('Incorrect format for principal URI: '.$userUri);
218218
}
219219

220220
private function extractTypeFromEvent(VEvent $vEvent): string {

psalm.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
66
xmlns="https://getpsalm.org/schema/config"
77
xsi:schemaLocation="https://getpsalm.org/schema/config vendor/vimeo/psalm/config.xsd"
8+
findUnusedBaselineEntry="true"
9+
findUnusedCode="false"
810
>
911
<projectFiles>
1012
<directory name="lib" />

0 commit comments

Comments
 (0)