diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index a64299b8b..e9e8e70f1 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -1,13 +1,14 @@ setRiskyAllowed(true) ->setRules([ '@Symfony' => true, '@Symfony:risky' => true, 'array_syntax' => [ - 'syntax' => 'short' + 'syntax' => 'short', ], 'combine_consecutive_unsets' => true, 'heredoc_to_nowdoc' => true, @@ -21,21 +22,23 @@ return $config 'use', 'parenthesis_brace_block', 'square_brace_block', - 'curly_brace_block' + 'curly_brace_block', ], ], 'no_unreachable_default_argument_value' => true, + 'no_useless_concat_operator' => false, 'no_useless_else' => true, 'no_useless_return' => true, 'ordered_class_elements' => true, 'ordered_imports' => true, 'php_unit_strict' => true, 'phpdoc_order' => true, + 'phpdoc_separation' => false, // 'psr_autoloading' => true, 'strict_comparison' => true, 'strict_param' => true, 'concat_space' => [ - 'spacing' => 'one' + 'spacing' => 'one', ], ]) ->setFinder( @@ -44,7 +47,7 @@ return $config 'node_modules', 'vendor', 'var', - 'web' + 'web', ]) ->in(__DIR__) ) diff --git a/app/AppKernel.php b/app/AppKernel.php index 4dc350e18..9d942a2cd 100644 --- a/app/AppKernel.php +++ b/app/AppKernel.php @@ -116,7 +116,7 @@ class AppKernel extends Kernel $scheme = 'sqlite'; break; default: - throw new \RuntimeException('Unsupported database driver: ' . $container->getParameter('database_driver')); + throw new RuntimeException('Unsupported database driver: ' . $container->getParameter('database_driver')); } $container->setParameter('database_scheme', $scheme); diff --git a/app/DoctrineMigrations/Version20170511211659.php b/app/DoctrineMigrations/Version20170511211659.php index 0ea96621c..18c3c7691 100644 --- a/app/DoctrineMigrations/Version20170511211659.php +++ b/app/DoctrineMigrations/Version20170511211659.php @@ -27,12 +27,12 @@ class Version20170511211659 extends WallabagMigration $this->addSql(<<addSql('DROP TABLE ' . $annotationTableName); $this->addSql(<<addSql(<<getReference('admin-user', User::class)); @@ -48,9 +45,6 @@ class AnnotationFixtures extends Fixture implements DependentFixtureInterface $manager->flush(); } - /** - * {@inheritdoc} - */ public function getDependencies() { return [ diff --git a/src/Wallabag/AnnotationBundle/DependencyInjection/Configuration.php b/src/Wallabag/AnnotationBundle/DependencyInjection/Configuration.php index b3b5f8226..bb1e03cf9 100644 --- a/src/Wallabag/AnnotationBundle/DependencyInjection/Configuration.php +++ b/src/Wallabag/AnnotationBundle/DependencyInjection/Configuration.php @@ -7,9 +7,6 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; class Configuration implements ConfigurationInterface { - /** - * {@inheritdoc} - */ public function getConfigTreeBuilder() { return new TreeBuilder('wallabag_annotation'); diff --git a/src/Wallabag/AnnotationBundle/DependencyInjection/WallabagAnnotationExtension.php b/src/Wallabag/AnnotationBundle/DependencyInjection/WallabagAnnotationExtension.php index 159576d67..90cfcead2 100644 --- a/src/Wallabag/AnnotationBundle/DependencyInjection/WallabagAnnotationExtension.php +++ b/src/Wallabag/AnnotationBundle/DependencyInjection/WallabagAnnotationExtension.php @@ -7,9 +7,6 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension; class WallabagAnnotationExtension extends Extension { - /** - * {@inheritdoc} - */ public function load(array $configs, ContainerBuilder $container) { $configuration = new Configuration(); diff --git a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php index ff73e4c61..cab728027 100644 --- a/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php +++ b/src/Wallabag/AnnotationBundle/Repository/AnnotationRepository.php @@ -137,10 +137,6 @@ class AnnotationRepository extends ServiceEntityRepository /** * Find all annotations related to archived entries. - * - * @param $userId - * - * @return mixed */ public function findAllArchivedEntriesByUser($userId) { diff --git a/src/Wallabag/ApiBundle/Controller/DeveloperController.php b/src/Wallabag/ApiBundle/Controller/DeveloperController.php index 0c08968e2..5c920e5bd 100644 --- a/src/Wallabag/ApiBundle/Controller/DeveloperController.php +++ b/src/Wallabag/ApiBundle/Controller/DeveloperController.php @@ -103,8 +103,7 @@ class DeveloperController extends AbstractController */ public function howtoFirstAppAction() { - return $this->render('@WallabagCore/Developer/howto_app.html.twig', - [ + return $this->render('@WallabagCore/Developer/howto_app.html.twig', [ 'wallabag_url' => $this->getParameter('domain_name'), ]); } diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index b2f5f30f7..de504db7d 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php @@ -118,8 +118,6 @@ class WallabagRestController extends AbstractFOSRestController /** * Shortcut to send data serialized in json. * - * @param mixed $data - * * @return JsonResponse */ protected function sendResponse($data) diff --git a/src/Wallabag/ApiBundle/DependencyInjection/Configuration.php b/src/Wallabag/ApiBundle/DependencyInjection/Configuration.php index 276374018..1f206d2d4 100644 --- a/src/Wallabag/ApiBundle/DependencyInjection/Configuration.php +++ b/src/Wallabag/ApiBundle/DependencyInjection/Configuration.php @@ -12,9 +12,6 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; */ class Configuration implements ConfigurationInterface { - /** - * {@inheritdoc} - */ public function getConfigTreeBuilder() { return new TreeBuilder('wallabag_api'); diff --git a/src/Wallabag/CoreBundle/Command/CleanDownloadedImagesCommand.php b/src/Wallabag/CoreBundle/Command/CleanDownloadedImagesCommand.php index fe4f77a70..b8f188deb 100644 --- a/src/Wallabag/CoreBundle/Command/CleanDownloadedImagesCommand.php +++ b/src/Wallabag/CoreBundle/Command/CleanDownloadedImagesCommand.php @@ -30,10 +30,10 @@ class CleanDownloadedImagesCommand extends Command ->setName('wallabag:clean-downloaded-images') ->setDescription('Cleans downloaded images which are no more associated to an entry') ->addOption( - 'dry-run', - null, - InputOption::VALUE_NONE, - 'Do not remove images, just dump counters' + 'dry-run', + null, + InputOption::VALUE_NONE, + 'Do not remove images, just dump counters' ); } diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php index d29f177e6..a35cc08cd 100644 --- a/src/Wallabag/CoreBundle/Command/InstallCommand.php +++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php @@ -66,10 +66,10 @@ class InstallCommand extends Command ->setName('wallabag:install') ->setDescription('wallabag installer.') ->addOption( - 'reset', - null, - InputOption::VALUE_NONE, - 'Reset current database' + 'reset', + null, + InputOption::VALUE_NONE, + 'Reset current database' ) ; } @@ -125,8 +125,8 @@ class InstallCommand extends Command try { $conn->connect(); } catch (\Exception $e) { - if (false === strpos($e->getMessage(), 'Unknown database') - && false === strpos($e->getMessage(), 'database "' . $this->databaseName . '" does not exist')) { + if (!str_contains($e->getMessage(), 'Unknown database') + && !str_contains($e->getMessage(), 'database "' . $this->databaseName . '" does not exist')) { $fulfilled = false; $status = 'ERROR!'; $help = 'Can\'t connect to the database: ' . $e->getMessage(); @@ -381,12 +381,12 @@ class InstallCommand extends Command $schemaManager = $connection->createSchemaManager(); } catch (\Exception $exception) { // mysql & sqlite - if (false !== strpos($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) { + if (str_contains($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) { return false; } // pgsql - if (false !== strpos($exception->getMessage(), sprintf('database "%s" does not exist', $databaseName))) { + if (str_contains($exception->getMessage(), sprintf('database "%s" does not exist', $databaseName))) { return false; } diff --git a/src/Wallabag/CoreBundle/Command/TagAllCommand.php b/src/Wallabag/CoreBundle/Command/TagAllCommand.php index ec1b0ee67..37f84fef9 100644 --- a/src/Wallabag/CoreBundle/Command/TagAllCommand.php +++ b/src/Wallabag/CoreBundle/Command/TagAllCommand.php @@ -34,9 +34,9 @@ class TagAllCommand extends Command ->setName('wallabag:tag:all') ->setDescription('Tag all entries using the tagging rules.') ->addArgument( - 'username', - InputArgument::REQUIRED, - 'User to tag entries for.' + 'username', + InputArgument::REQUIRED, + 'User to tag entries for.' ) ; } diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 03b5bbefb..baa0d8140 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php @@ -674,7 +674,7 @@ class ConfigController extends AbstractController */ public function setLocaleAction(Request $request, ValidatorInterface $validator, $language = null) { - $errors = $validator->validate($language, (new LocaleConstraint(['canonicalize' => true]))); + $errors = $validator->validate($language, new LocaleConstraint(['canonicalize' => true])); if (0 === \count($errors)) { $request->getSession()->set('_locale', $language); diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index b554e43e9..50e5e5bb6 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php @@ -80,7 +80,7 @@ class EntryController extends AbstractController }); foreach ($labels as $label) { $remove = false; - if (0 === strpos($label, '-')) { + if (str_starts_with($label, '-')) { $label = substr($label, 1); $remove = true; } diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php index 03aa5fb1d..5b0106af0 100644 --- a/src/Wallabag/CoreBundle/Controller/ExportController.php +++ b/src/Wallabag/CoreBundle/Controller/ExportController.php @@ -89,9 +89,9 @@ class ExportController extends AbstractController $currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : ''); $entries = $entryRepository->getBuilderForSearchByUser( - $this->getUser()->getId(), - $searchTerm, - $currentRoute + $this->getUser()->getId(), + $searchTerm, + $currentRoute )->getQuery() ->getResult(); diff --git a/src/Wallabag/CoreBundle/Controller/FeedController.php b/src/Wallabag/CoreBundle/Controller/FeedController.php index 06618faff..0eeab22c0 100644 --- a/src/Wallabag/CoreBundle/Controller/FeedController.php +++ b/src/Wallabag/CoreBundle/Controller/FeedController.php @@ -34,8 +34,6 @@ class FeedController extends AbstractController * * @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter") * - * @param $page - * * @return Response */ public function showUnreadFeedAction(User $user, $page) @@ -50,8 +48,6 @@ class FeedController extends AbstractController * * @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter") * - * @param $page - * * @return Response */ public function showArchiveFeedAction(User $user, $page) @@ -66,8 +62,6 @@ class FeedController extends AbstractController * * @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter") * - * @param $page - * * @return Response */ public function showStarredFeedAction(User $user, $page) @@ -241,8 +235,6 @@ class FeedController extends AbstractController 'domainName' => $this->getParameter('domain_name'), 'version' => $this->getParameter('wallabag_core.version'), 'updated' => $this->prepareFeedUpdatedDate($entries), - ], - new Response('', 200, ['Content-Type' => 'application/atom+xml']) - ); + ], new Response('', 200, ['Content-Type' => 'application/atom+xml'])); } } diff --git a/src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php index 6f6942113..1992fb905 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php +++ b/src/Wallabag/CoreBundle/DataFixtures/ConfigFixtures.php @@ -11,9 +11,6 @@ use Wallabag\UserBundle\Entity\User; class ConfigFixtures extends Fixture implements DependentFixtureInterface { - /** - * {@inheritdoc} - */ public function load(ObjectManager $manager): void { $adminConfig = new Config($this->getReference('admin-user', User::class)); @@ -59,9 +56,6 @@ class ConfigFixtures extends Fixture implements DependentFixtureInterface $manager->flush(); } - /** - * {@inheritdoc} - */ public function getDependencies() { return [ diff --git a/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php index 92f629424..571c8e8b2 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php +++ b/src/Wallabag/CoreBundle/DataFixtures/EntryFixtures.php @@ -12,9 +12,6 @@ use Wallabag\UserBundle\Entity\User; class EntryFixtures extends Fixture implements DependentFixtureInterface { - /** - * {@inheritdoc} - */ public function load(ObjectManager $manager): void { $now = new \DateTime(); @@ -144,9 +141,6 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface $manager->flush(); } - /** - * {@inheritdoc} - */ public function getDependencies() { return [ diff --git a/src/Wallabag/CoreBundle/DataFixtures/IgnoreOriginInstanceRuleFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/IgnoreOriginInstanceRuleFixtures.php index 7e6c26036..1e70763fc 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/IgnoreOriginInstanceRuleFixtures.php +++ b/src/Wallabag/CoreBundle/DataFixtures/IgnoreOriginInstanceRuleFixtures.php @@ -20,9 +20,6 @@ class IgnoreOriginInstanceRuleFixtures extends Fixture implements ContainerAware $this->container = $container; } - /** - * {@inheritdoc} - */ public function load(ObjectManager $manager): void { foreach ($this->container->getParameter('wallabag_core.default_ignore_origin_instance_rules') as $ignore_origin_instance_rule) { diff --git a/src/Wallabag/CoreBundle/DataFixtures/IgnoreOriginUserRuleFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/IgnoreOriginUserRuleFixtures.php index 0bf5d29b0..22b7efae6 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/IgnoreOriginUserRuleFixtures.php +++ b/src/Wallabag/CoreBundle/DataFixtures/IgnoreOriginUserRuleFixtures.php @@ -11,9 +11,6 @@ use Wallabag\UserBundle\Entity\User; class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureInterface { - /** - * {@inheritdoc} - */ public function load(ObjectManager $manager): void { $rule = new IgnoreOriginUserRule(); @@ -25,9 +22,6 @@ class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureIn $manager->flush(); } - /** - * {@inheritdoc} - */ public function getDependencies() { return [ diff --git a/src/Wallabag/CoreBundle/DataFixtures/InternalSettingFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/InternalSettingFixtures.php index a70fe489f..6014f4055 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/InternalSettingFixtures.php +++ b/src/Wallabag/CoreBundle/DataFixtures/InternalSettingFixtures.php @@ -20,9 +20,6 @@ class InternalSettingFixtures extends Fixture implements ContainerAwareInterface $this->container = $container; } - /** - * {@inheritdoc} - */ public function load(ObjectManager $manager): void { foreach ($this->container->getParameter('wallabag_core.default_internal_settings') as $setting) { diff --git a/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php index 45088168d..92c226e10 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php +++ b/src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php @@ -24,9 +24,6 @@ class SiteCredentialFixtures extends Fixture implements DependentFixtureInterfac $this->container = $container; } - /** - * {@inheritdoc} - */ public function load(ObjectManager $manager): void { $credential = new SiteCredential($this->getReference('admin-user', User::class)); @@ -46,9 +43,6 @@ class SiteCredentialFixtures extends Fixture implements DependentFixtureInterfac $manager->flush(); } - /** - * {@inheritdoc} - */ public function getDependencies() { return [ diff --git a/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php index c50d037dc..fff08ca01 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php +++ b/src/Wallabag/CoreBundle/DataFixtures/TagFixtures.php @@ -8,13 +8,10 @@ use Wallabag\CoreBundle\Entity\Tag; class TagFixtures extends Fixture { - /** - * {@inheritdoc} - */ public function load(ObjectManager $manager): void { $tags = [ - 'foo-bar-tag' => 'foo bar', //tag used for EntryControllerTest + 'foo-bar-tag' => 'foo bar', // tag used for EntryControllerTest 'bar-tag' => 'bar', 'baz-tag' => 'baz', // tag used for ExportControllerTest 'foo-tag' => 'foo', diff --git a/src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php b/src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php index 917df9a4e..433388909 100644 --- a/src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php +++ b/src/Wallabag/CoreBundle/DataFixtures/TaggingRuleFixtures.php @@ -10,9 +10,6 @@ use Wallabag\CoreBundle\Entity\TaggingRule; class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface { - /** - * {@inheritdoc} - */ public function load(ObjectManager $manager): void { $tr1 = new TaggingRule(); @@ -61,9 +58,6 @@ class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface $manager->flush(); } - /** - * {@inheritdoc} - */ public function getDependencies() { return [ diff --git a/src/Wallabag/CoreBundle/Doctrine/JsonArrayType.php b/src/Wallabag/CoreBundle/Doctrine/JsonArrayType.php index 0580e9ab4..dda7cb868 100644 --- a/src/Wallabag/CoreBundle/Doctrine/JsonArrayType.php +++ b/src/Wallabag/CoreBundle/Doctrine/JsonArrayType.php @@ -14,9 +14,6 @@ use Doctrine\DBAL\Types\JsonType; */ class JsonArrayType extends JsonType { - /** - * {@inheritdoc} - */ public function convertToPHPValue($value, AbstractPlatform $platform) { if (null === $value || '' === $value) { @@ -28,17 +25,11 @@ class JsonArrayType extends JsonType return json_decode($value, true); } - /** - * {@inheritdoc} - */ public function getName() { return 'json_array'; } - /** - * {@inheritdoc} - */ public function requiresSQLCommentHint(AbstractPlatform $platform) { return true; diff --git a/src/Wallabag/CoreBundle/Entity/Config.php b/src/Wallabag/CoreBundle/Entity/Config.php index dfbf0414e..3c426ca20 100644 --- a/src/Wallabag/CoreBundle/Entity/Config.php +++ b/src/Wallabag/CoreBundle/Entity/Config.php @@ -183,8 +183,8 @@ class Config private $taggingRules; /** - @var ArrayCollection - + * @var ArrayCollection + * * @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\IgnoreOriginUserRule", mappedBy="config", cascade={"remove"}) * @ORM\OrderBy({"id" = "ASC"}) */ @@ -261,8 +261,6 @@ class Config /** * Set user. * - * @param User $user - * * @return Config */ public function setUser(User $user = null) @@ -433,9 +431,6 @@ class Config return $this; } - /** - * @return string - */ public function getFont(): ?string { return $this->font; @@ -451,9 +446,6 @@ class Config return $this; } - /** - * @return float - */ public function getFontsize(): ?float { return $this->fontsize; @@ -469,9 +461,6 @@ class Config return $this; } - /** - * @return float - */ public function getLineHeight(): ?float { return $this->lineHeight; @@ -487,9 +476,6 @@ class Config return $this; } - /** - * @return float - */ public function getMaxWidth(): ?float { return $this->maxWidth; diff --git a/src/Wallabag/CoreBundle/Entity/Entry.php b/src/Wallabag/CoreBundle/Entity/Entry.php index 35fabf6df..4df23a1f9 100644 --- a/src/Wallabag/CoreBundle/Entity/Entry.php +++ b/src/Wallabag/CoreBundle/Entity/Entry.php @@ -138,7 +138,7 @@ class Entry * * @Groups({"entries_for_user", "export_all"}) */ - private $archivedAt = null; + private $archivedAt; /** * @var bool @@ -203,7 +203,7 @@ class Entry * * @Groups({"entries_for_user", "export_all"}) */ - private $starredAt = null; + private $starredAt; /** * @ORM\OneToMany(targetEntity="Wallabag\AnnotationBundle\Entity\Annotation", mappedBy="entry", cascade={"persist", "remove"}) @@ -1007,8 +1007,6 @@ class Entry } /** - * @param mixed $hashedUrl - * * @return Entry */ public function setHashedUrl($hashedUrl) diff --git a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php index 44799f295..edc7d8402 100644 --- a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php +++ b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php @@ -42,9 +42,6 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder $this->token = $token; } - /** - * {@inheritdoc} - */ public function buildForHost($host) { $user = $this->getUser(); @@ -119,7 +116,7 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder $extraFields = []; foreach ($extraFieldsStrings as $extraField) { - if (false === strpos($extraField, '=')) { + if (!str_contains($extraField, '=')) { continue; } diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index b884b0d46..3a0a25a21 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php @@ -98,7 +98,7 @@ class ContentProxy $errors = $this->validator->validate( $value, - (new LocaleConstraint(['canonicalize' => true])) + new LocaleConstraint(['canonicalize' => true]) ); if (0 === \count($errors)) { @@ -119,7 +119,7 @@ class ContentProxy { $errors = $this->validator->validate( $value, - (new UrlConstraint()) + new UrlConstraint() ); if (0 === \count($errors)) { @@ -207,8 +207,6 @@ class ContentProxy * If the title from the fetched content comes from a PDF, then its very possible that the character encoding is not * UTF-8. This methods tries to identify the character encoding and translate the title to UTF-8. * - * @param $title - * * @return string (maybe contains invalid UTF-8 character) */ private function convertPdfEncodingToUTF8($title) diff --git a/src/Wallabag/CoreBundle/Helper/DownloadImages.php b/src/Wallabag/CoreBundle/Helper/DownloadImages.php index c5d59047a..ce623a86c 100644 --- a/src/Wallabag/CoreBundle/Helper/DownloadImages.php +++ b/src/Wallabag/CoreBundle/Helper/DownloadImages.php @@ -162,7 +162,7 @@ class DownloadImages $cleanSVG = $sanitizer->sanitize((string) $res->getBody()); // add an extra validation by checking about `logger->error('DownloadImages: Bad SVG given', ['path' => $imagePath]); return false; @@ -373,7 +373,7 @@ class DownloadImages $bytes = substr((string) $res->getBody(), 0, 8); foreach ($types as $type => $header) { - if (0 === strpos($bytes, $header)) { + if (str_starts_with($bytes, $header)) { $ext = $type; break; } diff --git a/src/Wallabag/CoreBundle/Helper/Redirect.php b/src/Wallabag/CoreBundle/Helper/Redirect.php index dd0a61a6a..bc7406302 100644 --- a/src/Wallabag/CoreBundle/Helper/Redirect.php +++ b/src/Wallabag/CoreBundle/Helper/Redirect.php @@ -44,8 +44,8 @@ class Redirect return $url; } - if (!$ignoreActionMarkAsRead && - Config::REDIRECT_TO_HOMEPAGE === $user->getConfig()->getActionMarkAsRead()) { + if (!$ignoreActionMarkAsRead + && Config::REDIRECT_TO_HOMEPAGE === $user->getConfig()->getActionMarkAsRead()) { return $this->router->generate('homepage'); } diff --git a/src/Wallabag/CoreBundle/Repository/EntryRepository.php b/src/Wallabag/CoreBundle/Repository/EntryRepository.php index f30999484..76e740b06 100644 --- a/src/Wallabag/CoreBundle/Repository/EntryRepository.php +++ b/src/Wallabag/CoreBundle/Repository/EntryRepository.php @@ -63,7 +63,7 @@ class EntryRepository extends ServiceEntityRepository return $this ->getSortedQueryBuilderByUser($userId) ->andWhere('e.isArchived = false') - ; + ; } /** @@ -78,7 +78,7 @@ class EntryRepository extends ServiceEntityRepository return $this ->getQueryBuilderByUser($userId) ->andWhere('e.isArchived = false') - ; + ; } /** @@ -225,7 +225,7 @@ class EntryRepository extends ServiceEntityRepository return $this ->getSortedQueryBuilderByUser($userId) ->innerJoin('e.annotations', 'a') - ; + ; } /** @@ -240,7 +240,7 @@ class EntryRepository extends ServiceEntityRepository return $this ->getQueryBuilderByUser($userId) ->innerJoin('e.annotations', 'a') - ; + ; } /** diff --git a/src/Wallabag/ImportBundle/Consumer/AMQPEntryConsumer.php b/src/Wallabag/ImportBundle/Consumer/AMQPEntryConsumer.php index 5aaa8c031..be64bef0d 100644 --- a/src/Wallabag/ImportBundle/Consumer/AMQPEntryConsumer.php +++ b/src/Wallabag/ImportBundle/Consumer/AMQPEntryConsumer.php @@ -7,9 +7,6 @@ use PhpAmqpLib\Message\AMQPMessage; class AMQPEntryConsumer extends AbstractConsumer implements ConsumerInterface { - /** - * {@inheritdoc} - */ public function execute(AMQPMessage $msg) { return $this->handleMessage($msg->body); diff --git a/src/Wallabag/ImportBundle/Controller/ChromeController.php b/src/Wallabag/ImportBundle/Controller/ChromeController.php index c4c3f3a5c..08264d2de 100644 --- a/src/Wallabag/ImportBundle/Controller/ChromeController.php +++ b/src/Wallabag/ImportBundle/Controller/ChromeController.php @@ -33,9 +33,6 @@ class ChromeController extends BrowserController return parent::indexAction($request, $translator); } - /** - * {@inheritdoc} - */ protected function getImportService() { if ($this->craueConfig->get('import_with_rabbitmq')) { @@ -47,9 +44,6 @@ class ChromeController extends BrowserController return $this->chromeImport; } - /** - * {@inheritdoc} - */ protected function getImportTemplate() { return '@WallabagImport/Chrome/index.html.twig'; diff --git a/src/Wallabag/ImportBundle/Controller/ElcuratorController.php b/src/Wallabag/ImportBundle/Controller/ElcuratorController.php index 990334cc2..acae64758 100644 --- a/src/Wallabag/ImportBundle/Controller/ElcuratorController.php +++ b/src/Wallabag/ImportBundle/Controller/ElcuratorController.php @@ -33,9 +33,6 @@ class ElcuratorController extends WallabagController return parent::indexAction($request, $translator); } - /** - * {@inheritdoc} - */ protected function getImportService() { if ($this->craueConfig->get('import_with_rabbitmq')) { @@ -47,9 +44,6 @@ class ElcuratorController extends WallabagController return $this->elcuratorImport; } - /** - * {@inheritdoc} - */ protected function getImportTemplate() { return '@WallabagImport/Elcurator/index.html.twig'; diff --git a/src/Wallabag/ImportBundle/Controller/FirefoxController.php b/src/Wallabag/ImportBundle/Controller/FirefoxController.php index 4fbc84b78..cecef5498 100644 --- a/src/Wallabag/ImportBundle/Controller/FirefoxController.php +++ b/src/Wallabag/ImportBundle/Controller/FirefoxController.php @@ -33,9 +33,6 @@ class FirefoxController extends BrowserController return parent::indexAction($request, $translator); } - /** - * {@inheritdoc} - */ protected function getImportService() { if ($this->craueConfig->get('import_with_rabbitmq')) { @@ -47,9 +44,6 @@ class FirefoxController extends BrowserController return $this->firefoxImport; } - /** - * {@inheritdoc} - */ protected function getImportTemplate() { return '@WallabagImport/Firefox/index.html.twig'; diff --git a/src/Wallabag/ImportBundle/Controller/PocketHtmlController.php b/src/Wallabag/ImportBundle/Controller/PocketHtmlController.php index 7387bbfdc..825c167ed 100644 --- a/src/Wallabag/ImportBundle/Controller/PocketHtmlController.php +++ b/src/Wallabag/ImportBundle/Controller/PocketHtmlController.php @@ -33,9 +33,6 @@ class PocketHtmlController extends HtmlController return parent::indexAction($request, $translator); } - /** - * {@inheritdoc} - */ protected function getImportService() { if ($this->craueConfig->get('import_with_rabbitmq')) { @@ -47,9 +44,6 @@ class PocketHtmlController extends HtmlController return $this->pocketHtmlImport; } - /** - * {@inheritdoc} - */ protected function getImportTemplate() { return '@WallabagImport/PocketHtml/index.html.twig'; diff --git a/src/Wallabag/ImportBundle/Controller/ShaarliController.php b/src/Wallabag/ImportBundle/Controller/ShaarliController.php index 46dfd1473..9d526be9f 100644 --- a/src/Wallabag/ImportBundle/Controller/ShaarliController.php +++ b/src/Wallabag/ImportBundle/Controller/ShaarliController.php @@ -33,9 +33,6 @@ class ShaarliController extends HtmlController return parent::indexAction($request, $translator); } - /** - * {@inheritdoc} - */ protected function getImportService() { if ($this->craueConfig->get('import_with_rabbitmq')) { @@ -47,9 +44,6 @@ class ShaarliController extends HtmlController return $this->shaarliImport; } - /** - * {@inheritdoc} - */ protected function getImportTemplate() { return '@WallabagImport/Shaarli/index.html.twig'; diff --git a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php index c5257fc3f..ac7f1064e 100644 --- a/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php +++ b/src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php @@ -33,9 +33,6 @@ class WallabagV1Controller extends WallabagController return parent::indexAction($request, $translator); } - /** - * {@inheritdoc} - */ protected function getImportService() { if ($this->craueConfig->get('import_with_rabbitmq')) { @@ -47,9 +44,6 @@ class WallabagV1Controller extends WallabagController return $this->wallabagImport; } - /** - * {@inheritdoc} - */ protected function getImportTemplate() { return '@WallabagImport/WallabagV1/index.html.twig'; diff --git a/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php b/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php index ae006b12d..30af498c1 100644 --- a/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php +++ b/src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php @@ -33,9 +33,6 @@ class WallabagV2Controller extends WallabagController return parent::indexAction($request, $translator); } - /** - * {@inheritdoc} - */ protected function getImportService() { if ($this->craueConfig->get('import_with_rabbitmq')) { @@ -47,9 +44,6 @@ class WallabagV2Controller extends WallabagController return $this->wallabagImport; } - /** - * {@inheritdoc} - */ protected function getImportTemplate() { return '@WallabagImport/WallabagV2/index.html.twig'; diff --git a/src/Wallabag/ImportBundle/Import/AbstractImport.php b/src/Wallabag/ImportBundle/Import/AbstractImport.php index 2ddeb36f3..7ede63f6a 100644 --- a/src/Wallabag/ImportBundle/Import/AbstractImport.php +++ b/src/Wallabag/ImportBundle/Import/AbstractImport.php @@ -92,9 +92,6 @@ abstract class AbstractImport implements ImportInterface return $this; } - /** - * {@inheritdoc} - */ public function getSummary() { return [ diff --git a/src/Wallabag/ImportBundle/Import/BrowserImport.php b/src/Wallabag/ImportBundle/Import/BrowserImport.php index 94b5f18f1..c93a35754 100644 --- a/src/Wallabag/ImportBundle/Import/BrowserImport.php +++ b/src/Wallabag/ImportBundle/Import/BrowserImport.php @@ -9,24 +9,12 @@ abstract class BrowserImport extends AbstractImport { protected $filepath; - /** - * {@inheritdoc} - */ abstract public function getName(); - /** - * {@inheritdoc} - */ abstract public function getUrl(); - /** - * {@inheritdoc} - */ abstract public function getDescription(); - /** - * {@inheritdoc} - */ public function import() { if (!$this->user) { @@ -72,9 +60,6 @@ abstract class BrowserImport extends AbstractImport return $this; } - /** - * {@inheritdoc} - */ public function parseEntry(array $importedEntry) { if ((!\array_key_exists('guid', $importedEntry) || (!\array_key_exists('id', $importedEntry))) && \is_array(reset($importedEntry))) { @@ -218,9 +203,6 @@ abstract class BrowserImport extends AbstractImport } } - /** - * {@inheritdoc} - */ protected function setEntryAsRead(array $importedEntry) { $importedEntry['is_archived'] = 1; diff --git a/src/Wallabag/ImportBundle/Import/ChromeImport.php b/src/Wallabag/ImportBundle/Import/ChromeImport.php index 4ae82ade8..dc87ab780 100644 --- a/src/Wallabag/ImportBundle/Import/ChromeImport.php +++ b/src/Wallabag/ImportBundle/Import/ChromeImport.php @@ -6,33 +6,21 @@ class ChromeImport extends BrowserImport { protected $filepath; - /** - * {@inheritdoc} - */ public function getName() { return 'Chrome'; } - /** - * {@inheritdoc} - */ public function getUrl() { return 'import_chrome'; } - /** - * {@inheritdoc} - */ public function getDescription() { return 'import.chrome.description'; } - /** - * {@inheritdoc} - */ public function validateEntry(array $importedEntry) { if (empty($importedEntry['url'])) { @@ -42,9 +30,6 @@ class ChromeImport extends BrowserImport return true; } - /** - * {@inheritdoc} - */ protected function prepareEntry(array $entry = []) { $data = [ diff --git a/src/Wallabag/ImportBundle/Import/DeliciousImport.php b/src/Wallabag/ImportBundle/Import/DeliciousImport.php index 455a64991..d2f32dc64 100644 --- a/src/Wallabag/ImportBundle/Import/DeliciousImport.php +++ b/src/Wallabag/ImportBundle/Import/DeliciousImport.php @@ -8,25 +8,16 @@ class DeliciousImport extends AbstractImport { private $filepath; - /** - * {@inheritdoc} - */ public function getName() { return 'Delicious'; } - /** - * {@inheritdoc} - */ public function getUrl() { return 'import_delicious'; } - /** - * {@inheritdoc} - */ public function getDescription() { return 'import.delicious.description'; @@ -44,9 +35,6 @@ class DeliciousImport extends AbstractImport return $this; } - /** - * {@inheritdoc} - */ public function import() { if (!$this->user) { @@ -80,9 +68,6 @@ class DeliciousImport extends AbstractImport return true; } - /** - * {@inheritdoc} - */ public function validateEntry(array $importedEntry) { if (empty($importedEntry['url'])) { @@ -92,9 +77,6 @@ class DeliciousImport extends AbstractImport return true; } - /** - * {@inheritdoc} - */ public function parseEntry(array $importedEntry) { $existingEntry = $this->em @@ -141,9 +123,6 @@ class DeliciousImport extends AbstractImport return $entry; } - /** - * {@inheritdoc} - */ protected function setEntryAsRead(array $importedEntry) { return $importedEntry; diff --git a/src/Wallabag/ImportBundle/Import/ElcuratorImport.php b/src/Wallabag/ImportBundle/Import/ElcuratorImport.php index d12816139..82950c5d9 100644 --- a/src/Wallabag/ImportBundle/Import/ElcuratorImport.php +++ b/src/Wallabag/ImportBundle/Import/ElcuratorImport.php @@ -4,33 +4,21 @@ namespace Wallabag\ImportBundle\Import; class ElcuratorImport extends WallabagImport { - /** - * {@inheritdoc} - */ public function getName() { return 'elcurator'; } - /** - * {@inheritdoc} - */ public function getUrl() { return 'import_elcurator'; } - /** - * {@inheritdoc} - */ public function getDescription() { return 'import.elcurator.description'; } - /** - * {@inheritdoc} - */ protected function prepareEntry($entry = []) { return [ @@ -42,9 +30,6 @@ class ElcuratorImport extends WallabagImport ] + $entry; } - /** - * {@inheritdoc} - */ protected function setEntryAsRead(array $importedEntry) { $importedEntry['is_archived'] = 1; diff --git a/src/Wallabag/ImportBundle/Import/FirefoxImport.php b/src/Wallabag/ImportBundle/Import/FirefoxImport.php index b3558f21e..84c513d6c 100644 --- a/src/Wallabag/ImportBundle/Import/FirefoxImport.php +++ b/src/Wallabag/ImportBundle/Import/FirefoxImport.php @@ -6,33 +6,21 @@ class FirefoxImport extends BrowserImport { protected $filepath; - /** - * {@inheritdoc} - */ public function getName() { return 'Firefox'; } - /** - * {@inheritdoc} - */ public function getUrl() { return 'import_firefox'; } - /** - * {@inheritdoc} - */ public function getDescription() { return 'import.firefox.description'; } - /** - * {@inheritdoc} - */ public function validateEntry(array $importedEntry) { if (empty($importedEntry['uri'])) { @@ -42,9 +30,6 @@ class FirefoxImport extends BrowserImport return true; } - /** - * {@inheritdoc} - */ protected function prepareEntry(array $entry = []) { $data = [ diff --git a/src/Wallabag/ImportBundle/Import/HtmlImport.php b/src/Wallabag/ImportBundle/Import/HtmlImport.php index a96107e0b..85b4efc33 100644 --- a/src/Wallabag/ImportBundle/Import/HtmlImport.php +++ b/src/Wallabag/ImportBundle/Import/HtmlImport.php @@ -9,24 +9,12 @@ abstract class HtmlImport extends AbstractImport { protected $filepath; - /** - * {@inheritdoc} - */ abstract public function getName(); - /** - * {@inheritdoc} - */ abstract public function getUrl(); - /** - * {@inheritdoc} - */ abstract public function getDescription(); - /** - * {@inheritdoc} - */ public function import() { if (!$this->user) { @@ -86,9 +74,6 @@ abstract class HtmlImport extends AbstractImport return $this; } - /** - * {@inheritdoc} - */ public function parseEntry(array $importedEntry) { $url = $importedEntry['url']; @@ -196,9 +181,6 @@ abstract class HtmlImport extends AbstractImport } } - /** - * {@inheritdoc} - */ protected function setEntryAsRead(array $importedEntry) { $importedEntry['is_archived'] = 1; diff --git a/src/Wallabag/ImportBundle/Import/InstapaperImport.php b/src/Wallabag/ImportBundle/Import/InstapaperImport.php index 9dea9ed6e..6c35045aa 100644 --- a/src/Wallabag/ImportBundle/Import/InstapaperImport.php +++ b/src/Wallabag/ImportBundle/Import/InstapaperImport.php @@ -8,25 +8,16 @@ class InstapaperImport extends AbstractImport { private $filepath; - /** - * {@inheritdoc} - */ public function getName() { return 'Instapaper'; } - /** - * {@inheritdoc} - */ public function getUrl() { return 'import_instapaper'; } - /** - * {@inheritdoc} - */ public function getDescription() { return 'import.instapaper.description'; @@ -44,9 +35,6 @@ class InstapaperImport extends AbstractImport return $this; } - /** - * {@inheritdoc} - */ public function import() { if (!$this->user) { @@ -108,9 +96,6 @@ class InstapaperImport extends AbstractImport return true; } - /** - * {@inheritdoc} - */ public function validateEntry(array $importedEntry) { if (empty($importedEntry['url'])) { @@ -120,9 +105,6 @@ class InstapaperImport extends AbstractImport return true; } - /** - * {@inheritdoc} - */ public function parseEntry(array $importedEntry) { $existingEntry = $this->em @@ -159,9 +141,6 @@ class InstapaperImport extends AbstractImport return $entry; } - /** - * {@inheritdoc} - */ protected function setEntryAsRead(array $importedEntry) { $importedEntry['is_archived'] = 1; diff --git a/src/Wallabag/ImportBundle/Import/PinboardImport.php b/src/Wallabag/ImportBundle/Import/PinboardImport.php index 19093fb25..93b1e8e5b 100644 --- a/src/Wallabag/ImportBundle/Import/PinboardImport.php +++ b/src/Wallabag/ImportBundle/Import/PinboardImport.php @@ -8,25 +8,16 @@ class PinboardImport extends AbstractImport { private $filepath; - /** - * {@inheritdoc} - */ public function getName() { return 'Pinboard'; } - /** - * {@inheritdoc} - */ public function getUrl() { return 'import_pinboard'; } - /** - * {@inheritdoc} - */ public function getDescription() { return 'import.pinboard.description'; @@ -44,9 +35,6 @@ class PinboardImport extends AbstractImport return $this; } - /** - * {@inheritdoc} - */ public function import() { if (!$this->user) { @@ -80,9 +68,6 @@ class PinboardImport extends AbstractImport return true; } - /** - * {@inheritdoc} - */ public function validateEntry(array $importedEntry) { if (empty($importedEntry['href'])) { @@ -92,9 +77,6 @@ class PinboardImport extends AbstractImport return true; } - /** - * {@inheritdoc} - */ public function parseEntry(array $importedEntry) { $existingEntry = $this->em @@ -141,9 +123,6 @@ class PinboardImport extends AbstractImport return $entry; } - /** - * {@inheritdoc} - */ protected function setEntryAsRead(array $importedEntry) { $importedEntry['toread'] = 'no'; diff --git a/src/Wallabag/ImportBundle/Import/PocketHtmlImport.php b/src/Wallabag/ImportBundle/Import/PocketHtmlImport.php index 492a1adfc..565e2ba13 100644 --- a/src/Wallabag/ImportBundle/Import/PocketHtmlImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketHtmlImport.php @@ -6,33 +6,21 @@ class PocketHtmlImport extends HtmlImport { protected $filepath; - /** - * {@inheritdoc} - */ public function getName() { return 'Pocket HTML'; } - /** - * {@inheritdoc} - */ public function getUrl() { return 'import_pocket_html'; } - /** - * {@inheritdoc} - */ public function getDescription() { return 'import.pocket_html.description'; } - /** - * {@inheritdoc} - */ public function validateEntry(array $importedEntry) { if (empty($importedEntry['url'])) { @@ -89,9 +77,6 @@ class PocketHtmlImport extends HtmlImport return true; } - /** - * {@inheritdoc} - */ protected function prepareEntry(array $entry = []) { $data = [ diff --git a/src/Wallabag/ImportBundle/Import/PocketImport.php b/src/Wallabag/ImportBundle/Import/PocketImport.php index 4fa578695..5ecb63b31 100644 --- a/src/Wallabag/ImportBundle/Import/PocketImport.php +++ b/src/Wallabag/ImportBundle/Import/PocketImport.php @@ -32,25 +32,16 @@ class PocketImport extends AbstractImport return $this->accessToken; } - /** - * {@inheritdoc} - */ public function getName() { return 'Pocket'; } - /** - * {@inheritdoc} - */ public function getUrl() { return 'import_pocket'; } - /** - * {@inheritdoc} - */ public function getDescription() { return 'import.pocket.description'; @@ -105,9 +96,6 @@ class PocketImport extends AbstractImport return true; } - /** - * {@inheritdoc} - */ public function import($offset = 0) { static $run = 0; @@ -158,9 +146,6 @@ class PocketImport extends AbstractImport $this->client = new HttpMethodsClient(new PluginClient($client, [new ErrorPlugin()]), $requestFactory ?: Psr17FactoryDiscovery::findRequestFactory(), $streamFactory ?: Psr17FactoryDiscovery::findStreamFactory()); } - /** - * {@inheritdoc} - */ public function validateEntry(array $importedEntry) { if (empty($importedEntry['resolved_url']) && empty($importedEntry['given_url'])) { @@ -171,8 +156,6 @@ class PocketImport extends AbstractImport } /** - * {@inheritdoc} - * * @see https://getpocket.com/developer/docs/v3/retrieve */ public function parseEntry(array $importedEntry) @@ -233,9 +216,6 @@ class PocketImport extends AbstractImport return $entry; } - /** - * {@inheritdoc} - */ protected function setEntryAsRead(array $importedEntry) { $importedEntry['status'] = '1'; diff --git a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php index 0e98fb5db..e9430b55a 100644 --- a/src/Wallabag/ImportBundle/Import/ReadabilityImport.php +++ b/src/Wallabag/ImportBundle/Import/ReadabilityImport.php @@ -8,25 +8,16 @@ class ReadabilityImport extends AbstractImport { private $filepath; - /** - * {@inheritdoc} - */ public function getName() { return 'Readability'; } - /** - * {@inheritdoc} - */ public function getUrl() { return 'import_readability'; } - /** - * {@inheritdoc} - */ public function getDescription() { return 'import.readability.description'; @@ -44,9 +35,6 @@ class ReadabilityImport extends AbstractImport return $this; } - /** - * {@inheritdoc} - */ public function import() { if (!$this->user) { @@ -80,9 +68,6 @@ class ReadabilityImport extends AbstractImport return true; } - /** - * {@inheritdoc} - */ public function validateEntry(array $importedEntry) { if (empty($importedEntry['article__url'])) { @@ -92,9 +77,6 @@ class ReadabilityImport extends AbstractImport return true; } - /** - * {@inheritdoc} - */ public function parseEntry(array $importedEntry) { $existingEntry = $this->em @@ -133,9 +115,6 @@ class ReadabilityImport extends AbstractImport return $entry; } - /** - * {@inheritdoc} - */ protected function setEntryAsRead(array $importedEntry) { $importedEntry['archive'] = 1; diff --git a/src/Wallabag/ImportBundle/Import/ShaarliImport.php b/src/Wallabag/ImportBundle/Import/ShaarliImport.php index b4c9dc3c3..27e6e990f 100644 --- a/src/Wallabag/ImportBundle/Import/ShaarliImport.php +++ b/src/Wallabag/ImportBundle/Import/ShaarliImport.php @@ -6,33 +6,21 @@ class ShaarliImport extends HtmlImport { protected $filepath; - /** - * {@inheritdoc} - */ public function getName() { return 'Shaarli'; } - /** - * {@inheritdoc} - */ public function getUrl() { return 'import_shaarli'; } - /** - * {@inheritdoc} - */ public function getDescription() { return 'import.shaarli.description'; } - /** - * {@inheritdoc} - */ public function validateEntry(array $importedEntry) { if (empty($importedEntry['url'])) { @@ -42,9 +30,6 @@ class ShaarliImport extends HtmlImport return true; } - /** - * {@inheritdoc} - */ protected function prepareEntry(array $entry = []) { $data = [ diff --git a/src/Wallabag/ImportBundle/Import/WallabagImport.php b/src/Wallabag/ImportBundle/Import/WallabagImport.php index 38ab04918..adedaa959 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagImport.php +++ b/src/Wallabag/ImportBundle/Import/WallabagImport.php @@ -23,24 +23,12 @@ abstract class WallabagImport extends AbstractImport '', ]; - /** - * {@inheritdoc} - */ abstract public function getName(); - /** - * {@inheritdoc} - */ abstract public function getUrl(); - /** - * {@inheritdoc} - */ abstract public function getDescription(); - /** - * {@inheritdoc} - */ public function import() { if (!$this->user) { @@ -86,9 +74,6 @@ abstract class WallabagImport extends AbstractImport return $this; } - /** - * {@inheritdoc} - */ public function validateEntry(array $importedEntry) { if (empty($importedEntry['url'])) { @@ -98,9 +83,6 @@ abstract class WallabagImport extends AbstractImport return true; } - /** - * {@inheritdoc} - */ public function parseEntry(array $importedEntry) { $existingEntry = $this->em diff --git a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php index 8b60eed33..fd71c05e0 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagV1Import.php +++ b/src/Wallabag/ImportBundle/Import/WallabagV1Import.php @@ -21,33 +21,21 @@ class WallabagV1Import extends WallabagImport parent::__construct($em, $contentProxy, $tagsAssigner, $eventDispatcher, $logger); } - /** - * {@inheritdoc} - */ public function getName() { return 'wallabag v1'; } - /** - * {@inheritdoc} - */ public function getUrl() { return 'import_wallabag_v1'; } - /** - * {@inheritdoc} - */ public function getDescription() { return 'import.wallabag_v1.description'; } - /** - * {@inheritdoc} - */ protected function prepareEntry($entry = []) { $data = [ @@ -75,9 +63,6 @@ class WallabagV1Import extends WallabagImport return $data; } - /** - * {@inheritdoc} - */ protected function setEntryAsRead(array $importedEntry) { $importedEntry['is_read'] = 1; diff --git a/src/Wallabag/ImportBundle/Import/WallabagV2Import.php b/src/Wallabag/ImportBundle/Import/WallabagV2Import.php index 2ba26003f..fc7c227b2 100644 --- a/src/Wallabag/ImportBundle/Import/WallabagV2Import.php +++ b/src/Wallabag/ImportBundle/Import/WallabagV2Import.php @@ -4,33 +4,21 @@ namespace Wallabag\ImportBundle\Import; class WallabagV2Import extends WallabagImport { - /** - * {@inheritdoc} - */ public function getName() { return 'wallabag v2'; } - /** - * {@inheritdoc} - */ public function getUrl() { return 'import_wallabag_v2'; } - /** - * {@inheritdoc} - */ public function getDescription() { return 'import.wallabag_v2.description'; } - /** - * {@inheritdoc} - */ protected function prepareEntry($entry = []) { return [ @@ -43,9 +31,6 @@ class WallabagV2Import extends WallabagImport ] + $entry; } - /** - * {@inheritdoc} - */ protected function setEntryAsRead(array $importedEntry) { $importedEntry['is_archived'] = 1; diff --git a/src/Wallabag/UserBundle/DataFixtures/UserFixtures.php b/src/Wallabag/UserBundle/DataFixtures/UserFixtures.php index f8bfe7f95..b5ab28fa5 100644 --- a/src/Wallabag/UserBundle/DataFixtures/UserFixtures.php +++ b/src/Wallabag/UserBundle/DataFixtures/UserFixtures.php @@ -8,9 +8,6 @@ use Wallabag\UserBundle\Entity\User; class UserFixtures extends Fixture { - /** - * {@inheritdoc} - */ public function load(ObjectManager $manager) { $userAdmin = new User(); diff --git a/src/Wallabag/UserBundle/Entity/User.php b/src/Wallabag/UserBundle/Entity/User.php index 6c27c46b6..611a031e8 100644 --- a/src/Wallabag/UserBundle/Entity/User.php +++ b/src/Wallabag/UserBundle/Entity/User.php @@ -252,8 +252,6 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI /** * Set config. * - * @param Config $config - * * @return User */ public function setConfig(Config $config = null) @@ -297,65 +295,41 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI return $this->isGoogleAuthenticatorEnabled(); } - /** - * {@inheritdoc} - */ public function isEmailAuthEnabled(): bool { return $this->emailTwoFactor; } - /** - * {@inheritdoc} - */ public function getEmailAuthCode(): string { return $this->authCode; } - /** - * {@inheritdoc} - */ public function setEmailAuthCode(string $authCode): void { $this->authCode = $authCode; } - /** - * {@inheritdoc} - */ public function getEmailAuthRecipient(): string { return $this->email; } - /** - * {@inheritdoc} - */ public function isGoogleAuthenticatorEnabled(): bool { return $this->googleAuthenticatorSecret ? true : false; } - /** - * {@inheritdoc} - */ public function getGoogleAuthenticatorUsername(): string { return $this->username; } - /** - * {@inheritdoc} - */ public function getGoogleAuthenticatorSecret(): string { return $this->googleAuthenticatorSecret; } - /** - * {@inheritdoc} - */ public function setGoogleAuthenticatorSecret(?string $googleAuthenticatorSecret): void { $this->googleAuthenticatorSecret = $googleAuthenticatorSecret; @@ -371,17 +345,11 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI return $this->backupCodes; } - /** - * {@inheritdoc} - */ public function isBackupCode(string $code): bool { return false === $this->findBackupCode($code) ? false : true; } - /** - * {@inheritdoc} - */ public function invalidateBackupCode(string $code): void { $key = $this->findBackupCode($code); diff --git a/src/Wallabag/UserBundle/EventListener/AuthenticationFailureListener.php b/src/Wallabag/UserBundle/EventListener/AuthenticationFailureListener.php index 18f14a3a6..20fbd2a7f 100644 --- a/src/Wallabag/UserBundle/EventListener/AuthenticationFailureListener.php +++ b/src/Wallabag/UserBundle/EventListener/AuthenticationFailureListener.php @@ -18,9 +18,6 @@ class AuthenticationFailureListener implements EventSubscriberInterface $this->logger = $logger; } - /** - * {@inheritdoc} - */ public static function getSubscribedEvents() { return [ diff --git a/src/Wallabag/UserBundle/EventListener/PasswordResettingListener.php b/src/Wallabag/UserBundle/EventListener/PasswordResettingListener.php index 7df093f1b..af509f41e 100644 --- a/src/Wallabag/UserBundle/EventListener/PasswordResettingListener.php +++ b/src/Wallabag/UserBundle/EventListener/PasswordResettingListener.php @@ -22,9 +22,6 @@ class PasswordResettingListener implements EventSubscriberInterface $this->router = $router; } - /** - * {@inheritdoc} - */ public static function getSubscribedEvents() { return [ diff --git a/tests/Wallabag/AnnotationBundle/WallabagAnnotationTestCase.php b/tests/Wallabag/AnnotationBundle/WallabagAnnotationTestCase.php index c7148f6d1..3bba785d9 100644 --- a/tests/Wallabag/AnnotationBundle/WallabagAnnotationTestCase.php +++ b/tests/Wallabag/AnnotationBundle/WallabagAnnotationTestCase.php @@ -16,7 +16,7 @@ abstract class WallabagAnnotationTestCase extends WebTestCase /** * @var KernelBrowser */ - protected $client = null; + protected $client; /** * @var UserInterface diff --git a/tests/Wallabag/ApiBundle/WallabagApiTestCase.php b/tests/Wallabag/ApiBundle/WallabagApiTestCase.php index 4cc2d0fc3..2dc3e9aed 100644 --- a/tests/Wallabag/ApiBundle/WallabagApiTestCase.php +++ b/tests/Wallabag/ApiBundle/WallabagApiTestCase.php @@ -18,7 +18,7 @@ abstract class WallabagApiTestCase extends WebTestCase /** * @var KernelBrowser */ - protected $client = null; + protected $client; /** * @var UserInterface diff --git a/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php b/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php index 8860a4599..3bba9bc32 100644 --- a/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php +++ b/tests/Wallabag/CoreBundle/Command/ReloadEntryCommandTest.php @@ -12,7 +12,7 @@ class ReloadEntryCommandTest extends WallabagCoreTestCase public $url = 'https://www.lemonde.fr/pixels/article/2015/03/28/plongee-dans-l-univers-d-ingress-le-jeu-de-google-aux-frontieres-du-reel_4601155_4408996.html'; /** - * @var entry + * @var Entry */ public $adminEntry; diff --git a/tests/Wallabag/CoreBundle/Controller/FeedControllerTest.php b/tests/Wallabag/CoreBundle/Controller/FeedControllerTest.php index 90e3feafe..6e4f3e437 100644 --- a/tests/Wallabag/CoreBundle/Controller/FeedControllerTest.php +++ b/tests/Wallabag/CoreBundle/Controller/FeedControllerTest.php @@ -36,7 +36,7 @@ class FeedControllerTest extends WallabagCoreTestCase $this->assertSame('admin', $xpath->query('/a:feed/a:author/a:name')->item(0)->nodeValue); $this->assertSame(1, $xpath->query('/a:feed/a:subtitle')->length); - if (null !== $tagValue && 0 === strpos($type, 'tag')) { + if (null !== $tagValue && str_starts_with($type, 'tag')) { $this->assertSame('wallabag — ' . $type . ' ' . $tagValue . ' feed', $xpath->query('/a:feed/a:title')->item(0)->nodeValue); $this->assertSame('Atom feed for entries tagged with ' . $tagValue, $xpath->query('/a:feed/a:subtitle')->item(0)->nodeValue); } else { diff --git a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php index 7d430cbef..430ff6d10 100644 --- a/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php +++ b/tests/Wallabag/CoreBundle/Helper/ContentProxyTest.php @@ -437,7 +437,7 @@ class ContentProxyTest extends TestCase $ruleBasedIgnoreOriginProcessor->expects($this->once()) ->method('process'); - $proxy = new ContentProxy((new Graby()), $tagger, $ruleBasedIgnoreOriginProcessor, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, true); + $proxy = new ContentProxy(new Graby(), $tagger, $ruleBasedIgnoreOriginProcessor, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, true); $entry = new Entry(new User()); $proxy->updateEntry( $entry, @@ -483,7 +483,7 @@ class ContentProxyTest extends TestCase $logHandler = new TestHandler(); $logger = new Logger('test', [$logHandler]); - $proxy = new ContentProxy((new Graby()), $tagger, $ruleBasedIgnoreOriginProcessor, $this->getValidator(), $logger, $this->fetchingErrorMessage); + $proxy = new ContentProxy(new Graby(), $tagger, $ruleBasedIgnoreOriginProcessor, $this->getValidator(), $logger, $this->fetchingErrorMessage); $entry = new Entry(new User()); $proxy->updateEntry( $entry, @@ -523,7 +523,7 @@ class ContentProxyTest extends TestCase $handler = new TestHandler(); $logger->pushHandler($handler); - $proxy = new ContentProxy((new Graby()), $tagger, $ruleBasedIgnoreOriginProcessor, $this->getValidator(), $logger, $this->fetchingErrorMessage); + $proxy = new ContentProxy(new Graby(), $tagger, $ruleBasedIgnoreOriginProcessor, $this->getValidator(), $logger, $this->fetchingErrorMessage); $entry = new Entry(new User()); $proxy->updateEntry( $entry, @@ -565,7 +565,7 @@ class ContentProxyTest extends TestCase $ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock(); - $proxy = new ContentProxy((new Graby()), $tagger, $ruleBasedIgnoreOriginProcessor, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); + $proxy = new ContentProxy(new Graby(), $tagger, $ruleBasedIgnoreOriginProcessor, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); $entry = new Entry(new User()); $proxy->updateEntry( $entry, @@ -609,7 +609,7 @@ class ContentProxyTest extends TestCase $ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock(); - $proxy = new ContentProxy((new Graby()), $tagger, $ruleBasedIgnoreOriginProcessor, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); + $proxy = new ContentProxy(new Graby(), $tagger, $ruleBasedIgnoreOriginProcessor, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage); $entry = new Entry(new User()); $proxy->updateEntry( $entry, @@ -620,7 +620,7 @@ class ContentProxyTest extends TestCase 'url' => 'http://1.1.1.1', 'language' => 'fr', 'status' => '200', - //'og_title' => 'my OG title', + // 'og_title' => 'my OG title', 'description' => 'OG desc', 'image' => 'http://3.3.3.3/cover.jpg', 'headers' => [ @@ -1043,7 +1043,7 @@ class ContentProxyTest extends TestCase ->method('process') ->willReturn($processor_result); - $proxy = new ContentProxy((new Graby()), $tagger, $ruleBasedIgnoreOriginProcessor, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, true); + $proxy = new ContentProxy(new Graby(), $tagger, $ruleBasedIgnoreOriginProcessor, $this->getValidator(), $this->getLogger(), $this->fetchingErrorMessage, true); $entry = new Entry(new User()); $entry->setOriginUrl($origin_url); $proxy->updateEntry( @@ -1069,8 +1069,6 @@ class ContentProxyTest extends TestCase /** * https://stackoverflow.com/a/18506801. * - * @param $string - * * @return string */ private function strToHex($string) @@ -1090,8 +1088,6 @@ class ContentProxyTest extends TestCase * * @see https://stackoverflow.com/a/18506801 * - * @param $hex - * * @return string */ private function hexToStr($hex) diff --git a/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php b/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php index 3a9753154..767b682df 100644 --- a/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php +++ b/tests/Wallabag/CoreBundle/WallabagCoreTestCase.php @@ -18,7 +18,7 @@ abstract class WallabagCoreTestCase extends WebTestCase /** * @var KernelBrowser|null */ - private $client = null; + private $client; protected function setUp(): void { diff --git a/tests/Wallabag/ImportBundle/Import/PocketImportTest.php b/tests/Wallabag/ImportBundle/Import/PocketImportTest.php index fe92b34c1..f6a09f18c 100644 --- a/tests/Wallabag/ImportBundle/Import/PocketImportTest.php +++ b/tests/Wallabag/ImportBundle/Import/PocketImportTest.php @@ -190,7 +190,7 @@ class PocketImportTest extends TestCase } } JSON -)); + )); $pocketImport = $this->getPocketImport('ConsumerKey', 1); @@ -280,7 +280,7 @@ JSON } } JSON -)); + )); $pocketImport = $this->getPocketImport('ConsumerKey', 2);