mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2025-06-26 03:38:47 +02:00
Fixed some return type deprecation messages
This commit is contained in:
parent
558440168d
commit
1cee1abe00
37 changed files with 70 additions and 70 deletions
|
@ -69,7 +69,7 @@ class ImportPartKeeprCommand extends Command
|
|||
$this->addOption('--import-users', null, InputOption::VALUE_NONE, 'Import users (passwords will not be imported).');
|
||||
}
|
||||
|
||||
public function execute(InputInterface $input, OutputInterface $output)
|
||||
public function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ class ProjectController extends AbstractController
|
|||
/**
|
||||
* @Route("/{id}/info", name="project_info", requirements={"id"="\d+"})
|
||||
*/
|
||||
public function info(Project $project, Request $request, ProjectBuildHelper $buildHelper)
|
||||
public function info(Project $project, Request $request, ProjectBuildHelper $buildHelper): Response
|
||||
{
|
||||
$this->denyAccessUnlessGranted('read', $project);
|
||||
|
||||
|
|
|
@ -38,7 +38,7 @@ use Omines\DataTablesBundle\Adapter\Doctrine\FetchJoinORMAdapter;
|
|||
*/
|
||||
class CustomFetchJoinORMAdapter extends FetchJoinORMAdapter
|
||||
{
|
||||
public function getCount(QueryBuilder $queryBuilder, $identifier)
|
||||
public function getCount(QueryBuilder $queryBuilder, $identifier): ?int
|
||||
{
|
||||
$qb_without_group_by = clone $queryBuilder;
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ class PrettyBoolColumn extends AbstractColumn
|
|||
return (bool) $value;
|
||||
}
|
||||
|
||||
public function render($value, $context)
|
||||
public function render($value, $context): string
|
||||
{
|
||||
if ($value === true) {
|
||||
return '<span class="badge bg-success"><i class="fa-solid fa-circle-check fa-fw"></i> '
|
||||
|
|
|
@ -27,7 +27,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
class RowClassColumn extends AbstractColumn
|
||||
{
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): self
|
||||
{
|
||||
parent::configureOptions($resolver);
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ class SIUnitNumberColumn extends AbstractColumn
|
|||
$this->formatter = $formatter;
|
||||
}
|
||||
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): self
|
||||
{
|
||||
parent::configureOptions($resolver);
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
*/
|
||||
class SelectColumn extends AbstractColumn
|
||||
{
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
public function configureOptions(OptionsResolver $resolver): self
|
||||
{
|
||||
parent::configureOptions($resolver);
|
||||
|
||||
|
@ -48,7 +48,7 @@ class SelectColumn extends AbstractColumn
|
|||
return $value;
|
||||
}
|
||||
|
||||
public function render($value, $context)
|
||||
public function render($value, $context): string
|
||||
{
|
||||
//Return empty string, as it this column is filled by datatables on client side
|
||||
return '';
|
||||
|
|
|
@ -49,7 +49,7 @@ class SQLiteRegexExtension implements EventSubscriberInterface
|
|||
}
|
||||
}
|
||||
|
||||
public function getSubscribedEvents()
|
||||
public function getSubscribedEvents(): array
|
||||
{
|
||||
return[
|
||||
Events::postConnect
|
||||
|
|
|
@ -29,17 +29,17 @@ use Doctrine\DBAL\Types\Type;
|
|||
class TinyIntType extends Type
|
||||
{
|
||||
|
||||
public function getSQLDeclaration(array $column, AbstractPlatform $platform)
|
||||
public function getSQLDeclaration(array $column, AbstractPlatform $platform): string
|
||||
{
|
||||
return 'TINYINT';
|
||||
}
|
||||
|
||||
public function getName()
|
||||
public function getName(): string
|
||||
{
|
||||
return 'tinyint';
|
||||
}
|
||||
|
||||
public function requiresSQLCommentHint(AbstractPlatform $platform)
|
||||
public function requiresSQLCommentHint(AbstractPlatform $platform): bool
|
||||
{
|
||||
//We use the comment, so that doctrine migrations can properly detect, that nothing has changed and no migration is needed.
|
||||
return true;
|
||||
|
|
|
@ -41,7 +41,7 @@ class InstanceOfConstraintType extends AbstractType
|
|||
$resolver->setDefault('data_class', InstanceOfConstraint::class);
|
||||
}
|
||||
|
||||
public function getParent()
|
||||
public function getParent(): string
|
||||
{
|
||||
return ChoiceConstraintType::class;
|
||||
}
|
||||
|
|
|
@ -8,7 +8,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
|
||||
class ProjectBOMEntryCollectionType extends AbstractType
|
||||
{
|
||||
public function getParent()
|
||||
public function getParent(): string
|
||||
{
|
||||
return CollectionType::class;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ class ProjectBOMEntryCollectionType extends AbstractType
|
|||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'project_bom_entry_collection';
|
||||
}
|
||||
|
|
|
@ -93,7 +93,7 @@ class ProjectBOMEntryType extends AbstractType
|
|||
}
|
||||
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'project_bom_entry';
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ use Symfony\Component\OptionsResolver\OptionsResolver;
|
|||
|
||||
class PartLotSelectType extends AbstractType
|
||||
{
|
||||
public function getParent()
|
||||
public function getParent(): string
|
||||
{
|
||||
return EntityType::class;
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ class PartSelectType extends AbstractType implements DataMapperInterface
|
|||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'part_select';
|
||||
}
|
||||
|
|
|
@ -34,7 +34,7 @@ class ThemeChoiceType extends AbstractType
|
|||
$this->available_themes = $available_themes;
|
||||
}
|
||||
|
||||
public function getParent()
|
||||
public function getParent(): string
|
||||
{
|
||||
return ChoiceType::class;
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class UserSelectType extends AbstractType
|
|||
]);
|
||||
}
|
||||
|
||||
public function getParent()
|
||||
public function getParent(): string
|
||||
{
|
||||
return StructuralEntityType::class;
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ class EnsureSAMLUserForSAMLLoginChecker implements EventSubscriberInterface
|
|||
$this->translator = $translator;
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
AuthenticationSuccessEvent::class => 'onAuthenticationSuccess',
|
||||
|
|
|
@ -118,7 +118,7 @@ class ParameterVoter extends ExtendedVoter
|
|||
return $this->resolver->inherit($user, $param, $attribute) ?? false;
|
||||
}
|
||||
|
||||
protected function supports(string $attribute, $subject)
|
||||
protected function supports(string $attribute, $subject): bool
|
||||
{
|
||||
if (is_a($subject, AbstractParameter::class, true)) {
|
||||
//These are the allowed attributes
|
||||
|
|
|
@ -43,7 +43,7 @@ class StructuralElementDenormalizer implements ContextAwareDenormalizerInterface
|
|||
$this->entityManager = $entityManager;
|
||||
}
|
||||
|
||||
public function supportsDenormalization($data, string $type, string $format = null, array $context = [])
|
||||
public function supportsDenormalization($data, string $type, string $format = null, array $context = []): bool
|
||||
{
|
||||
return is_array($data)
|
||||
&& is_subclass_of($type, AbstractStructuralDBElement::class)
|
||||
|
|
|
@ -37,7 +37,7 @@ class StructuralElementFromNameDenormalizer implements DenormalizerInterface, Ca
|
|||
$this->em = $em;
|
||||
}
|
||||
|
||||
public function supportsDenormalization($data, string $type, string $format = null)
|
||||
public function supportsDenormalization($data, string $type, string $format = null): bool
|
||||
{
|
||||
return is_string($data) && is_subclass_of($type, AbstractStructuralDBElement::class);
|
||||
}
|
||||
|
|
|
@ -32,7 +32,7 @@ final class MiscExtension extends AbstractExtension
|
|||
$this->eventCommentNeededHelper = $eventCommentNeededHelper;
|
||||
}
|
||||
|
||||
public function getFunctions()
|
||||
public function getFunctions(): array
|
||||
{
|
||||
return [
|
||||
new \Twig\TwigFunction('event_comment_needed',
|
||||
|
|
|
@ -54,7 +54,7 @@ final class TwigCoreExtension extends AbstractExtension
|
|||
];
|
||||
}
|
||||
|
||||
public function getFilters()
|
||||
public function getFilters(): array
|
||||
{
|
||||
return [
|
||||
/* Converts the given object to an array representation of the public/accessible properties */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue