mirror of
https://github.com/wallabag/wallabag.git
synced 2025-04-23 18:34:06 +00:00
Merge pull request #7967 from wallabag/fix-some-deprecation-notices
Fix some deprecation notices
This commit is contained in:
commit
7f340f83d2
56 changed files with 88 additions and 80 deletions
fixtures
src
Command
CleanDownloadedImagesCommand.phpCleanDuplicatesCommand.phpExportCommand.phpGenerateUrlHashesCommand.php
Import
InstallCommand.phpListUserCommand.phpReloadEntryCommand.phpShowUserCommand.phpTagAllCommand.phpUpdatePicturesPathCommand.phpController
Doctrine
Event
Listener
AuthenticationFailureListener.phpCreateConfigListener.phpLocaleListener.phpPasswordResettingListener.phpRegistrationListener.php
Subscriber
Form/Type
Api
ChangePasswordType.phpConfigType.phpEditEntryType.phpEntryFilterType.phpFeedType.phpIgnoreOriginInstanceRuleType.phpIgnoreOriginUserRuleType.phpNewEntryType.phpNewTagType.phpNewUserType.phpRenameTagType.phpSiteCredentialType.phpTaggingRuleImportType.phpTaggingRuleType.phpUploadImportType.phpUserInformationType.phpHelper
Import
Operator/PHP
ParamConverter
Repository/Api
Twig
tests
Event/Listener
Helper
SiteConfig
|
@ -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') . ' ---');
|
||||
|
||||
|
@ -125,7 +125,6 @@ class ImportCommand extends Command
|
|||
// Authenticate user for paywalled websites
|
||||
$token = new UsernamePasswordToken(
|
||||
$entityUser,
|
||||
null,
|
||||
'main',
|
||||
$entityUser->getRoles());
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
|
|
|
@ -314,7 +314,7 @@ class EntryRestController extends WallabagRestController
|
|||
$order = strtolower($request->query->get('order', 'desc'));
|
||||
$page = (int) $request->query->get('page', 1);
|
||||
$perPage = (int) $request->query->get('perPage', 30);
|
||||
$tags = \is_array($request->query->get('tags')) ? '' : (string) $request->query->get('tags', '');
|
||||
$tags = \is_array($request->query->all()['tags'] ?? '') ? '' : (string) $request->query->get('tags', '');
|
||||
$since = $request->query->get('since', 0);
|
||||
$detail = strtolower($request->query->get('detail', 'full'));
|
||||
$domainName = (null === $request->query->get('domain_name')) ? '' : (string) $request->query->get('domain_name');
|
||||
|
@ -477,7 +477,7 @@ class EntryRestController extends WallabagRestController
|
|||
{
|
||||
$this->validateAuthentication();
|
||||
|
||||
$urls = json_decode($request->query->get('urls', []));
|
||||
$urls = json_decode($request->query->get('urls', '[]'));
|
||||
|
||||
if (empty($urls)) {
|
||||
return $this->sendResponse([]);
|
||||
|
@ -537,7 +537,7 @@ class EntryRestController extends WallabagRestController
|
|||
{
|
||||
$this->validateAuthentication();
|
||||
|
||||
$urls = json_decode($request->query->get('urls', []));
|
||||
$urls = json_decode($request->query->get('urls', '[]'));
|
||||
|
||||
$limit = $this->getParameter('wallabag.api_limit_mass_actions');
|
||||
|
||||
|
@ -1287,7 +1287,7 @@ class EntryRestController extends WallabagRestController
|
|||
{
|
||||
$this->validateAuthentication();
|
||||
|
||||
$list = json_decode($request->query->get('list', []));
|
||||
$list = json_decode($request->query->get('list', '[]'));
|
||||
|
||||
if (empty($list)) {
|
||||
return $this->sendResponse([]);
|
||||
|
@ -1354,7 +1354,7 @@ class EntryRestController extends WallabagRestController
|
|||
{
|
||||
$this->validateAuthentication();
|
||||
|
||||
$list = json_decode($request->query->get('list', []));
|
||||
$list = json_decode($request->query->get('list', '[]'));
|
||||
|
||||
if (empty($list)) {
|
||||
return $this->sendResponse([]);
|
||||
|
@ -1413,7 +1413,7 @@ class EntryRestController extends WallabagRestController
|
|||
{
|
||||
return [
|
||||
'title' => $request->request->get('title'),
|
||||
'tags' => $request->request->get('tags', []),
|
||||
'tags' => $request->request->get('tags', ''),
|
||||
'isArchived' => $request->request->get('archive'),
|
||||
'isStarred' => $request->request->get('starred'),
|
||||
'isPublic' => $request->request->get('public'),
|
||||
|
@ -1421,7 +1421,7 @@ class EntryRestController extends WallabagRestController
|
|||
'language' => $request->request->get('language'),
|
||||
'picture' => $request->request->get('preview_picture'),
|
||||
'publishedAt' => $request->request->get('published_at'),
|
||||
'authors' => $request->request->get('authors', ''),
|
||||
'authors' => $request->request->all()['authors'] ?? '',
|
||||
'origin_url' => $request->request->get('origin_url', ''),
|
||||
];
|
||||
}
|
||||
|
|
|
@ -37,7 +37,7 @@ class TaggingRuleRestController extends WallabagRestController
|
|||
SerializationContext::create()->setGroups(['export_tagging_rule'])
|
||||
);
|
||||
|
||||
return Response::create(
|
||||
return new Response(
|
||||
$data,
|
||||
200,
|
||||
[
|
||||
|
|
|
@ -700,7 +700,7 @@ class ConfigController extends AbstractController
|
|||
SerializationContext::create()->setGroups(['export_tagging_rule'])
|
||||
);
|
||||
|
||||
return Response::create(
|
||||
return new Response(
|
||||
$data,
|
||||
200,
|
||||
[
|
||||
|
|
|
@ -625,6 +625,7 @@ class EntryController extends AbstractController
|
|||
{
|
||||
$searchTerm = (isset($request->query->get('search_entry')['term']) ? trim($request->query->get('search_entry')['term']) : '');
|
||||
$currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : '');
|
||||
$currentEntryId = $request->attributes->getInt('id');
|
||||
|
||||
$formOptions = [];
|
||||
|
||||
|
@ -651,7 +652,7 @@ class EntryController extends AbstractController
|
|||
$formOptions['filter_unread'] = true;
|
||||
break;
|
||||
case 'same-domain':
|
||||
$qb = $this->entryRepository->getBuilderForSameDomainByUser($this->getUser()->getId(), $request->get('id'));
|
||||
$qb = $this->entryRepository->getBuilderForSameDomainByUser($this->getUser()->getId(), $currentEntryId);
|
||||
break;
|
||||
case 'all':
|
||||
$qb = $this->entryRepository->getBuilderForAllByUser($this->getUser()->getId());
|
||||
|
@ -664,7 +665,7 @@ class EntryController extends AbstractController
|
|||
|
||||
if ($request->query->has($form->getName())) {
|
||||
// manually bind values from the request
|
||||
$form->submit($request->query->get($form->getName()));
|
||||
$form->submit($request->query->all($form->getName()));
|
||||
|
||||
// build the query from the given form object
|
||||
$this->filterBuilderUpdater->addFilterConditions($form, $qb);
|
||||
|
|
|
@ -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',
|
||||
|
@ -30,7 +30,7 @@ class AuthenticationFailureListener implements EventSubscriberInterface
|
|||
*/
|
||||
public function onAuthenticationFailure()
|
||||
{
|
||||
$request = $this->requestStack->getMasterRequest();
|
||||
$request = $this->requestStack->getMainRequest();
|
||||
|
||||
$this->logger->error('Authentication failure for user "' . $request->request->get('_username') . '", from IP "' . $request->getClientIp() . '", with UA: "' . $request->server->get('HTTP_USER_AGENT') . '".');
|
||||
}
|
||||
|
|
|
@ -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
|
||||
|
@ -53,8 +53,8 @@ class CreateConfigListener implements EventSubscriberInterface
|
|||
{
|
||||
$language = $this->language;
|
||||
|
||||
if ($this->requestStack->getMasterRequest()) {
|
||||
$session = $this->requestStack->getMasterRequest()->getSession();
|
||||
if ($this->requestStack->getMainRequest()) {
|
||||
$session = $this->requestStack->getMainRequest()->getSession();
|
||||
$language = $session->get('_locale', $this->language);
|
||||
}
|
||||
|
||||
|
|
|
@ -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';
|
||||
}
|
||||
|
|
|
@ -234,7 +234,7 @@ class EntriesExport
|
|||
$hash = sha1(\sprintf('%s:%s', $this->wallabagUrl, implode(',', $entryIds)));
|
||||
$book->setIdentifier(\sprintf('urn:wallabag:%s', $hash), EPub::IDENTIFIER_URI);
|
||||
|
||||
return Response::create(
|
||||
return new Response(
|
||||
$book->getBook(),
|
||||
200,
|
||||
[
|
||||
|
@ -309,7 +309,7 @@ class EntriesExport
|
|||
// set image scale factor
|
||||
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);
|
||||
|
||||
return Response::create(
|
||||
return new Response(
|
||||
$pdf->Output('', 'S'),
|
||||
200,
|
||||
[
|
||||
|
@ -354,7 +354,7 @@ class EntriesExport
|
|||
$output = stream_get_contents($handle);
|
||||
fclose($handle);
|
||||
|
||||
return Response::create(
|
||||
return new Response(
|
||||
$output,
|
||||
200,
|
||||
[
|
||||
|
@ -370,7 +370,7 @@ class EntriesExport
|
|||
*/
|
||||
private function produceJson(): Response
|
||||
{
|
||||
return Response::create(
|
||||
return new Response(
|
||||
$this->prepareSerializingContent('json'),
|
||||
200,
|
||||
[
|
||||
|
@ -386,7 +386,7 @@ class EntriesExport
|
|||
*/
|
||||
private function produceXml(): Response
|
||||
{
|
||||
return Response::create(
|
||||
return new Response(
|
||||
$this->prepareSerializingContent('xml'),
|
||||
200,
|
||||
[
|
||||
|
@ -410,7 +410,7 @@ class EntriesExport
|
|||
$content .= $html->getText();
|
||||
}
|
||||
|
||||
return Response::create(
|
||||
return new Response(
|
||||
$content,
|
||||
200,
|
||||
[
|
||||
|
@ -433,7 +433,7 @@ class EntriesExport
|
|||
$content .= $converter->convert('<h1>' . $entry->getTitle() . '</h1>' . $entry->getContent());
|
||||
}
|
||||
|
||||
return Response::create(
|
||||
return new Response(
|
||||
$content,
|
||||
200,
|
||||
[
|
||||
|
|
|
@ -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']),
|
||||
|
|
|
@ -48,7 +48,7 @@ class CreateConfigListenerTest extends TestCase
|
|||
$this->dispatcher->addSubscriber($this->listener);
|
||||
|
||||
$this->request = Request::create('/');
|
||||
$this->response = Response::create();
|
||||
$this->response = new Response();
|
||||
}
|
||||
|
||||
public function testWithValidUser()
|
||||
|
|
|
@ -27,7 +27,7 @@ class UserLocaleListenerTest extends TestCase
|
|||
|
||||
$user->setConfig($config);
|
||||
|
||||
$userToken = new UsernamePasswordToken($user, '', 'test');
|
||||
$userToken = new UsernamePasswordToken($user, 'test');
|
||||
$request = Request::create('/');
|
||||
$event = new InteractiveLoginEvent($request, $userToken);
|
||||
|
||||
|
@ -48,7 +48,7 @@ class UserLocaleListenerTest extends TestCase
|
|||
|
||||
$user->setConfig($config);
|
||||
|
||||
$userToken = new UsernamePasswordToken($user, '', 'test');
|
||||
$userToken = new UsernamePasswordToken($user, 'test');
|
||||
$request = Request::create('/');
|
||||
$event = new InteractiveLoginEvent($request, $userToken);
|
||||
|
||||
|
@ -71,7 +71,7 @@ class UserLocaleListenerTest extends TestCase
|
|||
|
||||
$user->setConfig($config);
|
||||
|
||||
$userToken = new UsernamePasswordToken($user, '', 'test');
|
||||
$userToken = new UsernamePasswordToken($user, 'test');
|
||||
$request = Request::create('/');
|
||||
$event = new InteractiveLoginEvent($request, $userToken);
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@ class RedirectTest extends TestCase
|
|||
|
||||
$this->user->setConfig($config);
|
||||
|
||||
$this->token = new UsernamePasswordToken($this->user, 'password', 'key');
|
||||
$this->token = new UsernamePasswordToken($this->user, 'key');
|
||||
$tokenStorage = new TokenStorage();
|
||||
$tokenStorage->setToken($this->token);
|
||||
|
||||
|
|
|
@ -55,7 +55,7 @@ class GrabySiteConfigBuilderTest extends WallabagTestCase
|
|||
->method('getId')
|
||||
->willReturn(1);
|
||||
|
||||
$token = new UsernamePasswordToken($user, 'pass', 'provider');
|
||||
$token = new UsernamePasswordToken($user, 'provider');
|
||||
|
||||
$tokenStorage = new TokenStorage();
|
||||
$tokenStorage->setToken($token);
|
||||
|
@ -114,7 +114,7 @@ class GrabySiteConfigBuilderTest extends WallabagTestCase
|
|||
->method('getId')
|
||||
->willReturn(1);
|
||||
|
||||
$token = new UsernamePasswordToken($user, 'pass', 'provider');
|
||||
$token = new UsernamePasswordToken($user, 'provider');
|
||||
|
||||
$tokenStorage = new TokenStorage();
|
||||
$tokenStorage->setToken($token);
|
||||
|
@ -173,7 +173,7 @@ class GrabySiteConfigBuilderTest extends WallabagTestCase
|
|||
->method('getId')
|
||||
->willReturn(1);
|
||||
|
||||
$token = new UsernamePasswordToken($user, 'pass', 'provider');
|
||||
$token = new UsernamePasswordToken($user, 'provider');
|
||||
|
||||
$tokenStorage = new TokenStorage();
|
||||
$tokenStorage->setToken($token);
|
||||
|
@ -291,7 +291,7 @@ class GrabySiteConfigBuilderTest extends WallabagTestCase
|
|||
->method('getId')
|
||||
->willReturn(1);
|
||||
|
||||
$token = new UsernamePasswordToken($user, 'pass', 'provider');
|
||||
$token = new UsernamePasswordToken($user, 'provider');
|
||||
|
||||
$tokenStorage = new TokenStorage();
|
||||
$tokenStorage->setToken($token);
|
||||
|
|
Loading…
Reference in a new issue