Skip to content

Commit

Permalink
Add template
Browse files Browse the repository at this point in the history
Signed-off-by: Vitor Mattos <[email protected]>
  • Loading branch information
vitormattos committed Oct 30, 2023
1 parent 29cff81 commit 24a068d
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/Listener/AnalyticsDatasourceListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@
use OCP\EventDispatcher\Event;
use OCP\EventDispatcher\IEventListener;

/**
* @template-implements IEventListener<Event|DatasourceEvent>
*/
class AnalyticsDatasourceListener implements IEventListener {
public function handle(Event $event): void {
if (!($event instanceof DatasourceEvent)) {
Expand Down
3 changes: 3 additions & 0 deletions lib/Listener/UserCreatedEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@
use OCP\User\Events\UserCreatedEvent;
use Psr\Log\LoggerInterface;

/**
* @template-implements IEventListener<Event|UserCreatedEvent>
*/
class UserCreatedEventListener implements IEventListener {
public function __construct(
private IGroupManager $groupManager,
Expand Down
13 changes: 11 additions & 2 deletions tests/psalm-baseline.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.15.0@5c774aca4746caf3d239d9c8cadb9f882ca29352">
<file src="lib/AppInfo/Application.php">
<InvalidArgument>
<code>AnalyticsDatasourceListener::class</code>
</InvalidArgument>
<UndefinedClass>
<code>DatasourceEvent</code>
<code>PublicShareTemplateProvider</code>
Expand Down Expand Up @@ -63,12 +66,18 @@
</UndefinedInterfaceMethod>
</file>
<file src="lib/Listener/AnalyticsDatasourceListener.php">
<MissingTemplateParam>
<InvalidTemplateParam>
<code>IEventListener</code>
</MissingTemplateParam>
</InvalidTemplateParam>
<MoreSpecificImplementedParamType>
<code>$event</code>
</MoreSpecificImplementedParamType>
<UndefinedClass>
<code>DatasourceEvent</code>
</UndefinedClass>
<UndefinedDocblockClass>
<code>AnalyticsDatasourceListener</code>
</UndefinedDocblockClass>
</file>
<file src="lib/Middleware/InjectionMiddleware.php">
<UndefinedClass>
Expand Down

0 comments on commit 24a068d

Please sign in to comment.