Skip to content

Commit

Permalink
Fix psalm
Browse files Browse the repository at this point in the history
Signed-off-by: Louis Chemineau <louis@chmn.me>
  • Loading branch information
artonge committed Nov 9, 2023
1 parent a6902c1 commit 925cf21
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 3 deletions.
3 changes: 3 additions & 0 deletions lib/Listener/AlbumsManagementEventListener.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@
use OCP\User\Events\UserDeletedEvent;
use Psr\Log\LoggerInterface;

/**
* @template-implements IEventListener<Event|NodeDeletedEvent|GroupDeletedEvent|ShareDeletedEvent|UserDeletedEvent>
*/
class AlbumsManagementEventListener implements IEventListener {
private AlbumMapper $albumMapper;
private LoggerInterface $logger;
Expand Down
2 changes: 1 addition & 1 deletion lib/Listener/PlaceMetadataProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
use OCP\FilesMetadata\Event\MetadataLiveEvent;

/**
* @template-implements IEventListener<Event>
* @template-implements IEventListener<Event|MetadataLiveEvent|MetadataBackgroundEvent>
*/
class PlaceMetadataProvider implements IEventListener {
public function __construct(
Expand Down
15 changes: 13 additions & 2 deletions tests/psalm-baseline.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
</file>
<file src="lib/Controller/PageController.php">
<InvalidArgument occurrences="1">
<code>new SearchQuery(new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'systemtag', $tag-&gt;getName()), 0, 0, [], $user)</code>
<code>new SearchQuery(new SearchComparison(ISearchComparison::COMPARE_EQUAL, 'systemtag',
$tag-&gt;getName()), 0, 0, [], $user)</code>
</InvalidArgument>
<UndefinedClass occurrences="12">
<code>$e</code>
Expand All @@ -31,4 +32,14 @@
<code>LoadViewer</code>
</UndefinedClass>
</file>
</files>
<file src="lib/AppInfo/Application.php">
<InvalidArgument occurrences="9">
<code>registerEventListener</code>
</InvalidArgument>
</file>
<file src="lib/Listener/SabrePluginAuthInitListener.php">
<UndefinedMethod occurrences="1">
<code>addBackend</code>
</UndefinedMethod>
</file>
</files>
24 changes: 24 additions & 0 deletions tests/stub.phpstub
Original file line number Diff line number Diff line change
Expand Up @@ -633,3 +633,27 @@ use OCP\EventDispatcher\Event;

class LoadSidebar extends Event {
}

namespace OCA\DAV\Events;

use OCP\EventDispatcher\Event;
use Sabre\DAV\Server;

/**
* @since 20.0.0
*/
class SabrePluginAuthInitEvent extends Event {

/** @var Server */
private $server;

/**
* @since 20.0.0
*/
public function __construct(Server $server);

/**
* @since 20.0.0
*/
public function getServer(): Server;
}

0 comments on commit 925cf21

Please sign in to comment.