Fixed some more phpstan issues

This commit is contained in:
Jan Böhmer 2023-06-18 00:00:58 +02:00
parent 2f46fbfc7a
commit e8771ea118
77 changed files with 192 additions and 109 deletions

View file

@ -41,13 +41,16 @@ class EntityColumn extends AbstractColumn
* @param mixed $value The single value of the column
* @return mixed
*/
public function normalize($value)
public function normalize($value): mixed
{
/** @var AbstractNamedDBElement $value */
return $value;
}
public function configureOptions(OptionsResolver $resolver): self
/**
* @return $this
*/
public function configureOptions(OptionsResolver $resolver): static
{
parent::configureOptions($resolver);

View file

@ -50,12 +50,15 @@ class IconLinkColumn extends AbstractColumn
* @param $value
* @return mixed
*/
public function normalize($value)
public function normalize($value): mixed
{
return $value;
}
public function configureOptions(OptionsResolver $resolver): self
/**
* @return $this
*/
public function configureOptions(OptionsResolver $resolver): static
{
parent::configureOptions($resolver);
$resolver->setDefaults([

View file

@ -79,6 +79,9 @@ class LocaleDateTimeColumn extends AbstractColumn
);
}
/**
* @return $this
*/
protected function configureOptions(OptionsResolver $resolver): self
{
parent::configureOptions($resolver);

View file

@ -36,7 +36,7 @@ class LogEntryExtraColumn extends AbstractColumn
* @param $value
* @return mixed
*/
public function normalize($value)
public function normalize($value): mixed
{
return $value;
}

View file

@ -52,11 +52,14 @@ class LogEntryTargetColumn extends AbstractColumn
* @param $value
* @return mixed
*/
public function normalize($value)
public function normalize($value): mixed
{
return $value;
}
/**
* @return $this
*/
public function configureOptions(OptionsResolver $resolver): self
{
parent::configureOptions($resolver);

View file

@ -37,7 +37,7 @@ class MarkdownColumn extends AbstractColumn
* @param mixed $value The single value of the column
* @return mixed
*/
public function normalize($value)
public function normalize($value): mixed
{
return $this->markdown->markForRendering($value, true);
}

View file

@ -43,7 +43,7 @@ class PartAttachmentsColumn extends AbstractColumn
* @param mixed $value The single value of the column
* @return mixed
*/
public function normalize($value)
public function normalize($value): mixed
{
return $value;
}
@ -79,6 +79,9 @@ class PartAttachmentsColumn extends AbstractColumn
return $tmp;
}
/**
* @return $this
*/
public function configureOptions(OptionsResolver $resolver): self
{
parent::configureOptions($resolver);

View file

@ -59,7 +59,7 @@ class RevertLogColumn extends AbstractColumn
* @param $value
* @return mixed
*/
public function normalize($value)
public function normalize($value): mixed
{
return $value;
}

View file

@ -29,6 +29,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
class RowClassColumn extends AbstractColumn
{
/**
* @return $this
*/
public function configureOptions(OptionsResolver $resolver): self
{
parent::configureOptions($resolver);
@ -44,7 +47,7 @@ class RowClassColumn extends AbstractColumn
return $this;
}
public function initialize(string $name, int $index, array $options, DataTable $dataTable)
public function initialize(string $name, int $index, array $options, DataTable $dataTable): void
{
//The field name is always "$$rowClass" as this is the name the frontend controller expects
parent::initialize('$$rowClass', $index, $options, $dataTable); // TODO: Change the autogenerated stub

View file

@ -32,6 +32,9 @@ class SIUnitNumberColumn extends AbstractColumn
{
}
/**
* @return $this
*/
public function configureOptions(OptionsResolver $resolver): self
{
parent::configureOptions($resolver);

View file

@ -30,6 +30,9 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
*/
class SelectColumn extends AbstractColumn
{
/**
* @return $this
*/
public function configureOptions(OptionsResolver $resolver): self
{
parent::configureOptions($resolver);
@ -48,7 +51,7 @@ class SelectColumn extends AbstractColumn
/**
* @return mixed
*/
public function normalize($value)
public function normalize($value): mixed
{
return $value;
}

View file

@ -37,7 +37,7 @@ class TagsColumn extends AbstractColumn
* @param mixed $value The single value of the column
* @return mixed
*/
public function normalize($value)
public function normalize($value): mixed
{
if (empty($value)) {
return [];
@ -48,6 +48,10 @@ class TagsColumn extends AbstractColumn
public function render($tags, $context): string
{
if (!is_iterable($tags)) {
throw new \LogicException('TagsColumn::render() expects an iterable');
}
$html = '';
$count = 10;
foreach ($tags as $tag) {