mirror of
https://github.com/wallabag/wallabag.git
synced 2025-03-13 14:42:39 +00:00
Fix some self deprecation notices
This commit is contained in:
parent
5a8b581adf
commit
98ed784af3
47 changed files with 57 additions and 49 deletions
|
@ -11,7 +11,7 @@ use Wallabag\Entity\User;
|
|||
|
||||
class AnnotationFixtures extends Fixture implements DependentFixtureInterface
|
||||
{
|
||||
public function load(ObjectManager $manager)
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
$annotation1 = new Annotation($this->getReference('admin-user', User::class));
|
||||
$annotation1->setEntry($this->getReference('entry1', Entry::class));
|
||||
|
|
|
@ -8,7 +8,7 @@ use Wallabag\Entity\User;
|
|||
|
||||
class UserFixtures extends Fixture
|
||||
{
|
||||
public function load(ObjectManager $manager)
|
||||
public function load(ObjectManager $manager): void
|
||||
{
|
||||
$userAdmin = new User();
|
||||
$userAdmin->setName('Big boss');
|
||||
|
|
|
@ -38,7 +38,7 @@ class CleanDownloadedImagesCommand extends Command
|
|||
);
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
|
|
|
@ -45,7 +45,7 @@ class CleanDuplicatesCommand extends Command
|
|||
);
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$this->io = new SymfonyStyle($input, $output);
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ class ExportCommand extends Command
|
|||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ class GenerateUrlHashesCommand extends Command
|
|||
->addArgument('username', InputArgument::OPTIONAL, 'User to process entries');
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$this->output = $output;
|
||||
|
||||
|
|
|
@ -97,7 +97,7 @@ class ImportCommand extends Command
|
|||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$output->writeln('Start : ' . (new \DateTime())->format('d-m-Y G:i:s') . ' ---');
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ class RedisWorkerCommand extends Command
|
|||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$output->writeln('Worker started at: ' . (new \DateTime())->format('d-m-Y G:i:s'));
|
||||
$output->writeln('Waiting for message ...');
|
||||
|
|
|
@ -70,7 +70,7 @@ class InstallCommand extends Command
|
|||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$this->defaultInput = $input;
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ class ListUserCommand extends Command
|
|||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
|
|
|
@ -51,7 +51,7 @@ class ReloadEntryCommand extends Command
|
|||
);
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ class ShowUserCommand extends Command
|
|||
);
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$this->io = new SymfonyStyle($input, $output);
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ class TagAllCommand extends Command
|
|||
;
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ class UpdatePicturesPathCommand extends Command
|
|||
);
|
||||
}
|
||||
|
||||
protected function execute(InputInterface $input, OutputInterface $output)
|
||||
protected function execute(InputInterface $input, OutputInterface $output): int
|
||||
{
|
||||
$io = new SymfonyStyle($input, $output);
|
||||
|
||||
|
|
|
@ -25,12 +25,12 @@ class JsonArrayType extends JsonType
|
|||
return json_decode($value, true);
|
||||
}
|
||||
|
||||
public function getName()
|
||||
public function getName(): string
|
||||
{
|
||||
return 'json_array';
|
||||
}
|
||||
|
||||
public function requiresSQLCommentHint(AbstractPlatform $platform)
|
||||
public function requiresSQLCommentHint(AbstractPlatform $platform): bool
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ class AuthenticationFailureListener implements EventSubscriberInterface
|
|||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
AuthenticationEvents::AUTHENTICATION_FAILURE => 'onAuthenticationFailure',
|
||||
|
|
|
@ -38,7 +38,7 @@ class CreateConfigListener implements EventSubscriberInterface
|
|||
$this->displayThumbnails = $displayThumbnails;
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
// when a user register using the normal form
|
||||
|
|
|
@ -34,7 +34,7 @@ class LocaleListener implements EventSubscriberInterface
|
|||
}
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
// must be registered before the default Locale listener
|
||||
|
|
|
@ -22,7 +22,7 @@ class PasswordResettingListener implements EventSubscriberInterface
|
|||
$this->router = $router;
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
FOSUserEvents::RESETTING_RESET_SUCCESS => 'onPasswordResettingSuccess',
|
||||
|
|
|
@ -26,7 +26,7 @@ class RegistrationListener implements EventSubscriberInterface
|
|||
$this->urlGenerator = $urlGenerator;
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
FOSUserEvents::REGISTRATION_INITIALIZE => 'onRegistrationInitialize',
|
||||
|
|
|
@ -25,7 +25,7 @@ class DownloadImagesSubscriber implements EventSubscriberInterface
|
|||
$this->logger = $logger;
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
EntrySavedEvent::NAME => 'onEntrySaved',
|
||||
|
|
|
@ -18,7 +18,7 @@ class GenerateCustomCSSSubscriber implements EventSubscriberInterface
|
|||
$this->compiler = $compiler;
|
||||
}
|
||||
|
||||
public static function getSubscribedEvents()
|
||||
public static function getSubscribedEvents(): array
|
||||
{
|
||||
return [
|
||||
ConfigUpdatedEvent::NAME => 'onConfigUpdated',
|
||||
|
|
|
@ -15,7 +15,7 @@ class SchemaAdapterSubscriber implements EventSubscriber
|
|||
$this->databaseTablePrefix = $databaseTablePrefix;
|
||||
}
|
||||
|
||||
public function getSubscribedEvents()
|
||||
public function getSubscribedEvents(): array
|
||||
{
|
||||
return ['postGenerateSchema'];
|
||||
}
|
||||
|
|
|
@ -25,7 +25,7 @@ class TablePrefixSubscriber implements EventSubscriber
|
|||
$this->tablePrefix = (string) $tablePrefix;
|
||||
}
|
||||
|
||||
public function getSubscribedEvents()
|
||||
public function getSubscribedEvents(): array
|
||||
{
|
||||
return ['loadClassMetadata'];
|
||||
}
|
||||
|
|
|
@ -45,7 +45,7 @@ class ClientType extends AbstractType
|
|||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'client';
|
||||
}
|
||||
|
|
|
@ -41,7 +41,7 @@ class ChangePasswordType extends AbstractType
|
|||
;
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'change_passwd';
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ class ConfigType extends AbstractType
|
|||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'config';
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ class EditEntryType extends AbstractType
|
|||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'entry';
|
||||
}
|
||||
|
|
|
@ -197,7 +197,7 @@ class EntryFilterType extends AbstractType
|
|||
;
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'entry_filter';
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ class FeedType extends AbstractType
|
|||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'feed_config';
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ class IgnoreOriginInstanceRuleType extends AbstractType
|
|||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'ignore_origin_instance_rule';
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ class IgnoreOriginUserRuleType extends AbstractType
|
|||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'ignore_origin_user_rule';
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ class NewEntryType extends AbstractType
|
|||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'entry';
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ class NewTagType extends AbstractType
|
|||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'tag';
|
||||
}
|
||||
|
|
|
@ -53,7 +53,7 @@ class NewUserType extends AbstractType
|
|||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'new_user';
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ class RenameTagType extends AbstractType
|
|||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'tag';
|
||||
}
|
||||
|
|
|
@ -38,7 +38,7 @@ class SiteCredentialType extends AbstractType
|
|||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'site_credential';
|
||||
}
|
||||
|
|
|
@ -22,7 +22,7 @@ class TaggingRuleImportType extends AbstractType
|
|||
;
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'upload_tagging_rule_file';
|
||||
}
|
||||
|
|
|
@ -40,7 +40,7 @@ class TaggingRuleType extends AbstractType
|
|||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'tagging_rule';
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ class UploadImportType extends AbstractType
|
|||
;
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'upload_import_file';
|
||||
}
|
||||
|
|
|
@ -30,7 +30,7 @@ class UserInformationType extends AbstractType
|
|||
;
|
||||
}
|
||||
|
||||
public function getParent()
|
||||
public function getParent(): ?string
|
||||
{
|
||||
return RegistrationFormType::class;
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ class UserInformationType extends AbstractType
|
|||
]);
|
||||
}
|
||||
|
||||
public function getBlockPrefix()
|
||||
public function getBlockPrefix(): string
|
||||
{
|
||||
return 'update_user';
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ abstract class AbstractImport implements ImportInterface
|
|||
$this->eventDispatcher = $eventDispatcher;
|
||||
}
|
||||
|
||||
public function setLogger(LoggerInterface $logger)
|
||||
public function setLogger(LoggerInterface $logger): void
|
||||
{
|
||||
$this->logger = $logger;
|
||||
}
|
||||
|
|
|
@ -16,6 +16,10 @@ class Matches
|
|||
{
|
||||
public function __invoke($subject, $pattern)
|
||||
{
|
||||
if (null === $subject) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return false !== stripos($subject, $pattern);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,6 +16,10 @@ class NotMatches
|
|||
{
|
||||
public function __invoke($subject, $pattern)
|
||||
{
|
||||
if (null === $subject) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false === stripos($subject, $pattern);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ class UsernameFeedTokenConverter implements ParamConverterInterface
|
|||
*
|
||||
* Check, if object supported by our converter
|
||||
*/
|
||||
public function supports(ParamConverter $configuration)
|
||||
public function supports(ParamConverter $configuration): bool
|
||||
{
|
||||
// If there is no manager, this means that only Doctrine DBAL is configured
|
||||
// In this case we can do nothing and just return
|
||||
|
@ -65,7 +65,7 @@ class UsernameFeedTokenConverter implements ParamConverterInterface
|
|||
* @throws \InvalidArgumentException When route attributes are missing
|
||||
* @throws NotFoundHttpException When object not found
|
||||
*/
|
||||
public function apply(Request $request, ParamConverter $configuration)
|
||||
public function apply(Request $request, ParamConverter $configuration): bool
|
||||
{
|
||||
$username = $request->attributes->get('username');
|
||||
$feedToken = $request->attributes->get('token');
|
||||
|
|
|
@ -16,7 +16,7 @@ class ClientRepository extends ServiceEntityRepository
|
|||
parent::__construct($registry, Client::class);
|
||||
}
|
||||
|
||||
public function findOneBy(array $criteria, ?array $orderBy = null)
|
||||
public function findOneBy(array $criteria, ?array $orderBy = null): ?object
|
||||
{
|
||||
if (!empty($criteria['id'])) {
|
||||
// cast client id to be an integer to avoid postgres error:
|
||||
|
|
|
@ -36,7 +36,7 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface
|
|||
return [];
|
||||
}
|
||||
|
||||
public function getFilters()
|
||||
public function getFilters(): array
|
||||
{
|
||||
return [
|
||||
new TwigFilter('removeWww', [$this, 'removeWww']),
|
||||
|
@ -45,7 +45,7 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface
|
|||
];
|
||||
}
|
||||
|
||||
public function getFunctions()
|
||||
public function getFunctions(): array
|
||||
{
|
||||
return [
|
||||
new TwigFunction('count_entries', [$this, 'countEntries']),
|
||||
|
|
Loading…
Reference in a new issue