DX: fix phpstan issues

This commit is contained in:
2023-03-28 22:32:08 +02:00
parent 331443ae12
commit 48772efd54
27 changed files with 76 additions and 1309 deletions

View File

@@ -544,21 +544,6 @@ class CalendarController extends AbstractController
return $filterOrder->build();
}
private function buildParamsToUrl(?User $user, ?AccompanyingPeriod $accompanyingPeriod): array
{
$params = [];
if (null !== $user) {
$params['user_id'] = $user->getId();
}
if (null !== $accompanyingPeriod) {
$params['id'] = $accompanyingPeriod->getId();
}
return $params;
}
/**
* Creates a form to delete a Calendar entity by id.
*/

View File

@@ -29,6 +29,7 @@ use DateTimeImmutable;
use Doctrine\Common\Collections\ArrayCollection;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\Criteria;
use Doctrine\Common\Collections\ReadableCollection;
use Doctrine\ORM\Mapping as ORM;
use LogicException;
use Symfony\Component\Serializer\Annotation as Serializer;
@@ -507,10 +508,10 @@ class Calendar implements TrackCreationInterface, TrackUpdateInterface, HasCente
}
/**
* @return Collection|User[]
* @return ReadableCollection<(int|string), User>
* @Serializer\Groups({"calendar:read", "read"})
*/
public function getUsers(): Collection
public function getUsers(): ReadableCollection
{
return $this->getInvites()->map(static function (Invite $i) {
return $i->getUser();

View File

@@ -52,7 +52,7 @@ class CountCalendars implements ExportInterface, GroupedExportInterface
return 'Exports of calendar';
}
public function getLabels($key, array $values, $data): Closure
public function getLabels($key, array $values, $data)
{
if ('export_result' !== $key) {
throw new LogicException("the key {$key} is not used by this export");