chore: Fix typings and update psalm baseline

Signed-off-by: Julius Härtl <jus@bitgrid.net>
This commit is contained in:
Julius Härtl
2023-02-15 13:29:26 +01:00
parent 997e479a69
commit 2ffecd81d4
4 changed files with 52 additions and 38 deletions

View File

@@ -127,7 +127,7 @@ class RelationalEntity extends Entity implements \JsonSerializable {
} }
} }
public function __call($methodName, $args) { public function __call(string $methodName, array $args) {
$attr = lcfirst(substr($methodName, 7)); $attr = lcfirst(substr($methodName, 7));
if (array_key_exists($attr, $this->_resolvedProperties) && strpos($methodName, 'resolve') === 0) { if (array_key_exists($attr, $this->_resolvedProperties) && strpos($methodName, 'resolve') === 0) {
if ($this->_resolvedProperties[$attr] !== null) { if ($this->_resolvedProperties[$attr] !== null) {

View File

@@ -39,7 +39,7 @@ class BoardSummary extends Board {
]; ];
} }
protected function getter($name) { protected function getter(string $name): mixed {
return $this->board->getter($name); return $this->board->getter($name);
} }

View File

@@ -81,10 +81,11 @@ class CardDetails extends Card {
$array['board'] = (new BoardSummary($this->board))->jsonSerialize(); $array['board'] = (new BoardSummary($this->board))->jsonSerialize();
} }
protected function getter($name) { protected function getter(string $name): mixed {
return $this->card->getter($name); return $this->card->getter($name);
} }
public function __call($name, $arguments) {
return $this->card->__call($name, $arguments); public function __call(string $methodName, array $args) {
return $this->card->__call($methodName, $args);
} }
} }

View File

@@ -1,40 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<files psalm-version="5.4.0@62db5d4f6a7ae0a20f7cc5a4952d730272fc0863"> <files psalm-version="5.6.0@e784128902dfe01d489c4123d69918a9f3c1eac5">
<file src="lib/Activity/Filter.php"> <file src="lib/Activity/Filter.php">
<MethodSignatureMismatch occurrences="1"> <MethodSignatureMismatch>
<code>$types</code> <code>$types</code>
</MethodSignatureMismatch> </MethodSignatureMismatch>
</file> </file>
<file src="lib/Command/UserExport.php"> <file src="lib/Command/UserExport.php">
<ImplementedReturnTypeMismatch occurrences="1"> <ImplementedReturnTypeMismatch>
<code>void</code> <code>void</code>
</ImplementedReturnTypeMismatch> </ImplementedReturnTypeMismatch>
<UndefinedThisPropertyAssignment occurrences="2"> <UndefinedThisPropertyAssignment>
<code>$this-&gt;boardMapper</code> <code>$this-&gt;boardMapper</code>
<code>$this-&gt;stackMapper</code> <code>$this-&gt;stackMapper</code>
</UndefinedThisPropertyAssignment> </UndefinedThisPropertyAssignment>
<UndefinedThisPropertyFetch occurrences="2"> <UndefinedThisPropertyFetch>
<code>$this-&gt;boardMapper</code> <code>$this-&gt;boardMapper</code>
<code>$this-&gt;stackMapper</code> <code>$this-&gt;stackMapper</code>
</UndefinedThisPropertyFetch> </UndefinedThisPropertyFetch>
</file> </file>
<file src="lib/Controller/BoardApiController.php"> <file src="lib/Controller/BoardApiController.php">
<TypeDoesNotContainNull occurrences="2"> <TypeDoesNotContainNull>
<code>$modified === null</code> <code>$modified === null</code>
<code>$modified === null</code> <code>$modified === null</code>
</TypeDoesNotContainNull> </TypeDoesNotContainNull>
<UndefinedClass occurrences="1"> <UndefinedClass>
<code>Util</code> <code>Util</code>
</UndefinedClass> </UndefinedClass>
<UndefinedThisPropertyAssignment occurrences="1"> <UndefinedThisPropertyAssignment>
<code>$this-&gt;userId</code> <code>$this-&gt;userId</code>
</UndefinedThisPropertyAssignment> </UndefinedThisPropertyAssignment>
<UndefinedThisPropertyFetch occurrences="1"> <UndefinedThisPropertyFetch>
<code>$this-&gt;userId</code> <code>$this-&gt;userId</code>
</UndefinedThisPropertyFetch> </UndefinedThisPropertyFetch>
</file> </file>
<file src="lib/Controller/CommentsApiController.php"> <file src="lib/Controller/CommentsApiController.php">
<InvalidScalarArgument occurrences="6"> <InvalidScalarArgument>
<code>$cardId</code> <code>$cardId</code>
<code>$cardId</code> <code>$cardId</code>
<code>$cardId</code> <code>$cardId</code>
@@ -44,95 +44,108 @@
</InvalidScalarArgument> </InvalidScalarArgument>
</file> </file>
<file src="lib/Controller/PageController.php"> <file src="lib/Controller/PageController.php">
<UndefinedClass occurrences="1"> <UndefinedClass>
<code>LoadSidebar</code> <code>LoadSidebar</code>
</UndefinedClass> </UndefinedClass>
</file> </file>
<file src="lib/Controller/StackApiController.php"> <file src="lib/Controller/StackApiController.php">
<RedundantCondition occurrences="1"> <RedundantCondition>
<code>$modified !== null</code> <code>$modified !== null</code>
</RedundantCondition> </RedundantCondition>
<UndefinedClass occurrences="1"> <UndefinedClass>
<code>Util</code> <code>Util</code>
</UndefinedClass> </UndefinedClass>
</file> </file>
<file src="lib/DAV/Calendar.php"> <file src="lib/DAV/Calendar.php">
<UndefinedClass occurrences="1"> <UndefinedClass>
<code>ExternalCalendar</code> <code>ExternalCalendar</code>
</UndefinedClass> </UndefinedClass>
</file> </file>
<file src="lib/DAV/CalendarObject.php"> <file src="lib/DAV/CalendarObject.php">
<UndefinedClass occurrences="1"> <UndefinedClass>
<code>ICalendarObject</code> <code>ICalendarObject</code>
</UndefinedClass> </UndefinedClass>
</file> </file>
<file src="lib/DAV/CalendarPlugin.php"> <file src="lib/DAV/CalendarPlugin.php">
<UndefinedClass occurrences="1"> <UndefinedClass>
<code>ICalendarProvider</code> <code>ICalendarProvider</code>
</UndefinedClass> </UndefinedClass>
</file> </file>
<file src="lib/DAV/DeckCalendarBackend.php"> <file src="lib/DAV/DeckCalendarBackend.php">
<UndefinedClass occurrences="1"> <UndefinedClass>
<code>NotFound</code> <code>NotFound</code>
</UndefinedClass> </UndefinedClass>
</file> </file>
<file src="lib/Db/Card.php"> <file src="lib/Db/Card.php">
<UndefinedClass occurrences="2"> <UndefinedClass>
<code>VCalendar</code> <code>VCalendar</code>
<code>VCalendar</code> <code>VCalendar</code>
</UndefinedClass> </UndefinedClass>
</file> </file>
<file src="lib/Db/CardMapper.php"> <file src="lib/Db/CardMapper.php">
<InvalidScalarArgument occurrences="1"> <InvalidScalarArgument>
<code>$entity-&gt;getId()</code> <code>$entity-&gt;getId()</code>
</InvalidScalarArgument> </InvalidScalarArgument>
<UndefinedInterfaceMethod occurrences="1"> <UndefinedInterfaceMethod>
<code>getUserIdGroups</code> <code>getUserIdGroups</code>
</UndefinedInterfaceMethod> </UndefinedInterfaceMethod>
</file> </file>
<file src="lib/Db/LabelMapper.php"> <file src="lib/Db/LabelMapper.php">
<ParamNameMismatch occurrences="1"> <ParamNameMismatch>
<code>$labelId</code> <code>$labelId</code>
</ParamNameMismatch> </ParamNameMismatch>
</file> </file>
<file src="lib/Db/RelationalEntity.php">
<MethodSignatureMismatch occurrences="1">
<code>$attribute</code>
</MethodSignatureMismatch>
</file>
<file src="lib/Db/Stack.php"> <file src="lib/Db/Stack.php">
<UndefinedClass occurrences="2"> <UndefinedClass>
<code>VCalendar</code> <code>VCalendar</code>
<code>VCalendar</code> <code>VCalendar</code>
</UndefinedClass> </UndefinedClass>
</file> </file>
<file src="lib/Model/BoardSummary.php">
<ConstructorSignatureMismatch>
<code>public function __construct(Board $board) {</code>
<code>public function __construct(Board $board) {</code>
</ConstructorSignatureMismatch>
</file>
<file src="lib/Model/CardDetails.php">
<ConstructorSignatureMismatch>
<code>public function __construct(Card $card, ?Board $board = null) {</code>
<code>public function __construct(Card $card, ?Board $board = null) {</code>
</ConstructorSignatureMismatch>
</file>
<file src="lib/Service/AttachmentService.php"> <file src="lib/Service/AttachmentService.php">
<InvalidCatch occurrences="1"/> <InvalidCatch>
<code>try {
$attachment = $this-&gt;attachmentMapper-&gt;find($attachmentId);
} catch (IMapperException $e) {
throw new NoPermissionException('Permission denied');
}</code>
</InvalidCatch>
</file> </file>
<file src="lib/Service/BoardService.php"> <file src="lib/Service/BoardService.php">
<TooManyArguments occurrences="2"> <TooManyArguments>
<code>findAll</code> <code>findAll</code>
<code>findAll</code> <code>findAll</code>
</TooManyArguments> </TooManyArguments>
</file> </file>
<file src="lib/Service/CirclesService.php"> <file src="lib/Service/CirclesService.php">
<RedundantCondition occurrences="1"> <RedundantCondition>
<code>$member !== null</code> <code>$member !== null</code>
</RedundantCondition> </RedundantCondition>
</file> </file>
<file src="lib/Service/FileService.php"> <file src="lib/Service/FileService.php">
<RedundantCondition occurrences="2"> <RedundantCondition>
<code>is_resource($content)</code> <code>is_resource($content)</code>
<code>is_resource($content)</code> <code>is_resource($content)</code>
</RedundantCondition> </RedundantCondition>
</file> </file>
<file src="lib/Sharing/DeckShareProvider.php"> <file src="lib/Sharing/DeckShareProvider.php">
<InvalidReturnType occurrences="1"> <InvalidReturnType>
<code>getShareByToken</code> <code>getShareByToken</code>
</InvalidReturnType> </InvalidReturnType>
</file> </file>
<file src="lib/Sharing/Listener.php"> <file src="lib/Sharing/Listener.php">
<InvalidArgument occurrences="1"> <InvalidArgument>
<code>[self::class, 'listenPreShare']</code> <code>[self::class, 'listenPreShare']</code>
</InvalidArgument> </InvalidArgument>
</file> </file>