Merge pull request #7137 from yguedidi/upgrade-to-symfony-5

Upgrade to Symfony 5
This commit is contained in:
Kevin Decherf 2024-01-25 20:24:20 +01:00 committed by GitHub
commit eb36d692aa
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
99 changed files with 1837 additions and 2007 deletions

View File

@ -18,3 +18,6 @@ indent_style = tab
[.github/**.yml] [.github/**.yml]
indent_size = 2 indent_size = 2
[phpstan-baseline.neon]
indent_style = tab

View File

@ -1,13 +1,14 @@
<?php <?php
$config = new PhpCsFixer\Config(); $config = new PhpCsFixer\Config();
return $config return $config
->setRiskyAllowed(true) ->setRiskyAllowed(true)
->setRules([ ->setRules([
'@Symfony' => true, '@Symfony' => true,
'@Symfony:risky' => true, '@Symfony:risky' => true,
'array_syntax' => [ 'array_syntax' => [
'syntax' => 'short' 'syntax' => 'short',
], ],
'combine_consecutive_unsets' => true, 'combine_consecutive_unsets' => true,
'heredoc_to_nowdoc' => true, 'heredoc_to_nowdoc' => true,
@ -21,21 +22,23 @@ return $config
'use', 'use',
'parenthesis_brace_block', 'parenthesis_brace_block',
'square_brace_block', 'square_brace_block',
'curly_brace_block' 'curly_brace_block',
], ],
], ],
'no_unreachable_default_argument_value' => true, 'no_unreachable_default_argument_value' => true,
'no_useless_concat_operator' => false,
'no_useless_else' => true, 'no_useless_else' => true,
'no_useless_return' => true, 'no_useless_return' => true,
'ordered_class_elements' => true, 'ordered_class_elements' => true,
'ordered_imports' => true, 'ordered_imports' => true,
'php_unit_strict' => true, 'php_unit_strict' => true,
'phpdoc_order' => true, 'phpdoc_order' => true,
'phpdoc_separation' => false,
// 'psr_autoloading' => true, // 'psr_autoloading' => true,
'strict_comparison' => true, 'strict_comparison' => true,
'strict_param' => true, 'strict_param' => true,
'concat_space' => [ 'concat_space' => [
'spacing' => 'one' 'spacing' => 'one',
], ],
]) ])
->setFinder( ->setFinder(
@ -44,7 +47,7 @@ return $config
'node_modules', 'node_modules',
'vendor', 'vendor',
'var', 'var',
'web' 'web',
]) ])
->in(__DIR__) ->in(__DIR__)
) )

View File

@ -21,7 +21,7 @@ class AppKernel extends Kernel
new Nelmio\ApiDocBundle\NelmioApiDocBundle(), new Nelmio\ApiDocBundle\NelmioApiDocBundle(),
new Nelmio\CorsBundle\NelmioCorsBundle(), new Nelmio\CorsBundle\NelmioCorsBundle(),
new Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(), new Bazinga\Bundle\HateoasBundle\BazingaHateoasBundle(),
new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(), new Spiriit\Bundle\FormFilterBundle\SpiriitFormFilterBundle(),
new FOS\OAuthServerBundle\FOSOAuthServerBundle(), new FOS\OAuthServerBundle\FOSOAuthServerBundle(),
new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(), new Stof\DoctrineExtensionsBundle\StofDoctrineExtensionsBundle(),
new Scheb\TwoFactorBundle\SchebTwoFactorBundle(), new Scheb\TwoFactorBundle\SchebTwoFactorBundle(),
@ -116,7 +116,7 @@ class AppKernel extends Kernel
$scheme = 'sqlite'; $scheme = 'sqlite';
break; break;
default: 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); $container->setParameter('database_scheme', $scheme);

View File

@ -27,12 +27,12 @@ class Version20170511211659 extends WallabagMigration
$this->addSql(<<<EOD $this->addSql(<<<EOD
CREATE TEMPORARY TABLE __temp__wallabag_annotation AS CREATE TEMPORARY TABLE __temp__wallabag_annotation AS
SELECT id, user_id, entry_id, text, created_at, updated_at, quote, ranges SELECT id, user_id, entry_id, text, created_at, updated_at, quote, ranges
FROM ${annotationTableName} FROM {$annotationTableName}
EOD EOD
); );
$this->addSql('DROP TABLE ' . $annotationTableName); $this->addSql('DROP TABLE ' . $annotationTableName);
$this->addSql(<<<EOD $this->addSql(<<<EOD
CREATE TABLE ${annotationTableName} CREATE TABLE {$annotationTableName}
( (
id INTEGER PRIMARY KEY NOT NULL, id INTEGER PRIMARY KEY NOT NULL,
user_id INTEGER DEFAULT NULL, user_id INTEGER DEFAULT NULL,
@ -42,16 +42,16 @@ CREATE TABLE ${annotationTableName}
updated_at DATETIME NOT NULL, updated_at DATETIME NOT NULL,
quote CLOB NOT NULL, quote CLOB NOT NULL,
ranges CLOB NOT NULL, ranges CLOB NOT NULL,
CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES ${userTableName} (id), CONSTRAINT FK_A7AED006A76ED395 FOREIGN KEY (user_id) REFERENCES {$userTableName} (id),
CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES ${entryTableName} (id) ON DELETE CASCADE CONSTRAINT FK_A7AED006BA364942 FOREIGN KEY (entry_id) REFERENCES {$entryTableName} (id) ON DELETE CASCADE
); );
CREATE INDEX IDX_A7AED006A76ED395 ON ${annotationTableName} (user_id); CREATE INDEX IDX_A7AED006A76ED395 ON {$annotationTableName} (user_id);
CREATE INDEX IDX_A7AED006BA364942 ON ${annotationTableName} (entry_id); CREATE INDEX IDX_A7AED006BA364942 ON {$annotationTableName} (entry_id);
EOD EOD
); );
$this->addSql(<<<EOD $this->addSql(<<<EOD
INSERT INTO ${annotationTableName} (id, user_id, entry_id, text, created_at, updated_at, quote, ranges) INSERT INTO {$annotationTableName} (id, user_id, entry_id, text, created_at, updated_at, quote, ranges)
SELECT id, user_id, entry_id, text, created_at, updated_at, quote, ranges SELECT id, user_id, entry_id, text, created_at, updated_at, quote, ranges
FROM __temp__wallabag_annotation; FROM __temp__wallabag_annotation;
EOD EOD

View File

@ -42,7 +42,7 @@ twig:
debug: "%kernel.debug%" debug: "%kernel.debug%"
strict_variables: "%kernel.debug%" strict_variables: "%kernel.debug%"
form_themes: form_themes:
- "@LexikFormFilter/Form/form_div_layout.html.twig" - "@SpiriitFormFilter/Form/form_div_layout.html.twig"
globals: globals:
registration_enabled: '%fosuser_registration%' registration_enabled: '%fosuser_registration%'

View File

@ -24,6 +24,7 @@ web_profiler:
doctrine: doctrine:
dbal: dbal:
dbname_suffix: '_test' # for MySQL and PostgreSQL dbname_suffix: '_test' # for MySQL and PostgreSQL
use_savepoints: true
orm: orm:
metadata_cache_driver: metadata_cache_driver:
@ -32,3 +33,8 @@ doctrine:
query_cache_driver: query_cache_driver:
type: service type: service
id: filesystem_cache id: filesystem_cache
dama_doctrine_test:
enable_static_connection: true
enable_static_meta_data_cache: true
enable_static_query_cache: true

View File

@ -7,7 +7,7 @@ _profiler:
prefix: /_profiler prefix: /_profiler
_errors: _errors:
resource: '@TwigBundle/Resources/config/routing/errors.xml' resource: '@FrameworkBundle/Resources/config/routing/errors.xml'
prefix: /_error prefix: /_error
_main: _main:

View File

@ -4,7 +4,7 @@ imports:
- { resource: parameters_addons.yml } - { resource: parameters_addons.yml }
parameters: parameters:
lexik_form_filter.get_filter.doctrine_orm.class: Wallabag\CoreBundle\Event\Subscriber\CustomDoctrineORMSubscriber spiriit_form_filter.get_filter.doctrine_orm.class: Wallabag\CoreBundle\Event\Subscriber\CustomDoctrineORMSubscriber
services: services:
_defaults: _defaults:
@ -150,8 +150,8 @@ services:
JMS\Serializer\SerializerInterface: JMS\Serializer\SerializerInterface:
alias: jms_serializer alias: jms_serializer
Lexik\Bundle\FormFilterBundle\Filter\FilterBuilderUpdaterInterface: Spiriit\Bundle\FormFilterBundle\Filter\FilterBuilderUpdaterInterface:
alias: lexik_form_filter.query_builder_updater alias: spiriit_form_filter.query_builder_updater
Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface: Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface:
alias: scheb_two_factor.security.google_authenticator alias: scheb_two_factor.security.google_authenticator

View File

@ -6,7 +6,6 @@ services:
public: true public: true
Wallabag\ImportBundle\Consumer\RabbitMQConsumerTotalProxy: Wallabag\ImportBundle\Consumer\RabbitMQConsumerTotalProxy:
lazy: true
arguments: arguments:
$pocketConsumer: '@old_sound_rabbit_mq.import_pocket_consumer' $pocketConsumer: '@old_sound_rabbit_mq.import_pocket_consumer'
$readabilityConsumer: '@old_sound_rabbit_mq.import_readability_consumer' $readabilityConsumer: '@old_sound_rabbit_mq.import_readability_consumer'

View File

@ -57,131 +57,133 @@
"ext-tidy": "*", "ext-tidy": "*",
"ext-tokenizer": "*", "ext-tokenizer": "*",
"ext-xml": "*", "ext-xml": "*",
"babdev/pagerfanta-bundle": "^3.7", "babdev/pagerfanta-bundle": "^3.8",
"bdunogier/guzzle-site-authenticator": "^1.0.0", "bdunogier/guzzle-site-authenticator": "^1.1.0",
"craue/config-bundle": "^2.3.0", "craue/config-bundle": "^2.7.0",
"defuse/php-encryption": "^2.1", "defuse/php-encryption": "^2.4",
"doctrine/collections": "^1.6", "doctrine/collections": "^1.8",
"doctrine/common": "^3.0", "doctrine/common": "^3.4.3",
"doctrine/dbal": "^3.3", "doctrine/dbal": "^3.7.2",
"doctrine/doctrine-bundle": "^2.0", "doctrine/doctrine-bundle": "^2.11.1",
"doctrine/doctrine-migrations-bundle": "^3.2", "doctrine/doctrine-migrations-bundle": "^3.3",
"doctrine/event-manager": "^1.1", "doctrine/event-manager": "^1.2",
"doctrine/migrations": "^3.2", "doctrine/migrations": "^3.5.5",
"doctrine/orm": "^2.6", "doctrine/orm": "^2.17.2",
"doctrine/persistence": "^3.0", "doctrine/persistence": "^3.2",
"egulias/email-validator": "^3.2", "egulias/email-validator": "^3.2.6",
"enshrined/svg-sanitize": "^0.15.4", "enshrined/svg-sanitize": "^0.16",
"friendsofsymfony/jsrouting-bundle": "^2.2", "friendsofsymfony/jsrouting-bundle": "^2.8",
"friendsofsymfony/oauth-server-bundle": "dev-master#dc8ff343363cf794d30eb1a123610d186a43f162", "friendsofsymfony/oauth-server-bundle": "dev-master#dc8ff343363cf794d30eb1a123610d186a43f162",
"friendsofsymfony/rest-bundle": "~3.4", "friendsofsymfony/rest-bundle": "^3.6",
"friendsofsymfony/user-bundle": "^3.1", "friendsofsymfony/user-bundle": "^3.2.1",
"guzzlehttp/guzzle": "^5.3.1", "guzzlehttp/guzzle": "^5.3.4",
"guzzlehttp/psr7": "^2.5", "guzzlehttp/psr7": "^2.6.2",
"html2text/html2text": "^4.1", "html2text/html2text": "^4.3.1",
"incenteev/composer-parameter-handler": "^2.1", "incenteev/composer-parameter-handler": "^2.2",
"j0k3r/graby": "^2.0", "j0k3r/graby": "^2.4.5",
"javibravo/simpleue": "^2.0", "javibravo/simpleue": "^2.1",
"jms/serializer": "^3.17", "jms/serializer": "^3.29.1",
"jms/serializer-bundle": "~5.0", "jms/serializer-bundle": "^5.4",
"laminas/laminas-code": "^4.7", "laminas/laminas-code": "^4.7.1",
"lcobucci/jwt": "~4.1.5", "lcobucci/jwt": "^4.3",
"lexik/form-filter-bundle": "^7.0",
"mgargano/simplehtmldom": "~1.5", "mgargano/simplehtmldom": "~1.5",
"mnapoli/piwik-twig-extension": "^3.0", "mnapoli/piwik-twig-extension": "^3.0",
"nelmio/api-doc-bundle": "^4.10", "nelmio/api-doc-bundle": "^4.16.2",
"nelmio/cors-bundle": "~2.2", "nelmio/cors-bundle": "^2.4",
"ocramius/proxy-manager": "^2.1.1", "ocramius/proxy-manager": "^2.1.1",
"pagerfanta/core": "^3.8", "pagerfanta/core": "^3.8",
"pagerfanta/doctrine-orm-adapter": "^3.7", "pagerfanta/doctrine-orm-adapter": "^3.8",
"pagerfanta/twig": "^3.7", "pagerfanta/twig": "^3.8",
"php-amqplib/php-amqplib": "^3.4", "php-amqplib/php-amqplib": "^3.6",
"php-amqplib/rabbitmq-bundle": "^2.11", "php-amqplib/rabbitmq-bundle": "^2.13.2",
"php-http/client-common": "^2.4", "php-http/client-common": "^2.7.1",
"php-http/discovery": "^1.14", "php-http/discovery": "^1.19.2",
"php-http/guzzle5-adapter": "^2.0", "php-http/guzzle5-adapter": "^2.0",
"php-http/httplug": "^2.3", "php-http/httplug": "^2.4",
"php-http/httplug-bundle": "^1.14", "php-http/httplug-bundle": "^1.32",
"php-http/message": "^1.13", "php-http/message": "^1.16",
"php-http/message-factory": "^1.0", "php-http/message-factory": "^1.1",
"pragmarx/recovery": "^0.2.0", "pragmarx/recovery": "^0.2.1",
"predis/predis": "^2.0.3", "predis/predis": "^2.2.2",
"psr/http-client": "^1.0", "psr/http-client": "^1.0.3",
"psr/http-factory": "^1.0", "psr/http-factory": "^1.0.2",
"psr/http-message": "^1.0", "psr/http-message": "^2.0",
"psr/log": "^1.1", "psr/log": "^1.1.4",
"rulerz-php/doctrine-orm": "dev-master", "rulerz-php/doctrine-orm": "dev-master",
"scheb/2fa-backup-code": "^5.13", "scheb/2fa-backup-code": "^5.13.2",
"scheb/2fa-bundle": "^5.13", "scheb/2fa-bundle": "^5.13.2",
"scheb/2fa-email": "^5.13", "scheb/2fa-email": "^5.13.2",
"scheb/2fa-google-authenticator": "^5.13", "scheb/2fa-google-authenticator": "^5.13.2",
"scheb/2fa-qr-code": "^5.13", "scheb/2fa-qr-code": "^5.13.2",
"scheb/2fa-trusted-device": "^5.13", "scheb/2fa-trusted-device": "^5.13.2",
"scssphp/scssphp": "^1.11", "scssphp/scssphp": "^1.12",
"sensio/framework-extra-bundle": "^6.2", "sensio/framework-extra-bundle": "^6.2.10",
"sentry/sentry-symfony": "4.13.2", "sentry/sentry-symfony": "4.13.2",
"stof/doctrine-extensions-bundle": "^1.2", "spiriitlabs/form-filter-bundle": "^10.0",
"symfony/asset": "^4.4", "stof/doctrine-extensions-bundle": "^1.10.1",
"symfony/config": "^4.4", "symfony/asset": "^5.4.31",
"symfony/console": "^4.4", "symfony/config": "^5.4.31",
"symfony/debug": "^4.4", "symfony/console": "^5.4.34",
"symfony/dependency-injection": "^4.4", "symfony/dependency-injection": "^5.4.34",
"symfony/doctrine-bridge": "^4.4", "symfony/doctrine-bridge": "^5.4.34",
"symfony/dom-crawler": "^4.4", "symfony/dom-crawler": "^5.4.32",
"symfony/error-handler": "^4.4", "symfony/error-handler": "^5.4.29",
"symfony/event-dispatcher": "^4.4", "symfony/event-dispatcher": "^5.4.34",
"symfony/event-dispatcher-contracts": "^1.10", "symfony/event-dispatcher-contracts": "^2.5.2",
"symfony/finder": "^4.4", "symfony/finder": "^5.4.27",
"symfony/form": "^4.4", "symfony/form": "^5.4.33",
"symfony/framework-bundle": "^4.4", "symfony/framework-bundle": "^5.4.34",
"symfony/google-mailer": "^4.4", "symfony/google-mailer": "^5.4.23",
"symfony/http-foundation": "^4.4", "symfony/http-foundation": "^5.4.34",
"symfony/http-kernel": "^4.4", "symfony/http-kernel": "^5.4.34",
"symfony/mailer": "^4.4", "symfony/intl": "^5.4.30",
"symfony/mime": "^4.4", "symfony/mailer": "^5.4.34",
"symfony/monolog-bundle": "^3.1", "symfony/mime": "^5.4.26",
"symfony/options-resolver": "^4.4", "symfony/monolog-bundle": "^3.10",
"symfony/proxy-manager-bridge": "^4.4", "symfony/options-resolver": "^5.4.21",
"symfony/routing": "^4.4", "symfony/polyfill-php80": "^1.28",
"symfony/security-bundle": "^4.4", "symfony/polyfill-php81": "^1.28",
"symfony/security-core": "^4.4", "symfony/proxy-manager-bridge": "^5.4.21",
"symfony/security-http": "^4.4", "symfony/routing": "^5.4.34",
"symfony/templating": "^4.4", "symfony/security-bundle": "^5.4.34",
"symfony/translation-contracts": "^2.5", "symfony/security-core": "^5.4.30",
"symfony/twig-bundle": "^4.4", "symfony/security-http": "^5.4.31",
"symfony/validator": "^4.4", "symfony/templating": "^5.4.21",
"tecnickcom/tcpdf": "^6.3.0", "symfony/translation-contracts": "^2.5.2",
"twig/extra-bundle": "^3.4", "symfony/twig-bundle": "^5.4.31",
"twig/string-extra": "^3.4", "symfony/validator": "^5.4.34",
"twig/twig": "^3.4.3", "tecnickcom/tcpdf": "^6.6.5",
"twig/extra-bundle": "^3.8",
"twig/string-extra": "^3.8",
"twig/twig": "^3.8.0",
"wallabag/phpepub": "^4.0.10", "wallabag/phpepub": "^4.0.10",
"wallabag/rulerz": "dev-master", "wallabag/rulerz": "dev-master",
"wallabag/rulerz-bundle": "dev-master", "wallabag/rulerz-bundle": "dev-master",
"willdurand/hateoas": "^3.8", "willdurand/hateoas": "^3.10",
"willdurand/hateoas-bundle": "~2.1" "willdurand/hateoas-bundle": "^2.6"
}, },
"require-dev": { "require-dev": {
"dama/doctrine-test-bundle": "^7.1", "dama/doctrine-test-bundle": "^8.0",
"doctrine/doctrine-fixtures-bundle": "~3.0", "doctrine/doctrine-fixtures-bundle": "^3.5.1",
"ergebnis/composer-normalize": "^2.28", "ergebnis/composer-normalize": "^2.28.3",
"friendsofphp/php-cs-fixer": "~3.4", "friendsofphp/php-cs-fixer": "^3.46",
"friendsoftwig/twigcs": "^6.0", "friendsoftwig/twigcs": "^6.1",
"m6web/redis-mock": "^5.0", "m6web/redis-mock": "^5.6",
"php-http/mock-client": "^1.0", "php-http/mock-client": "^1.6",
"phpstan/extension-installer": "^1.0", "phpstan/extension-installer": "^1.3.1",
"phpstan/phpstan": "^1.8", "phpstan/phpstan": "^1.10.55",
"phpstan/phpstan-doctrine": "^1.3", "phpstan/phpstan-doctrine": "^1.3.54",
"phpstan/phpstan-phpunit": "^1.1", "phpstan/phpstan-phpunit": "^1.3.15",
"phpstan/phpstan-symfony": "^1.2", "phpstan/phpstan-symfony": "^1.3.6",
"phpunit/phpunit": "^9.6", "phpunit/phpunit": "^9.6.15",
"symfony/browser-kit": "^4.4", "symfony/browser-kit": "^5.4.31",
"symfony/css-selector": "^4.4", "symfony/css-selector": "^5.4.26",
"symfony/debug-bundle": "^4.4", "symfony/debug-bundle": "^5.4.26",
"symfony/maker-bundle": "^1.18", "symfony/maker-bundle": "^1.43",
"symfony/phpunit-bridge": "^6.0", "symfony/phpunit-bridge": "^7.0",
"symfony/var-dumper": "^4.4", "symfony/var-dumper": "^5.4.29",
"symfony/web-profiler-bundle": "^4.4", "symfony/web-profiler-bundle": "^5.4.34",
"symfony/web-server-bundle": "^4.4" "symfony/web-server-bundle": "^4.4.44"
}, },
"suggest": { "suggest": {
"ext-imagick": "To keep GIF animation when downloading image is enabled" "ext-imagick": "To keep GIF animation when downloading image is enabled"
@ -224,7 +226,7 @@
"public-dir": "web", "public-dir": "web",
"symfony": { "symfony": {
"allow-contrib": true, "allow-contrib": true,
"require": "4.4.*" "require": "5.4.*"
} }
}, },
"scripts": { "scripts": {

2727
composer.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -1,81 +1,76 @@
parameters: parameters:
ignoreErrors: ignoreErrors:
- -
message: "#^Method Wallabag\\\\AnnotationBundle\\\\Controller\\\\WallabagAnnotationController\\:\\:postAnnotationAction\\(\\) should return Symfony\\\\Component\\\\HttpFoundation\\\\JsonResponse but returns Symfony\\\\Component\\\\Form\\\\FormInterface\\<mixed\\>\\.$#" message: "#^Method Wallabag\\\\AnnotationBundle\\\\Controller\\\\WallabagAnnotationController\\:\\:postAnnotationAction\\(\\) should return Symfony\\\\Component\\\\HttpFoundation\\\\JsonResponse but returns Symfony\\\\Component\\\\Form\\\\FormInterface\\<mixed\\>\\.$#"
count: 1 count: 1
path: src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php path: src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php
- -
message: "#^Method Wallabag\\\\AnnotationBundle\\\\Controller\\\\WallabagAnnotationController\\:\\:putAnnotationAction\\(\\) should return Symfony\\\\Component\\\\HttpFoundation\\\\JsonResponse but returns Symfony\\\\Component\\\\Form\\\\FormInterface\\<null\\>\\.$#" message: "#^Method Wallabag\\\\AnnotationBundle\\\\Controller\\\\WallabagAnnotationController\\:\\:putAnnotationAction\\(\\) should return Symfony\\\\Component\\\\HttpFoundation\\\\JsonResponse but returns Symfony\\\\Component\\\\Form\\\\FormInterface\\<null\\>\\.$#"
count: 1 count: 1
path: src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php path: src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php
- -
message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Entity\\\\RuleInterface\\:\\:getConfig\\(\\)\\.$#" message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Entity\\\\RuleInterface\\:\\:getConfig\\(\\)\\.$#"
count: 1 count: 1
path: src/Wallabag/CoreBundle/Controller/ConfigController.php path: src/Wallabag/CoreBundle/Controller/ConfigController.php
- -
message: "#^Method FOS\\\\UserBundle\\\\Model\\\\UserManagerInterface\\:\\:updateUser\\(\\) invoked with 2 parameters, 1 required\\.$#" message: "#^Method FOS\\\\UserBundle\\\\Model\\\\UserManagerInterface\\:\\:updateUser\\(\\) invoked with 2 parameters, 1 required\\.$#"
count: 6 count: 6
path: src/Wallabag/CoreBundle/Controller/ConfigController.php path: src/Wallabag/CoreBundle/Controller/ConfigController.php
- -
message: "#^Call to an undefined method Lexik\\\\Bundle\\\\FormFilterBundle\\\\Filter\\\\Query\\\\QueryInterface\\:\\:getExpressionBuilder\\(\\)\\.$#" message: "#^Call to an undefined method Spiriit\\\\Bundle\\\\FormFilterBundle\\\\Filter\\\\Query\\\\QueryInterface\\:\\:getExpressionBuilder\\(\\)\\.$#"
count: 1 count: 1
path: src/Wallabag/CoreBundle/Event/Subscriber/CustomDoctrineORMSubscriber.php path: src/Wallabag/CoreBundle/Event/Subscriber/CustomDoctrineORMSubscriber.php
- -
message: "#^Call to an undefined method Lexik\\\\Bundle\\\\FormFilterBundle\\\\Filter\\\\Query\\\\QueryInterface\\:\\:getExpr\\(\\)\\.$#" message: "#^Call to an undefined method Spiriit\\\\Bundle\\\\FormFilterBundle\\\\Filter\\\\Query\\\\QueryInterface\\:\\:getExpr\\(\\)\\.$#"
count: 10 count: 10
path: src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php path: src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
- -
message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setFilepath\\(\\)\\.$#" message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setFilepath\\(\\)\\.$#"
count: 1 count: 1
path: src/Wallabag/ImportBundle/Controller/BrowserController.php path: src/Wallabag/ImportBundle/Controller/BrowserController.php
- -
message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setUser\\(\\)\\.$#" message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setUser\\(\\)\\.$#"
count: 1 count: 1
path: src/Wallabag/ImportBundle/Controller/BrowserController.php path: src/Wallabag/ImportBundle/Controller/BrowserController.php
- -
message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setFilepath\\(\\)\\.$#" message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setFilepath\\(\\)\\.$#"
count: 1 count: 1
path: src/Wallabag/ImportBundle/Controller/WallabagController.php path: src/Wallabag/ImportBundle/Controller/HtmlController.php
- -
message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setUser\\(\\)\\.$#" message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setUser\\(\\)\\.$#"
count: 1 count: 1
path: src/Wallabag/ImportBundle/Controller/WallabagController.php path: src/Wallabag/ImportBundle/Controller/HtmlController.php
- -
message: "#^Call to an undefined method Scheb\\\\TwoFactorBundle\\\\Model\\\\Email\\\\TwoFactorInterface\\:\\:getName\\(\\)\\.$#" message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setFilepath\\(\\)\\.$#"
count: 2 count: 1
path: src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php path: src/Wallabag/ImportBundle/Controller/WallabagController.php
- -
message: "#^PHPDoc type Symfony\\\\Component\\\\Mailer\\\\MailerInterface of property Wallabag\\\\UserBundle\\\\Mailer\\\\UserMailer\\:\\:\\$mailer is not covariant with PHPDoc type Swift_Mailer of overridden property FOS\\\\UserBundle\\\\Mailer\\\\TwigSwiftMailer\\:\\:\\$mailer\\.$#" message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setUser\\(\\)\\.$#"
count: 1 count: 1
path: src/Wallabag/UserBundle/Mailer/UserMailer.php path: src/Wallabag/ImportBundle/Controller/WallabagController.php
- -
message: "#^Call to an undefined method DOMNode\\:\\:getAttribute\\(\\)\\.$#" message: "#^Call to an undefined method Scheb\\\\TwoFactorBundle\\\\Model\\\\Email\\\\TwoFactorInterface\\:\\:getName\\(\\)\\.$#"
count: 1 count: 2
path: tests/Wallabag/CoreBundle/Controller/FeedControllerTest.php path: src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
- -
message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setUser\\(\\)\\.$#" message: "#^PHPDoc type Symfony\\\\Component\\\\Mailer\\\\MailerInterface of property Wallabag\\\\UserBundle\\\\Mailer\\\\UserMailer\\:\\:\\$mailer is not covariant with PHPDoc type Swift_Mailer of overridden property FOS\\\\UserBundle\\\\Mailer\\\\TwigSwiftMailer\\:\\:\\$mailer\\.$#"
count: 1 count: 1
path: src/Wallabag/ImportBundle/Controller/HtmlController.php path: src/Wallabag/UserBundle/Mailer/UserMailer.php
- -
message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setFilepath\\(\\)\\.$#" message: "#^Call to an undefined method DOMNode\\:\\:getAttribute\\(\\)\\.$#"
count: 1 count: 1
path: src/Wallabag/ImportBundle/Controller/HtmlController.php path: tests/Wallabag/CoreBundle/Controller/FeedControllerTest.php
-
message: "#^Method Symfony\\\\Contracts\\\\EventDispatcher\\\\EventDispatcherInterface\\:\\:dispatch()#"
count: 16
path: src/*

View File

@ -8,7 +8,7 @@ parameters:
- tests - tests
symfony: symfony:
container_xml_path: %rootDir%/../../../var/cache/test/appAppKernelTestDebugContainer.xml container_xml_path: %rootDir%/../../../var/cache/test/AppKernelTestDebugContainer.xml
doctrine: doctrine:
objectManagerLoader: tests/object-manager.php objectManagerLoader: tests/object-manager.php

View File

@ -15,6 +15,7 @@ use Wallabag\AnnotationBundle\Form\EditAnnotationType;
use Wallabag\AnnotationBundle\Form\NewAnnotationType; use Wallabag\AnnotationBundle\Form\NewAnnotationType;
use Wallabag\AnnotationBundle\Repository\AnnotationRepository; use Wallabag\AnnotationBundle\Repository\AnnotationRepository;
use Wallabag\CoreBundle\Entity\Entry; use Wallabag\CoreBundle\Entity\Entry;
use Wallabag\UserBundle\Entity\User;
class WallabagAnnotationController extends AbstractFOSRestController class WallabagAnnotationController extends AbstractFOSRestController
{ {
@ -146,6 +147,17 @@ class WallabagAnnotationController extends AbstractFOSRestController
} }
} }
/**
* @return User|null
*/
protected function getUser()
{
$user = parent::getUser();
\assert(null === $user || $user instanceof User);
return $user;
}
private function validateAnnotation(AnnotationRepository $annotationRepository, int $annotationId, int $userId) private function validateAnnotation(AnnotationRepository $annotationRepository, int $annotationId, int $userId)
{ {
$annotation = $annotationRepository->findOneByIdAndUserId($annotationId, $userId); $annotation = $annotationRepository->findOneByIdAndUserId($annotationId, $userId);

View File

@ -13,9 +13,6 @@ use Wallabag\UserBundle\Entity\User;
class AnnotationFixtures extends Fixture implements DependentFixtureInterface class AnnotationFixtures extends Fixture implements DependentFixtureInterface
{ {
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager) public function load(ObjectManager $manager)
{ {
$annotation1 = new Annotation($this->getReference('admin-user', User::class)); $annotation1 = new Annotation($this->getReference('admin-user', User::class));
@ -48,9 +45,6 @@ class AnnotationFixtures extends Fixture implements DependentFixtureInterface
$manager->flush(); $manager->flush();
} }
/**
* {@inheritdoc}
*/
public function getDependencies() public function getDependencies()
{ {
return [ return [

View File

@ -7,9 +7,6 @@ use Symfony\Component\Config\Definition\ConfigurationInterface;
class Configuration implements ConfigurationInterface class Configuration implements ConfigurationInterface
{ {
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder() public function getConfigTreeBuilder()
{ {
return new TreeBuilder('wallabag_annotation'); return new TreeBuilder('wallabag_annotation');

View File

@ -7,9 +7,6 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension;
class WallabagAnnotationExtension extends Extension class WallabagAnnotationExtension extends Extension
{ {
/**
* {@inheritdoc}
*/
public function load(array $configs, ContainerBuilder $container) public function load(array $configs, ContainerBuilder $container)
{ {
$configuration = new Configuration(); $configuration = new Configuration();

View File

@ -137,10 +137,6 @@ class AnnotationRepository extends ServiceEntityRepository
/** /**
* Find all annotations related to archived entries. * Find all annotations related to archived entries.
*
* @param $userId
*
* @return mixed
*/ */
public function findAllArchivedEntriesByUser($userId) public function findAllArchivedEntriesByUser($userId)
{ {

View File

@ -3,7 +3,6 @@
namespace Wallabag\ApiBundle\Controller; namespace Wallabag\ApiBundle\Controller;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
@ -12,6 +11,7 @@ use Symfony\Contracts\Translation\TranslatorInterface;
use Wallabag\ApiBundle\Entity\Client; use Wallabag\ApiBundle\Entity\Client;
use Wallabag\ApiBundle\Form\Type\ClientType; use Wallabag\ApiBundle\Form\Type\ClientType;
use Wallabag\ApiBundle\Repository\ClientRepository; use Wallabag\ApiBundle\Repository\ClientRepository;
use Wallabag\CoreBundle\Controller\AbstractController;
class DeveloperController extends AbstractController class DeveloperController extends AbstractController
{ {
@ -103,8 +103,7 @@ class DeveloperController extends AbstractController
*/ */
public function howtoFirstAppAction() 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'), 'wallabag_url' => $this->getParameter('domain_name'),
]); ]);
} }

View File

@ -93,13 +93,13 @@ class EntryRestController extends WallabagRestController
$returnId = (null === $request->query->get('return_id')) ? false : (bool) $request->query->get('return_id'); $returnId = (null === $request->query->get('return_id')) ? false : (bool) $request->query->get('return_id');
$hashedUrls = $request->query->get('hashed_urls', []); $hashedUrls = $request->query->all('hashed_urls');
$hashedUrl = $request->query->get('hashed_url', ''); $hashedUrl = $request->query->get('hashed_url', '');
if (!empty($hashedUrl)) { if (!empty($hashedUrl)) {
$hashedUrls[] = $hashedUrl; $hashedUrls[] = $hashedUrl;
} }
$urls = $request->query->get('urls', []); $urls = $request->query->all('urls');
$url = $request->query->get('url', ''); $url = $request->query->get('url', '');
if (!empty($url)) { if (!empty($url)) {
$urls[] = $url; $urls[] = $url;

View File

@ -118,8 +118,6 @@ class WallabagRestController extends AbstractFOSRestController
/** /**
* Shortcut to send data serialized in json. * Shortcut to send data serialized in json.
* *
* @param mixed $data
*
* @return JsonResponse * @return JsonResponse
*/ */
protected function sendResponse($data) protected function sendResponse($data)
@ -132,4 +130,15 @@ class WallabagRestController extends AbstractFOSRestController
return (new JsonResponse())->setJson($json); return (new JsonResponse())->setJson($json);
} }
/**
* @return User|null
*/
protected function getUser()
{
$user = parent::getUser();
\assert(null === $user || $user instanceof User);
return $user;
}
} }

View File

@ -12,9 +12,6 @@ use Symfony\Component\Config\Definition\ConfigurationInterface;
*/ */
class Configuration implements ConfigurationInterface class Configuration implements ConfigurationInterface
{ {
/**
* {@inheritdoc}
*/
public function getConfigTreeBuilder() public function getConfigTreeBuilder()
{ {
return new TreeBuilder('wallabag_api'); return new TreeBuilder('wallabag_api');

View File

@ -30,10 +30,10 @@ class CleanDownloadedImagesCommand extends Command
->setName('wallabag:clean-downloaded-images') ->setName('wallabag:clean-downloaded-images')
->setDescription('Cleans downloaded images which are no more associated to an entry') ->setDescription('Cleans downloaded images which are no more associated to an entry')
->addOption( ->addOption(
'dry-run', 'dry-run',
null, null,
InputOption::VALUE_NONE, InputOption::VALUE_NONE,
'Do not remove images, just dump counters' 'Do not remove images, just dump counters'
); );
} }

View File

@ -66,10 +66,10 @@ class InstallCommand extends Command
->setName('wallabag:install') ->setName('wallabag:install')
->setDescription('wallabag installer.') ->setDescription('wallabag installer.')
->addOption( ->addOption(
'reset', 'reset',
null, null,
InputOption::VALUE_NONE, InputOption::VALUE_NONE,
'Reset current database' 'Reset current database'
) )
; ;
} }
@ -125,8 +125,8 @@ class InstallCommand extends Command
try { try {
$conn->connect(); $conn->connect();
} catch (\Exception $e) { } catch (\Exception $e) {
if (false === strpos($e->getMessage(), 'Unknown database') if (!str_contains($e->getMessage(), 'Unknown database')
&& false === strpos($e->getMessage(), 'database "' . $this->databaseName . '" does not exist')) { && !str_contains($e->getMessage(), 'database "' . $this->databaseName . '" does not exist')) {
$fulfilled = false; $fulfilled = false;
$status = '<error>ERROR!</error>'; $status = '<error>ERROR!</error>';
$help = 'Can\'t connect to the database: ' . $e->getMessage(); $help = 'Can\'t connect to the database: ' . $e->getMessage();
@ -381,12 +381,12 @@ class InstallCommand extends Command
$schemaManager = $connection->createSchemaManager(); $schemaManager = $connection->createSchemaManager();
} catch (\Exception $exception) { } catch (\Exception $exception) {
// mysql & sqlite // mysql & sqlite
if (false !== strpos($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) { if (str_contains($exception->getMessage(), sprintf("Unknown database '%s'", $databaseName))) {
return false; return false;
} }
// pgsql // 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; return false;
} }

View File

@ -34,9 +34,9 @@ class TagAllCommand extends Command
->setName('wallabag:tag:all') ->setName('wallabag:tag:all')
->setDescription('Tag all entries using the tagging rules.') ->setDescription('Tag all entries using the tagging rules.')
->addArgument( ->addArgument(
'username', 'username',
InputArgument::REQUIRED, InputArgument::REQUIRED,
'User to tag entries for.' 'User to tag entries for.'
) )
; ;
} }

View File

@ -0,0 +1,20 @@
<?php
namespace Wallabag\CoreBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController as BaseAbstractController;
use Wallabag\UserBundle\Entity\User;
abstract class AbstractController extends BaseAbstractController
{
/**
* @return User|null
*/
protected function getUser()
{
$user = parent::getUser();
\assert(null === $user || $user instanceof User);
return $user;
}
}

View File

@ -10,7 +10,6 @@ use JMS\Serializer\SerializationContext;
use JMS\Serializer\SerializerBuilder; use JMS\Serializer\SerializerBuilder;
use PragmaRX\Recovery\Recovery as BackupCodes; use PragmaRX\Recovery\Recovery as BackupCodes;
use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface; use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\JsonResponse; use Symfony\Component\HttpFoundation\JsonResponse;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
@ -674,7 +673,7 @@ class ConfigController extends AbstractController
*/ */
public function setLocaleAction(Request $request, ValidatorInterface $validator, $language = null) 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)) { if (0 === \count($errors)) {
$request->getSession()->set('_locale', $language); $request->getSession()->set('_locale', $language);

View File

@ -5,11 +5,10 @@ namespace Wallabag\CoreBundle\Controller;
use Craue\ConfigBundle\Util\Config; use Craue\ConfigBundle\Util\Config;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\NoResultException; use Doctrine\ORM\NoResultException;
use Lexik\Bundle\FormFilterBundle\Filter\FilterBuilderUpdaterInterface;
use Pagerfanta\Doctrine\ORM\QueryAdapter as DoctrineORMAdapter; use Pagerfanta\Doctrine\ORM\QueryAdapter as DoctrineORMAdapter;
use Pagerfanta\Exception\OutOfRangeCurrentPageException; use Pagerfanta\Exception\OutOfRangeCurrentPageException;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Cache;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController; use Spiriit\Bundle\FormFilterBundle\Filter\FilterBuilderUpdaterInterface;
use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
@ -80,7 +79,7 @@ class EntryController extends AbstractController
}); });
foreach ($labels as $label) { foreach ($labels as $label) {
$remove = false; $remove = false;
if (0 === strpos($label, '-')) { if (str_starts_with($label, '-')) {
$label = substr($label, 1); $label = substr($label, 1);
$remove = true; $remove = true;
} }

View File

@ -2,7 +2,6 @@
namespace Wallabag\CoreBundle\Controller; namespace Wallabag\CoreBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException; use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
@ -89,9 +88,9 @@ class ExportController extends AbstractController
$currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : ''); $currentRoute = (null !== $request->query->get('currentRoute') ? $request->query->get('currentRoute') : '');
$entries = $entryRepository->getBuilderForSearchByUser( $entries = $entryRepository->getBuilderForSearchByUser(
$this->getUser()->getId(), $this->getUser()->getId(),
$searchTerm, $searchTerm,
$currentRoute $currentRoute
)->getQuery() )->getQuery()
->getResult(); ->getResult();

View File

@ -7,7 +7,6 @@ use Pagerfanta\Doctrine\ORM\QueryAdapter as DoctrineORMAdapter;
use Pagerfanta\Exception\OutOfRangeCurrentPageException; use Pagerfanta\Exception\OutOfRangeCurrentPageException;
use Pagerfanta\Pagerfanta; use Pagerfanta\Pagerfanta;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\HttpKernel\Exception\BadRequestHttpException; use Symfony\Component\HttpKernel\Exception\BadRequestHttpException;
@ -34,8 +33,6 @@ class FeedController extends AbstractController
* *
* @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter") * @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter")
* *
* @param $page
*
* @return Response * @return Response
*/ */
public function showUnreadFeedAction(User $user, $page) public function showUnreadFeedAction(User $user, $page)
@ -50,8 +47,6 @@ class FeedController extends AbstractController
* *
* @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter") * @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter")
* *
* @param $page
*
* @return Response * @return Response
*/ */
public function showArchiveFeedAction(User $user, $page) public function showArchiveFeedAction(User $user, $page)
@ -66,8 +61,6 @@ class FeedController extends AbstractController
* *
* @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter") * @ParamConverter("user", class="Wallabag\UserBundle\Entity\User", converter="username_feed_token_converter")
* *
* @param $page
*
* @return Response * @return Response
*/ */
public function showStarredFeedAction(User $user, $page) public function showStarredFeedAction(User $user, $page)
@ -241,8 +234,6 @@ class FeedController extends AbstractController
'domainName' => $this->getParameter('domain_name'), 'domainName' => $this->getParameter('domain_name'),
'version' => $this->getParameter('wallabag_core.version'), 'version' => $this->getParameter('wallabag_core.version'),
'updated' => $this->prepareFeedUpdatedDate($entries), 'updated' => $this->prepareFeedUpdatedDate($entries),
], ], new Response('', 200, ['Content-Type' => 'application/atom+xml']));
new Response('', 200, ['Content-Type' => 'application/atom+xml'])
);
} }
} }

View File

@ -3,7 +3,6 @@
namespace Wallabag\CoreBundle\Controller; namespace Wallabag\CoreBundle\Controller;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Form; use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;

View File

@ -4,7 +4,6 @@ namespace Wallabag\CoreBundle\Controller;
use Craue\ConfigBundle\Util\Config; use Craue\ConfigBundle\Util\Config;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Form; use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormInterface;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;

View File

@ -2,7 +2,6 @@
namespace Wallabag\CoreBundle\Controller; namespace Wallabag\CoreBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
class StaticController extends AbstractController class StaticController extends AbstractController

View File

@ -7,7 +7,6 @@ use Doctrine\ORM\QueryBuilder;
use Pagerfanta\Adapter\ArrayAdapter; use Pagerfanta\Adapter\ArrayAdapter;
use Pagerfanta\Exception\OutOfRangeCurrentPageException; use Pagerfanta\Exception\OutOfRangeCurrentPageException;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;

View File

@ -11,9 +11,6 @@ use Wallabag\UserBundle\Entity\User;
class ConfigFixtures extends Fixture implements DependentFixtureInterface class ConfigFixtures extends Fixture implements DependentFixtureInterface
{ {
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager): void public function load(ObjectManager $manager): void
{ {
$adminConfig = new Config($this->getReference('admin-user', User::class)); $adminConfig = new Config($this->getReference('admin-user', User::class));
@ -59,9 +56,6 @@ class ConfigFixtures extends Fixture implements DependentFixtureInterface
$manager->flush(); $manager->flush();
} }
/**
* {@inheritdoc}
*/
public function getDependencies() public function getDependencies()
{ {
return [ return [

View File

@ -12,9 +12,6 @@ use Wallabag\UserBundle\Entity\User;
class EntryFixtures extends Fixture implements DependentFixtureInterface class EntryFixtures extends Fixture implements DependentFixtureInterface
{ {
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager): void public function load(ObjectManager $manager): void
{ {
$now = new \DateTime(); $now = new \DateTime();
@ -144,9 +141,6 @@ class EntryFixtures extends Fixture implements DependentFixtureInterface
$manager->flush(); $manager->flush();
} }
/**
* {@inheritdoc}
*/
public function getDependencies() public function getDependencies()
{ {
return [ return [

View File

@ -20,9 +20,6 @@ class IgnoreOriginInstanceRuleFixtures extends Fixture implements ContainerAware
$this->container = $container; $this->container = $container;
} }
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager): void public function load(ObjectManager $manager): void
{ {
foreach ($this->container->getParameter('wallabag_core.default_ignore_origin_instance_rules') as $ignore_origin_instance_rule) { foreach ($this->container->getParameter('wallabag_core.default_ignore_origin_instance_rules') as $ignore_origin_instance_rule) {

View File

@ -11,9 +11,6 @@ use Wallabag\UserBundle\Entity\User;
class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureInterface class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureInterface
{ {
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager): void public function load(ObjectManager $manager): void
{ {
$rule = new IgnoreOriginUserRule(); $rule = new IgnoreOriginUserRule();
@ -25,9 +22,6 @@ class IgnoreOriginUserRuleFixtures extends Fixture implements DependentFixtureIn
$manager->flush(); $manager->flush();
} }
/**
* {@inheritdoc}
*/
public function getDependencies() public function getDependencies()
{ {
return [ return [

View File

@ -20,9 +20,6 @@ class InternalSettingFixtures extends Fixture implements ContainerAwareInterface
$this->container = $container; $this->container = $container;
} }
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager): void public function load(ObjectManager $manager): void
{ {
foreach ($this->container->getParameter('wallabag_core.default_internal_settings') as $setting) { foreach ($this->container->getParameter('wallabag_core.default_internal_settings') as $setting) {

View File

@ -24,9 +24,6 @@ class SiteCredentialFixtures extends Fixture implements DependentFixtureInterfac
$this->container = $container; $this->container = $container;
} }
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager): void public function load(ObjectManager $manager): void
{ {
$credential = new SiteCredential($this->getReference('admin-user', User::class)); $credential = new SiteCredential($this->getReference('admin-user', User::class));
@ -46,9 +43,6 @@ class SiteCredentialFixtures extends Fixture implements DependentFixtureInterfac
$manager->flush(); $manager->flush();
} }
/**
* {@inheritdoc}
*/
public function getDependencies() public function getDependencies()
{ {
return [ return [

View File

@ -8,13 +8,10 @@ use Wallabag\CoreBundle\Entity\Tag;
class TagFixtures extends Fixture class TagFixtures extends Fixture
{ {
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager): void public function load(ObjectManager $manager): void
{ {
$tags = [ $tags = [
'foo-bar-tag' => 'foo bar', //tag used for EntryControllerTest 'foo-bar-tag' => 'foo bar', // tag used for EntryControllerTest
'bar-tag' => 'bar', 'bar-tag' => 'bar',
'baz-tag' => 'baz', // tag used for ExportControllerTest 'baz-tag' => 'baz', // tag used for ExportControllerTest
'foo-tag' => 'foo', 'foo-tag' => 'foo',

View File

@ -10,9 +10,6 @@ use Wallabag\CoreBundle\Entity\TaggingRule;
class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface
{ {
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager): void public function load(ObjectManager $manager): void
{ {
$tr1 = new TaggingRule(); $tr1 = new TaggingRule();
@ -61,9 +58,6 @@ class TaggingRuleFixtures extends Fixture implements DependentFixtureInterface
$manager->flush(); $manager->flush();
} }
/**
* {@inheritdoc}
*/
public function getDependencies() public function getDependencies()
{ {
return [ return [

View File

@ -14,9 +14,6 @@ use Doctrine\DBAL\Types\JsonType;
*/ */
class JsonArrayType extends JsonType class JsonArrayType extends JsonType
{ {
/**
* {@inheritdoc}
*/
public function convertToPHPValue($value, AbstractPlatform $platform) public function convertToPHPValue($value, AbstractPlatform $platform)
{ {
if (null === $value || '' === $value) { if (null === $value || '' === $value) {
@ -28,17 +25,11 @@ class JsonArrayType extends JsonType
return json_decode($value, true); return json_decode($value, true);
} }
/**
* {@inheritdoc}
*/
public function getName() public function getName()
{ {
return 'json_array'; return 'json_array';
} }
/**
* {@inheritdoc}
*/
public function requiresSQLCommentHint(AbstractPlatform $platform) public function requiresSQLCommentHint(AbstractPlatform $platform)
{ {
return true; return true;

View File

@ -183,8 +183,8 @@ class Config
private $taggingRules; private $taggingRules;
/** /**
@var ArrayCollection<IgnoreOriginUserRule> * @var ArrayCollection<IgnoreOriginUserRule>
*
* @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\IgnoreOriginUserRule", mappedBy="config", cascade={"remove"}) * @ORM\OneToMany(targetEntity="Wallabag\CoreBundle\Entity\IgnoreOriginUserRule", mappedBy="config", cascade={"remove"})
* @ORM\OrderBy({"id" = "ASC"}) * @ORM\OrderBy({"id" = "ASC"})
*/ */
@ -261,8 +261,6 @@ class Config
/** /**
* Set user. * Set user.
* *
* @param User $user
*
* @return Config * @return Config
*/ */
public function setUser(User $user = null) public function setUser(User $user = null)
@ -433,9 +431,6 @@ class Config
return $this; return $this;
} }
/**
* @return string
*/
public function getFont(): ?string public function getFont(): ?string
{ {
return $this->font; return $this->font;
@ -451,9 +446,6 @@ class Config
return $this; return $this;
} }
/**
* @return float
*/
public function getFontsize(): ?float public function getFontsize(): ?float
{ {
return $this->fontsize; return $this->fontsize;
@ -469,9 +461,6 @@ class Config
return $this; return $this;
} }
/**
* @return float
*/
public function getLineHeight(): ?float public function getLineHeight(): ?float
{ {
return $this->lineHeight; return $this->lineHeight;
@ -487,9 +476,6 @@ class Config
return $this; return $this;
} }
/**
* @return float
*/
public function getMaxWidth(): ?float public function getMaxWidth(): ?float
{ {
return $this->maxWidth; return $this->maxWidth;

View File

@ -138,7 +138,7 @@ class Entry
* *
* @Groups({"entries_for_user", "export_all"}) * @Groups({"entries_for_user", "export_all"})
*/ */
private $archivedAt = null; private $archivedAt;
/** /**
* @var bool * @var bool
@ -203,7 +203,7 @@ class Entry
* *
* @Groups({"entries_for_user", "export_all"}) * @Groups({"entries_for_user", "export_all"})
*/ */
private $starredAt = null; private $starredAt;
/** /**
* @ORM\OneToMany(targetEntity="Wallabag\AnnotationBundle\Entity\Annotation", mappedBy="entry", cascade={"persist", "remove"}) * @ORM\OneToMany(targetEntity="Wallabag\AnnotationBundle\Entity\Annotation", mappedBy="entry", cascade={"persist", "remove"})
@ -1007,8 +1007,6 @@ class Entry
} }
/** /**
* @param mixed $hashedUrl
*
* @return Entry * @return Entry
*/ */
public function setHashedUrl($hashedUrl) public function setHashedUrl($hashedUrl)

View File

@ -2,12 +2,12 @@
namespace Wallabag\CoreBundle\Event\Subscriber; namespace Wallabag\CoreBundle\Event\Subscriber;
use Lexik\Bundle\FormFilterBundle\Event\GetFilterConditionEvent; use Spiriit\Bundle\FormFilterBundle\Event\GetFilterConditionEvent;
use Lexik\Bundle\FormFilterBundle\Event\Subscriber\DoctrineORMSubscriber; use Spiriit\Bundle\FormFilterBundle\Event\Subscriber\DoctrineORMSubscriber;
use Symfony\Component\EventDispatcher\EventSubscriberInterface; use Symfony\Component\EventDispatcher\EventSubscriberInterface;
/** /**
* This custom class override the default behavior of LexikFilterBundle on `filter_date_range` * This custom class override the default behavior of SpiriitFormFilterBundle on `filter_date_range`
* It converts a date_range to date_time_range to add hour to be able to grab a whole day (from 00:00:00 to 23:59:59). * It converts a date_range to date_time_range to add hour to be able to grab a whole day (from 00:00:00 to 23:59:59).
*/ */
class CustomDoctrineORMSubscriber extends DoctrineORMSubscriber implements EventSubscriberInterface class CustomDoctrineORMSubscriber extends DoctrineORMSubscriber implements EventSubscriberInterface

View File

@ -2,14 +2,14 @@
namespace Wallabag\CoreBundle\Form\Type; namespace Wallabag\CoreBundle\Form\Type;
use Lexik\Bundle\FormFilterBundle\Filter\FilterOperands; use Spiriit\Bundle\FormFilterBundle\Filter\FilterOperands;
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\CheckboxFilterType; use Spiriit\Bundle\FormFilterBundle\Filter\Form\Type\CheckboxFilterType;
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\ChoiceFilterType; use Spiriit\Bundle\FormFilterBundle\Filter\Form\Type\ChoiceFilterType;
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\DateRangeFilterType; use Spiriit\Bundle\FormFilterBundle\Filter\Form\Type\DateRangeFilterType;
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\NumberFilterType; use Spiriit\Bundle\FormFilterBundle\Filter\Form\Type\NumberFilterType;
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\NumberRangeFilterType; use Spiriit\Bundle\FormFilterBundle\Filter\Form\Type\NumberRangeFilterType;
use Lexik\Bundle\FormFilterBundle\Filter\Form\Type\TextFilterType; use Spiriit\Bundle\FormFilterBundle\Filter\Form\Type\TextFilterType;
use Lexik\Bundle\FormFilterBundle\Filter\Query\QueryInterface; use Spiriit\Bundle\FormFilterBundle\Filter\Query\QueryInterface;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;

View File

@ -42,9 +42,6 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder
$this->token = $token; $this->token = $token;
} }
/**
* {@inheritdoc}
*/
public function buildForHost($host) public function buildForHost($host)
{ {
$user = $this->getUser(); $user = $this->getUser();
@ -119,7 +116,7 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder
$extraFields = []; $extraFields = [];
foreach ($extraFieldsStrings as $extraField) { foreach ($extraFieldsStrings as $extraField) {
if (false === strpos($extraField, '=')) { if (!str_contains($extraField, '=')) {
continue; continue;
} }

View File

@ -98,7 +98,7 @@ class ContentProxy
$errors = $this->validator->validate( $errors = $this->validator->validate(
$value, $value,
(new LocaleConstraint(['canonicalize' => true])) new LocaleConstraint(['canonicalize' => true])
); );
if (0 === \count($errors)) { if (0 === \count($errors)) {
@ -119,7 +119,7 @@ class ContentProxy
{ {
$errors = $this->validator->validate( $errors = $this->validator->validate(
$value, $value,
(new UrlConstraint()) new UrlConstraint()
); );
if (0 === \count($errors)) { 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 * 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. * 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) * @return string (maybe contains invalid UTF-8 character)
*/ */
private function convertPdfEncodingToUTF8($title) private function convertPdfEncodingToUTF8($title)

View File

@ -162,7 +162,7 @@ class DownloadImages
$cleanSVG = $sanitizer->sanitize((string) $res->getBody()); $cleanSVG = $sanitizer->sanitize((string) $res->getBody());
// add an extra validation by checking about `<svg ` // add an extra validation by checking about `<svg `
if (false === $cleanSVG || false === strpos($cleanSVG, '<svg ')) { if (false === $cleanSVG || !str_contains($cleanSVG, '<svg ')) {
$this->logger->error('DownloadImages: Bad SVG given', ['path' => $imagePath]); $this->logger->error('DownloadImages: Bad SVG given', ['path' => $imagePath]);
return false; return false;
@ -287,7 +287,10 @@ class DownloadImages
$iterator = $imagesCrawler->getIterator(); $iterator = $imagesCrawler->getIterator();
while ($iterator->valid()) { while ($iterator->valid()) {
$srcsetAttribute = $iterator->current()->getAttribute('srcset'); $node = $iterator->current();
\assert($node instanceof \DOMElement);
$srcsetAttribute = $node->getAttribute('srcset');
if ('' !== $srcsetAttribute) { if ('' !== $srcsetAttribute) {
// Couldn't start with " OR ' OR a white space // Couldn't start with " OR ' OR a white space
@ -373,7 +376,7 @@ class DownloadImages
$bytes = substr((string) $res->getBody(), 0, 8); $bytes = substr((string) $res->getBody(), 0, 8);
foreach ($types as $type => $header) { foreach ($types as $type => $header) {
if (0 === strpos($bytes, $header)) { if (str_starts_with($bytes, $header)) {
$ext = $type; $ext = $type;
break; break;
} }

View File

@ -44,8 +44,8 @@ class Redirect
return $url; return $url;
} }
if (!$ignoreActionMarkAsRead && if (!$ignoreActionMarkAsRead
Config::REDIRECT_TO_HOMEPAGE === $user->getConfig()->getActionMarkAsRead()) { && Config::REDIRECT_TO_HOMEPAGE === $user->getConfig()->getActionMarkAsRead()) {
return $this->router->generate('homepage'); return $this->router->generate('homepage');
} }

View File

@ -63,7 +63,7 @@ class EntryRepository extends ServiceEntityRepository
return $this return $this
->getSortedQueryBuilderByUser($userId) ->getSortedQueryBuilderByUser($userId)
->andWhere('e.isArchived = false') ->andWhere('e.isArchived = false')
; ;
} }
/** /**
@ -78,7 +78,7 @@ class EntryRepository extends ServiceEntityRepository
return $this return $this
->getQueryBuilderByUser($userId) ->getQueryBuilderByUser($userId)
->andWhere('e.isArchived = false') ->andWhere('e.isArchived = false')
; ;
} }
/** /**
@ -225,7 +225,7 @@ class EntryRepository extends ServiceEntityRepository
return $this return $this
->getSortedQueryBuilderByUser($userId) ->getSortedQueryBuilderByUser($userId)
->innerJoin('e.annotations', 'a') ->innerJoin('e.annotations', 'a')
; ;
} }
/** /**
@ -240,7 +240,7 @@ class EntryRepository extends ServiceEntityRepository
return $this return $this
->getQueryBuilderByUser($userId) ->getQueryBuilderByUser($userId)
->innerJoin('e.annotations', 'a') ->innerJoin('e.annotations', 'a')
; ;
} }
/** /**

View File

@ -113,7 +113,6 @@
<tr><td>kphoen/rulerz</td><td>MIT</td></tr> <tr><td>kphoen/rulerz</td><td>MIT</td></tr>
<tr><td>kphoen/rulerz-bundle</td><td>MIT</td></tr> <tr><td>kphoen/rulerz-bundle</td><td>MIT</td></tr>
<tr><td>kriswallsmith/assetic</td><td>MIT</td></tr> <tr><td>kriswallsmith/assetic</td><td>MIT</td></tr>
<tr><td>lexik/form-filter-bundle</td><td>MIT</td></tr>
<tr><td>mgargano/simplehtmldom</td><td>MIT</td></tr> <tr><td>mgargano/simplehtmldom</td><td>MIT</td></tr>
<tr><td>michelf/php-markdown</td><td>BSD-3-Clause</td></tr> <tr><td>michelf/php-markdown</td><td>BSD-3-Clause</td></tr>
<tr><td>monolog/monolog</td><td>MIT</td></tr> <tr><td>monolog/monolog</td><td>MIT</td></tr>
@ -132,6 +131,7 @@
<tr><td>sensio/framework-extra-bundle</td><td>MIT</td></tr> <tr><td>sensio/framework-extra-bundle</td><td>MIT</td></tr>
<tr><td>simplepie/simplepie</td><td>BSD-3-Clause</td></tr> <tr><td>simplepie/simplepie</td><td>BSD-3-Clause</td></tr>
<tr><td>smalot/pdfparser</td><td>GPL-3.0</td></tr> <tr><td>smalot/pdfparser</td><td>GPL-3.0</td></tr>
<tr><td>spiriitlabs/form-filter-bundle</td><td>MIT</td></tr>
<tr><td>sonata-project/google-authenticator</td><td>MIT</td></tr> <tr><td>sonata-project/google-authenticator</td><td>MIT</td></tr>
<tr><td>stof/doctrine-extensions-bundle</td><td>MIT</td></tr> <tr><td>stof/doctrine-extensions-bundle</td><td>MIT</td></tr>
<tr><td>symfony/assetic-bundle</td><td>MIT</td></tr> <tr><td>symfony/assetic-bundle</td><td>MIT</td></tr>

View File

@ -7,9 +7,6 @@ use PhpAmqpLib\Message\AMQPMessage;
class AMQPEntryConsumer extends AbstractConsumer implements ConsumerInterface class AMQPEntryConsumer extends AbstractConsumer implements ConsumerInterface
{ {
/**
* {@inheritdoc}
*/
public function execute(AMQPMessage $msg) public function execute(AMQPMessage $msg)
{ {
return $this->handleMessage($msg->body); return $this->handleMessage($msg->body);

View File

@ -2,11 +2,11 @@
namespace Wallabag\ImportBundle\Controller; namespace Wallabag\ImportBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use Wallabag\CoreBundle\Controller\AbstractController;
use Wallabag\ImportBundle\Form\Type\UploadImportType; use Wallabag\ImportBundle\Form\Type\UploadImportType;
use Wallabag\ImportBundle\Import\ImportInterface; use Wallabag\ImportBundle\Import\ImportInterface;

View File

@ -33,9 +33,6 @@ class ChromeController extends BrowserController
return parent::indexAction($request, $translator); return parent::indexAction($request, $translator);
} }
/**
* {@inheritdoc}
*/
protected function getImportService() protected function getImportService()
{ {
if ($this->craueConfig->get('import_with_rabbitmq')) { if ($this->craueConfig->get('import_with_rabbitmq')) {
@ -47,9 +44,6 @@ class ChromeController extends BrowserController
return $this->chromeImport; return $this->chromeImport;
} }
/**
* {@inheritdoc}
*/
protected function getImportTemplate() protected function getImportTemplate()
{ {
return '@WallabagImport/Chrome/index.html.twig'; return '@WallabagImport/Chrome/index.html.twig';

View File

@ -4,10 +4,10 @@ namespace Wallabag\ImportBundle\Controller;
use Craue\ConfigBundle\Util\Config; use Craue\ConfigBundle\Util\Config;
use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer; use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use Wallabag\CoreBundle\Controller\AbstractController;
use Wallabag\ImportBundle\Form\Type\UploadImportType; use Wallabag\ImportBundle\Form\Type\UploadImportType;
use Wallabag\ImportBundle\Import\DeliciousImport; use Wallabag\ImportBundle\Import\DeliciousImport;
use Wallabag\ImportBundle\Redis\Producer as RedisProducer; use Wallabag\ImportBundle\Redis\Producer as RedisProducer;

View File

@ -33,9 +33,6 @@ class ElcuratorController extends WallabagController
return parent::indexAction($request, $translator); return parent::indexAction($request, $translator);
} }
/**
* {@inheritdoc}
*/
protected function getImportService() protected function getImportService()
{ {
if ($this->craueConfig->get('import_with_rabbitmq')) { if ($this->craueConfig->get('import_with_rabbitmq')) {
@ -47,9 +44,6 @@ class ElcuratorController extends WallabagController
return $this->elcuratorImport; return $this->elcuratorImport;
} }
/**
* {@inheritdoc}
*/
protected function getImportTemplate() protected function getImportTemplate()
{ {
return '@WallabagImport/Elcurator/index.html.twig'; return '@WallabagImport/Elcurator/index.html.twig';

View File

@ -33,9 +33,6 @@ class FirefoxController extends BrowserController
return parent::indexAction($request, $translator); return parent::indexAction($request, $translator);
} }
/**
* {@inheritdoc}
*/
protected function getImportService() protected function getImportService()
{ {
if ($this->craueConfig->get('import_with_rabbitmq')) { if ($this->craueConfig->get('import_with_rabbitmq')) {
@ -47,9 +44,6 @@ class FirefoxController extends BrowserController
return $this->firefoxImport; return $this->firefoxImport;
} }
/**
* {@inheritdoc}
*/
protected function getImportTemplate() protected function getImportTemplate()
{ {
return '@WallabagImport/Firefox/index.html.twig'; return '@WallabagImport/Firefox/index.html.twig';

View File

@ -2,11 +2,11 @@
namespace Wallabag\ImportBundle\Controller; namespace Wallabag\ImportBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use Wallabag\CoreBundle\Controller\AbstractController;
use Wallabag\ImportBundle\Form\Type\UploadImportType; use Wallabag\ImportBundle\Form\Type\UploadImportType;
use Wallabag\ImportBundle\Import\ImportInterface; use Wallabag\ImportBundle\Import\ImportInterface;

View File

@ -4,9 +4,9 @@ namespace Wallabag\ImportBundle\Controller;
use Craue\ConfigBundle\Util\Config; use Craue\ConfigBundle\Util\Config;
use Predis\Client; use Predis\Client;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface; use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
use Wallabag\CoreBundle\Controller\AbstractController;
use Wallabag\ImportBundle\Consumer\RabbitMQConsumerTotalProxy; use Wallabag\ImportBundle\Consumer\RabbitMQConsumerTotalProxy;
use Wallabag\ImportBundle\Import\ImportChain; use Wallabag\ImportBundle\Import\ImportChain;

View File

@ -4,10 +4,10 @@ namespace Wallabag\ImportBundle\Controller;
use Craue\ConfigBundle\Util\Config; use Craue\ConfigBundle\Util\Config;
use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer; use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use Wallabag\CoreBundle\Controller\AbstractController;
use Wallabag\ImportBundle\Form\Type\UploadImportType; use Wallabag\ImportBundle\Form\Type\UploadImportType;
use Wallabag\ImportBundle\Import\InstapaperImport; use Wallabag\ImportBundle\Import\InstapaperImport;
use Wallabag\ImportBundle\Redis\Producer as RedisProducer; use Wallabag\ImportBundle\Redis\Producer as RedisProducer;

View File

@ -4,10 +4,10 @@ namespace Wallabag\ImportBundle\Controller;
use Craue\ConfigBundle\Util\Config; use Craue\ConfigBundle\Util\Config;
use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer; use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use Wallabag\CoreBundle\Controller\AbstractController;
use Wallabag\ImportBundle\Form\Type\UploadImportType; use Wallabag\ImportBundle\Form\Type\UploadImportType;
use Wallabag\ImportBundle\Import\PinboardImport; use Wallabag\ImportBundle\Import\PinboardImport;
use Wallabag\ImportBundle\Redis\Producer as RedisProducer; use Wallabag\ImportBundle\Redis\Producer as RedisProducer;

View File

@ -4,13 +4,13 @@ namespace Wallabag\ImportBundle\Controller;
use Craue\ConfigBundle\Util\Config; use Craue\ConfigBundle\Util\Config;
use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer; use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\Form\Extension\Core\Type\CheckboxType; use Symfony\Component\Form\Extension\Core\Type\CheckboxType;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Session\SessionInterface; use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface; use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use Wallabag\CoreBundle\Controller\AbstractController;
use Wallabag\ImportBundle\Import\PocketImport; use Wallabag\ImportBundle\Import\PocketImport;
use Wallabag\ImportBundle\Redis\Producer as RedisProducer; use Wallabag\ImportBundle\Redis\Producer as RedisProducer;

View File

@ -33,9 +33,6 @@ class PocketHtmlController extends HtmlController
return parent::indexAction($request, $translator); return parent::indexAction($request, $translator);
} }
/**
* {@inheritdoc}
*/
protected function getImportService() protected function getImportService()
{ {
if ($this->craueConfig->get('import_with_rabbitmq')) { if ($this->craueConfig->get('import_with_rabbitmq')) {
@ -47,9 +44,6 @@ class PocketHtmlController extends HtmlController
return $this->pocketHtmlImport; return $this->pocketHtmlImport;
} }
/**
* {@inheritdoc}
*/
protected function getImportTemplate() protected function getImportTemplate()
{ {
return '@WallabagImport/PocketHtml/index.html.twig'; return '@WallabagImport/PocketHtml/index.html.twig';

View File

@ -4,10 +4,10 @@ namespace Wallabag\ImportBundle\Controller;
use Craue\ConfigBundle\Util\Config; use Craue\ConfigBundle\Util\Config;
use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer; use OldSound\RabbitMqBundle\RabbitMq\Producer as RabbitMqProducer;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use Wallabag\CoreBundle\Controller\AbstractController;
use Wallabag\ImportBundle\Form\Type\UploadImportType; use Wallabag\ImportBundle\Form\Type\UploadImportType;
use Wallabag\ImportBundle\Import\ReadabilityImport; use Wallabag\ImportBundle\Import\ReadabilityImport;
use Wallabag\ImportBundle\Redis\Producer as RedisProducer; use Wallabag\ImportBundle\Redis\Producer as RedisProducer;

View File

@ -33,9 +33,6 @@ class ShaarliController extends HtmlController
return parent::indexAction($request, $translator); return parent::indexAction($request, $translator);
} }
/**
* {@inheritdoc}
*/
protected function getImportService() protected function getImportService()
{ {
if ($this->craueConfig->get('import_with_rabbitmq')) { if ($this->craueConfig->get('import_with_rabbitmq')) {
@ -47,9 +44,6 @@ class ShaarliController extends HtmlController
return $this->shaarliImport; return $this->shaarliImport;
} }
/**
* {@inheritdoc}
*/
protected function getImportTemplate() protected function getImportTemplate()
{ {
return '@WallabagImport/Shaarli/index.html.twig'; return '@WallabagImport/Shaarli/index.html.twig';

View File

@ -2,11 +2,11 @@
namespace Wallabag\ImportBundle\Controller; namespace Wallabag\ImportBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\HttpFoundation\RedirectResponse; use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use Wallabag\CoreBundle\Controller\AbstractController;
use Wallabag\ImportBundle\Form\Type\UploadImportType; use Wallabag\ImportBundle\Form\Type\UploadImportType;
use Wallabag\ImportBundle\Import\ImportInterface; use Wallabag\ImportBundle\Import\ImportInterface;

View File

@ -33,9 +33,6 @@ class WallabagV1Controller extends WallabagController
return parent::indexAction($request, $translator); return parent::indexAction($request, $translator);
} }
/**
* {@inheritdoc}
*/
protected function getImportService() protected function getImportService()
{ {
if ($this->craueConfig->get('import_with_rabbitmq')) { if ($this->craueConfig->get('import_with_rabbitmq')) {
@ -47,9 +44,6 @@ class WallabagV1Controller extends WallabagController
return $this->wallabagImport; return $this->wallabagImport;
} }
/**
* {@inheritdoc}
*/
protected function getImportTemplate() protected function getImportTemplate()
{ {
return '@WallabagImport/WallabagV1/index.html.twig'; return '@WallabagImport/WallabagV1/index.html.twig';

View File

@ -33,9 +33,6 @@ class WallabagV2Controller extends WallabagController
return parent::indexAction($request, $translator); return parent::indexAction($request, $translator);
} }
/**
* {@inheritdoc}
*/
protected function getImportService() protected function getImportService()
{ {
if ($this->craueConfig->get('import_with_rabbitmq')) { if ($this->craueConfig->get('import_with_rabbitmq')) {
@ -47,9 +44,6 @@ class WallabagV2Controller extends WallabagController
return $this->wallabagImport; return $this->wallabagImport;
} }
/**
* {@inheritdoc}
*/
protected function getImportTemplate() protected function getImportTemplate()
{ {
return '@WallabagImport/WallabagV2/index.html.twig'; return '@WallabagImport/WallabagV2/index.html.twig';

View File

@ -92,9 +92,6 @@ abstract class AbstractImport implements ImportInterface
return $this; return $this;
} }
/**
* {@inheritdoc}
*/
public function getSummary() public function getSummary()
{ {
return [ return [

View File

@ -9,24 +9,12 @@ abstract class BrowserImport extends AbstractImport
{ {
protected $filepath; protected $filepath;
/**
* {@inheritdoc}
*/
abstract public function getName(); abstract public function getName();
/**
* {@inheritdoc}
*/
abstract public function getUrl(); abstract public function getUrl();
/**
* {@inheritdoc}
*/
abstract public function getDescription(); abstract public function getDescription();
/**
* {@inheritdoc}
*/
public function import() public function import()
{ {
if (!$this->user) { if (!$this->user) {
@ -72,9 +60,6 @@ abstract class BrowserImport extends AbstractImport
return $this; return $this;
} }
/**
* {@inheritdoc}
*/
public function parseEntry(array $importedEntry) public function parseEntry(array $importedEntry)
{ {
if ((!\array_key_exists('guid', $importedEntry) || (!\array_key_exists('id', $importedEntry))) && \is_array(reset($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) protected function setEntryAsRead(array $importedEntry)
{ {
$importedEntry['is_archived'] = 1; $importedEntry['is_archived'] = 1;

View File

@ -6,33 +6,21 @@ class ChromeImport extends BrowserImport
{ {
protected $filepath; protected $filepath;
/**
* {@inheritdoc}
*/
public function getName() public function getName()
{ {
return 'Chrome'; return 'Chrome';
} }
/**
* {@inheritdoc}
*/
public function getUrl() public function getUrl()
{ {
return 'import_chrome'; return 'import_chrome';
} }
/**
* {@inheritdoc}
*/
public function getDescription() public function getDescription()
{ {
return 'import.chrome.description'; return 'import.chrome.description';
} }
/**
* {@inheritdoc}
*/
public function validateEntry(array $importedEntry) public function validateEntry(array $importedEntry)
{ {
if (empty($importedEntry['url'])) { if (empty($importedEntry['url'])) {
@ -42,9 +30,6 @@ class ChromeImport extends BrowserImport
return true; return true;
} }
/**
* {@inheritdoc}
*/
protected function prepareEntry(array $entry = []) protected function prepareEntry(array $entry = [])
{ {
$data = [ $data = [

View File

@ -8,25 +8,16 @@ class DeliciousImport extends AbstractImport
{ {
private $filepath; private $filepath;
/**
* {@inheritdoc}
*/
public function getName() public function getName()
{ {
return 'Delicious'; return 'Delicious';
} }
/**
* {@inheritdoc}
*/
public function getUrl() public function getUrl()
{ {
return 'import_delicious'; return 'import_delicious';
} }
/**
* {@inheritdoc}
*/
public function getDescription() public function getDescription()
{ {
return 'import.delicious.description'; return 'import.delicious.description';
@ -44,9 +35,6 @@ class DeliciousImport extends AbstractImport
return $this; return $this;
} }
/**
* {@inheritdoc}
*/
public function import() public function import()
{ {
if (!$this->user) { if (!$this->user) {
@ -80,9 +68,6 @@ class DeliciousImport extends AbstractImport
return true; return true;
} }
/**
* {@inheritdoc}
*/
public function validateEntry(array $importedEntry) public function validateEntry(array $importedEntry)
{ {
if (empty($importedEntry['url'])) { if (empty($importedEntry['url'])) {
@ -92,9 +77,6 @@ class DeliciousImport extends AbstractImport
return true; return true;
} }
/**
* {@inheritdoc}
*/
public function parseEntry(array $importedEntry) public function parseEntry(array $importedEntry)
{ {
$existingEntry = $this->em $existingEntry = $this->em
@ -141,9 +123,6 @@ class DeliciousImport extends AbstractImport
return $entry; return $entry;
} }
/**
* {@inheritdoc}
*/
protected function setEntryAsRead(array $importedEntry) protected function setEntryAsRead(array $importedEntry)
{ {
return $importedEntry; return $importedEntry;

View File

@ -4,33 +4,21 @@ namespace Wallabag\ImportBundle\Import;
class ElcuratorImport extends WallabagImport class ElcuratorImport extends WallabagImport
{ {
/**
* {@inheritdoc}
*/
public function getName() public function getName()
{ {
return 'elcurator'; return 'elcurator';
} }
/**
* {@inheritdoc}
*/
public function getUrl() public function getUrl()
{ {
return 'import_elcurator'; return 'import_elcurator';
} }
/**
* {@inheritdoc}
*/
public function getDescription() public function getDescription()
{ {
return 'import.elcurator.description'; return 'import.elcurator.description';
} }
/**
* {@inheritdoc}
*/
protected function prepareEntry($entry = []) protected function prepareEntry($entry = [])
{ {
return [ return [
@ -42,9 +30,6 @@ class ElcuratorImport extends WallabagImport
] + $entry; ] + $entry;
} }
/**
* {@inheritdoc}
*/
protected function setEntryAsRead(array $importedEntry) protected function setEntryAsRead(array $importedEntry)
{ {
$importedEntry['is_archived'] = 1; $importedEntry['is_archived'] = 1;

View File

@ -6,33 +6,21 @@ class FirefoxImport extends BrowserImport
{ {
protected $filepath; protected $filepath;
/**
* {@inheritdoc}
*/
public function getName() public function getName()
{ {
return 'Firefox'; return 'Firefox';
} }
/**
* {@inheritdoc}
*/
public function getUrl() public function getUrl()
{ {
return 'import_firefox'; return 'import_firefox';
} }
/**
* {@inheritdoc}
*/
public function getDescription() public function getDescription()
{ {
return 'import.firefox.description'; return 'import.firefox.description';
} }
/**
* {@inheritdoc}
*/
public function validateEntry(array $importedEntry) public function validateEntry(array $importedEntry)
{ {
if (empty($importedEntry['uri'])) { if (empty($importedEntry['uri'])) {
@ -42,9 +30,6 @@ class FirefoxImport extends BrowserImport
return true; return true;
} }
/**
* {@inheritdoc}
*/
protected function prepareEntry(array $entry = []) protected function prepareEntry(array $entry = [])
{ {
$data = [ $data = [

View File

@ -9,24 +9,12 @@ abstract class HtmlImport extends AbstractImport
{ {
protected $filepath; protected $filepath;
/**
* {@inheritdoc}
*/
abstract public function getName(); abstract public function getName();
/**
* {@inheritdoc}
*/
abstract public function getUrl(); abstract public function getUrl();
/**
* {@inheritdoc}
*/
abstract public function getDescription(); abstract public function getDescription();
/**
* {@inheritdoc}
*/
public function import() public function import()
{ {
if (!$this->user) { if (!$this->user) {
@ -86,9 +74,6 @@ abstract class HtmlImport extends AbstractImport
return $this; return $this;
} }
/**
* {@inheritdoc}
*/
public function parseEntry(array $importedEntry) public function parseEntry(array $importedEntry)
{ {
$url = $importedEntry['url']; $url = $importedEntry['url'];
@ -196,9 +181,6 @@ abstract class HtmlImport extends AbstractImport
} }
} }
/**
* {@inheritdoc}
*/
protected function setEntryAsRead(array $importedEntry) protected function setEntryAsRead(array $importedEntry)
{ {
$importedEntry['is_archived'] = 1; $importedEntry['is_archived'] = 1;

View File

@ -8,25 +8,16 @@ class InstapaperImport extends AbstractImport
{ {
private $filepath; private $filepath;
/**
* {@inheritdoc}
*/
public function getName() public function getName()
{ {
return 'Instapaper'; return 'Instapaper';
} }
/**
* {@inheritdoc}
*/
public function getUrl() public function getUrl()
{ {
return 'import_instapaper'; return 'import_instapaper';
} }
/**
* {@inheritdoc}
*/
public function getDescription() public function getDescription()
{ {
return 'import.instapaper.description'; return 'import.instapaper.description';
@ -44,9 +35,6 @@ class InstapaperImport extends AbstractImport
return $this; return $this;
} }
/**
* {@inheritdoc}
*/
public function import() public function import()
{ {
if (!$this->user) { if (!$this->user) {
@ -108,9 +96,6 @@ class InstapaperImport extends AbstractImport
return true; return true;
} }
/**
* {@inheritdoc}
*/
public function validateEntry(array $importedEntry) public function validateEntry(array $importedEntry)
{ {
if (empty($importedEntry['url'])) { if (empty($importedEntry['url'])) {
@ -120,9 +105,6 @@ class InstapaperImport extends AbstractImport
return true; return true;
} }
/**
* {@inheritdoc}
*/
public function parseEntry(array $importedEntry) public function parseEntry(array $importedEntry)
{ {
$existingEntry = $this->em $existingEntry = $this->em
@ -159,9 +141,6 @@ class InstapaperImport extends AbstractImport
return $entry; return $entry;
} }
/**
* {@inheritdoc}
*/
protected function setEntryAsRead(array $importedEntry) protected function setEntryAsRead(array $importedEntry)
{ {
$importedEntry['is_archived'] = 1; $importedEntry['is_archived'] = 1;

View File

@ -8,25 +8,16 @@ class PinboardImport extends AbstractImport
{ {
private $filepath; private $filepath;
/**
* {@inheritdoc}
*/
public function getName() public function getName()
{ {
return 'Pinboard'; return 'Pinboard';
} }
/**
* {@inheritdoc}
*/
public function getUrl() public function getUrl()
{ {
return 'import_pinboard'; return 'import_pinboard';
} }
/**
* {@inheritdoc}
*/
public function getDescription() public function getDescription()
{ {
return 'import.pinboard.description'; return 'import.pinboard.description';
@ -44,9 +35,6 @@ class PinboardImport extends AbstractImport
return $this; return $this;
} }
/**
* {@inheritdoc}
*/
public function import() public function import()
{ {
if (!$this->user) { if (!$this->user) {
@ -80,9 +68,6 @@ class PinboardImport extends AbstractImport
return true; return true;
} }
/**
* {@inheritdoc}
*/
public function validateEntry(array $importedEntry) public function validateEntry(array $importedEntry)
{ {
if (empty($importedEntry['href'])) { if (empty($importedEntry['href'])) {
@ -92,9 +77,6 @@ class PinboardImport extends AbstractImport
return true; return true;
} }
/**
* {@inheritdoc}
*/
public function parseEntry(array $importedEntry) public function parseEntry(array $importedEntry)
{ {
$existingEntry = $this->em $existingEntry = $this->em
@ -141,9 +123,6 @@ class PinboardImport extends AbstractImport
return $entry; return $entry;
} }
/**
* {@inheritdoc}
*/
protected function setEntryAsRead(array $importedEntry) protected function setEntryAsRead(array $importedEntry)
{ {
$importedEntry['toread'] = 'no'; $importedEntry['toread'] = 'no';

View File

@ -6,33 +6,21 @@ class PocketHtmlImport extends HtmlImport
{ {
protected $filepath; protected $filepath;
/**
* {@inheritdoc}
*/
public function getName() public function getName()
{ {
return 'Pocket HTML'; return 'Pocket HTML';
} }
/**
* {@inheritdoc}
*/
public function getUrl() public function getUrl()
{ {
return 'import_pocket_html'; return 'import_pocket_html';
} }
/**
* {@inheritdoc}
*/
public function getDescription() public function getDescription()
{ {
return 'import.pocket_html.description'; return 'import.pocket_html.description';
} }
/**
* {@inheritdoc}
*/
public function validateEntry(array $importedEntry) public function validateEntry(array $importedEntry)
{ {
if (empty($importedEntry['url'])) { if (empty($importedEntry['url'])) {
@ -89,9 +77,6 @@ class PocketHtmlImport extends HtmlImport
return true; return true;
} }
/**
* {@inheritdoc}
*/
protected function prepareEntry(array $entry = []) protected function prepareEntry(array $entry = [])
{ {
$data = [ $data = [

View File

@ -32,25 +32,16 @@ class PocketImport extends AbstractImport
return $this->accessToken; return $this->accessToken;
} }
/**
* {@inheritdoc}
*/
public function getName() public function getName()
{ {
return 'Pocket'; return 'Pocket';
} }
/**
* {@inheritdoc}
*/
public function getUrl() public function getUrl()
{ {
return 'import_pocket'; return 'import_pocket';
} }
/**
* {@inheritdoc}
*/
public function getDescription() public function getDescription()
{ {
return 'import.pocket.description'; return 'import.pocket.description';
@ -105,9 +96,6 @@ class PocketImport extends AbstractImport
return true; return true;
} }
/**
* {@inheritdoc}
*/
public function import($offset = 0) public function import($offset = 0)
{ {
static $run = 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()); $this->client = new HttpMethodsClient(new PluginClient($client, [new ErrorPlugin()]), $requestFactory ?: Psr17FactoryDiscovery::findRequestFactory(), $streamFactory ?: Psr17FactoryDiscovery::findStreamFactory());
} }
/**
* {@inheritdoc}
*/
public function validateEntry(array $importedEntry) public function validateEntry(array $importedEntry)
{ {
if (empty($importedEntry['resolved_url']) && empty($importedEntry['given_url'])) { 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 * @see https://getpocket.com/developer/docs/v3/retrieve
*/ */
public function parseEntry(array $importedEntry) public function parseEntry(array $importedEntry)
@ -233,9 +216,6 @@ class PocketImport extends AbstractImport
return $entry; return $entry;
} }
/**
* {@inheritdoc}
*/
protected function setEntryAsRead(array $importedEntry) protected function setEntryAsRead(array $importedEntry)
{ {
$importedEntry['status'] = '1'; $importedEntry['status'] = '1';

View File

@ -8,25 +8,16 @@ class ReadabilityImport extends AbstractImport
{ {
private $filepath; private $filepath;
/**
* {@inheritdoc}
*/
public function getName() public function getName()
{ {
return 'Readability'; return 'Readability';
} }
/**
* {@inheritdoc}
*/
public function getUrl() public function getUrl()
{ {
return 'import_readability'; return 'import_readability';
} }
/**
* {@inheritdoc}
*/
public function getDescription() public function getDescription()
{ {
return 'import.readability.description'; return 'import.readability.description';
@ -44,9 +35,6 @@ class ReadabilityImport extends AbstractImport
return $this; return $this;
} }
/**
* {@inheritdoc}
*/
public function import() public function import()
{ {
if (!$this->user) { if (!$this->user) {
@ -80,9 +68,6 @@ class ReadabilityImport extends AbstractImport
return true; return true;
} }
/**
* {@inheritdoc}
*/
public function validateEntry(array $importedEntry) public function validateEntry(array $importedEntry)
{ {
if (empty($importedEntry['article__url'])) { if (empty($importedEntry['article__url'])) {
@ -92,9 +77,6 @@ class ReadabilityImport extends AbstractImport
return true; return true;
} }
/**
* {@inheritdoc}
*/
public function parseEntry(array $importedEntry) public function parseEntry(array $importedEntry)
{ {
$existingEntry = $this->em $existingEntry = $this->em
@ -133,9 +115,6 @@ class ReadabilityImport extends AbstractImport
return $entry; return $entry;
} }
/**
* {@inheritdoc}
*/
protected function setEntryAsRead(array $importedEntry) protected function setEntryAsRead(array $importedEntry)
{ {
$importedEntry['archive'] = 1; $importedEntry['archive'] = 1;

View File

@ -6,33 +6,21 @@ class ShaarliImport extends HtmlImport
{ {
protected $filepath; protected $filepath;
/**
* {@inheritdoc}
*/
public function getName() public function getName()
{ {
return 'Shaarli'; return 'Shaarli';
} }
/**
* {@inheritdoc}
*/
public function getUrl() public function getUrl()
{ {
return 'import_shaarli'; return 'import_shaarli';
} }
/**
* {@inheritdoc}
*/
public function getDescription() public function getDescription()
{ {
return 'import.shaarli.description'; return 'import.shaarli.description';
} }
/**
* {@inheritdoc}
*/
public function validateEntry(array $importedEntry) public function validateEntry(array $importedEntry)
{ {
if (empty($importedEntry['url'])) { if (empty($importedEntry['url'])) {
@ -42,9 +30,6 @@ class ShaarliImport extends HtmlImport
return true; return true;
} }
/**
* {@inheritdoc}
*/
protected function prepareEntry(array $entry = []) protected function prepareEntry(array $entry = [])
{ {
$data = [ $data = [

View File

@ -23,24 +23,12 @@ abstract class WallabagImport extends AbstractImport
'', '',
]; ];
/**
* {@inheritdoc}
*/
abstract public function getName(); abstract public function getName();
/**
* {@inheritdoc}
*/
abstract public function getUrl(); abstract public function getUrl();
/**
* {@inheritdoc}
*/
abstract public function getDescription(); abstract public function getDescription();
/**
* {@inheritdoc}
*/
public function import() public function import()
{ {
if (!$this->user) { if (!$this->user) {
@ -86,9 +74,6 @@ abstract class WallabagImport extends AbstractImport
return $this; return $this;
} }
/**
* {@inheritdoc}
*/
public function validateEntry(array $importedEntry) public function validateEntry(array $importedEntry)
{ {
if (empty($importedEntry['url'])) { if (empty($importedEntry['url'])) {
@ -98,9 +83,6 @@ abstract class WallabagImport extends AbstractImport
return true; return true;
} }
/**
* {@inheritdoc}
*/
public function parseEntry(array $importedEntry) public function parseEntry(array $importedEntry)
{ {
$existingEntry = $this->em $existingEntry = $this->em

View File

@ -21,33 +21,21 @@ class WallabagV1Import extends WallabagImport
parent::__construct($em, $contentProxy, $tagsAssigner, $eventDispatcher, $logger); parent::__construct($em, $contentProxy, $tagsAssigner, $eventDispatcher, $logger);
} }
/**
* {@inheritdoc}
*/
public function getName() public function getName()
{ {
return 'wallabag v1'; return 'wallabag v1';
} }
/**
* {@inheritdoc}
*/
public function getUrl() public function getUrl()
{ {
return 'import_wallabag_v1'; return 'import_wallabag_v1';
} }
/**
* {@inheritdoc}
*/
public function getDescription() public function getDescription()
{ {
return 'import.wallabag_v1.description'; return 'import.wallabag_v1.description';
} }
/**
* {@inheritdoc}
*/
protected function prepareEntry($entry = []) protected function prepareEntry($entry = [])
{ {
$data = [ $data = [
@ -75,9 +63,6 @@ class WallabagV1Import extends WallabagImport
return $data; return $data;
} }
/**
* {@inheritdoc}
*/
protected function setEntryAsRead(array $importedEntry) protected function setEntryAsRead(array $importedEntry)
{ {
$importedEntry['is_read'] = 1; $importedEntry['is_read'] = 1;

View File

@ -4,33 +4,21 @@ namespace Wallabag\ImportBundle\Import;
class WallabagV2Import extends WallabagImport class WallabagV2Import extends WallabagImport
{ {
/**
* {@inheritdoc}
*/
public function getName() public function getName()
{ {
return 'wallabag v2'; return 'wallabag v2';
} }
/**
* {@inheritdoc}
*/
public function getUrl() public function getUrl()
{ {
return 'import_wallabag_v2'; return 'import_wallabag_v2';
} }
/**
* {@inheritdoc}
*/
public function getDescription() public function getDescription()
{ {
return 'import.wallabag_v2.description'; return 'import.wallabag_v2.description';
} }
/**
* {@inheritdoc}
*/
protected function prepareEntry($entry = []) protected function prepareEntry($entry = [])
{ {
return [ return [
@ -43,9 +31,6 @@ class WallabagV2Import extends WallabagImport
] + $entry; ] + $entry;
} }
/**
* {@inheritdoc}
*/
protected function setEntryAsRead(array $importedEntry) protected function setEntryAsRead(array $importedEntry)
{ {
$importedEntry['is_archived'] = 1; $importedEntry['is_archived'] = 1;

View File

@ -10,7 +10,6 @@ use Pagerfanta\Doctrine\ORM\QueryAdapter as DoctrineORMAdapter;
use Pagerfanta\Exception\OutOfRangeCurrentPageException; use Pagerfanta\Exception\OutOfRangeCurrentPageException;
use Pagerfanta\Pagerfanta; use Pagerfanta\Pagerfanta;
use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface; use Scheb\TwoFactorBundle\Security\TwoFactor\Provider\Google\GoogleAuthenticatorInterface;
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
use Symfony\Component\EventDispatcher\EventDispatcherInterface; use Symfony\Component\EventDispatcher\EventDispatcherInterface;
use Symfony\Component\Form\Form; use Symfony\Component\Form\Form;
use Symfony\Component\Form\FormInterface; use Symfony\Component\Form\FormInterface;
@ -18,6 +17,7 @@ use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
use Symfony\Component\Routing\Annotation\Route; use Symfony\Component\Routing\Annotation\Route;
use Symfony\Contracts\Translation\TranslatorInterface; use Symfony\Contracts\Translation\TranslatorInterface;
use Wallabag\CoreBundle\Controller\AbstractController;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
use Wallabag\UserBundle\Form\NewUserType; use Wallabag\UserBundle\Form\NewUserType;
use Wallabag\UserBundle\Form\SearchUserType; use Wallabag\UserBundle\Form\SearchUserType;

View File

@ -8,9 +8,6 @@ use Wallabag\UserBundle\Entity\User;
class UserFixtures extends Fixture class UserFixtures extends Fixture
{ {
/**
* {@inheritdoc}
*/
public function load(ObjectManager $manager) public function load(ObjectManager $manager)
{ {
$userAdmin = new User(); $userAdmin = new User();

View File

@ -252,8 +252,6 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI
/** /**
* Set config. * Set config.
* *
* @param Config $config
*
* @return User * @return User
*/ */
public function setConfig(Config $config = null) public function setConfig(Config $config = null)
@ -297,65 +295,41 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI
return $this->isGoogleAuthenticatorEnabled(); return $this->isGoogleAuthenticatorEnabled();
} }
/**
* {@inheritdoc}
*/
public function isEmailAuthEnabled(): bool public function isEmailAuthEnabled(): bool
{ {
return $this->emailTwoFactor; return $this->emailTwoFactor;
} }
/**
* {@inheritdoc}
*/
public function getEmailAuthCode(): string public function getEmailAuthCode(): string
{ {
return $this->authCode; return $this->authCode;
} }
/**
* {@inheritdoc}
*/
public function setEmailAuthCode(string $authCode): void public function setEmailAuthCode(string $authCode): void
{ {
$this->authCode = $authCode; $this->authCode = $authCode;
} }
/**
* {@inheritdoc}
*/
public function getEmailAuthRecipient(): string public function getEmailAuthRecipient(): string
{ {
return $this->email; return $this->email;
} }
/**
* {@inheritdoc}
*/
public function isGoogleAuthenticatorEnabled(): bool public function isGoogleAuthenticatorEnabled(): bool
{ {
return $this->googleAuthenticatorSecret ? true : false; return $this->googleAuthenticatorSecret ? true : false;
} }
/**
* {@inheritdoc}
*/
public function getGoogleAuthenticatorUsername(): string public function getGoogleAuthenticatorUsername(): string
{ {
return $this->username; return $this->username;
} }
/**
* {@inheritdoc}
*/
public function getGoogleAuthenticatorSecret(): string public function getGoogleAuthenticatorSecret(): string
{ {
return $this->googleAuthenticatorSecret; return $this->googleAuthenticatorSecret;
} }
/**
* {@inheritdoc}
*/
public function setGoogleAuthenticatorSecret(?string $googleAuthenticatorSecret): void public function setGoogleAuthenticatorSecret(?string $googleAuthenticatorSecret): void
{ {
$this->googleAuthenticatorSecret = $googleAuthenticatorSecret; $this->googleAuthenticatorSecret = $googleAuthenticatorSecret;
@ -371,17 +345,11 @@ class User extends BaseUser implements EmailTwoFactorInterface, GoogleTwoFactorI
return $this->backupCodes; return $this->backupCodes;
} }
/**
* {@inheritdoc}
*/
public function isBackupCode(string $code): bool public function isBackupCode(string $code): bool
{ {
return false === $this->findBackupCode($code) ? false : true; return false === $this->findBackupCode($code) ? false : true;
} }
/**
* {@inheritdoc}
*/
public function invalidateBackupCode(string $code): void public function invalidateBackupCode(string $code): void
{ {
$key = $this->findBackupCode($code); $key = $this->findBackupCode($code);

View File

@ -18,9 +18,6 @@ class AuthenticationFailureListener implements EventSubscriberInterface
$this->logger = $logger; $this->logger = $logger;
} }
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() public static function getSubscribedEvents()
{ {
return [ return [

View File

@ -22,9 +22,6 @@ class PasswordResettingListener implements EventSubscriberInterface
$this->router = $router; $this->router = $router;
} }
/**
* {@inheritdoc}
*/
public static function getSubscribedEvents() public static function getSubscribedEvents()
{ {
return [ return [

View File

@ -4,19 +4,15 @@ namespace Tests\Wallabag\AnnotationBundle;
use FOS\UserBundle\Model\UserInterface; use FOS\UserBundle\Model\UserInterface;
use FOS\UserBundle\Model\UserManager; use FOS\UserBundle\Model\UserManager;
use FOS\UserBundle\Security\LoginManager;
use Symfony\Bundle\FrameworkBundle\KernelBrowser; use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\BrowserKit\Cookie;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
abstract class WallabagAnnotationTestCase extends WebTestCase abstract class WallabagAnnotationTestCase extends WebTestCase
{ {
/** /**
* @var KernelBrowser * @var KernelBrowser
*/ */
protected $client = null; protected $client;
/** /**
* @var UserInterface * @var UserInterface
@ -51,19 +47,11 @@ abstract class WallabagAnnotationTestCase extends WebTestCase
/** @var UserManager $userManager */ /** @var UserManager $userManager */
$userManager = $container->get('fos_user.user_manager.test'); $userManager = $container->get('fos_user.user_manager.test');
/** @var LoginManager $loginManager */
$loginManager = $container->get('fos_user.security.login_manager.test');
$firewallName = $container->getParameter('fos_user.firewall_name'); $firewallName = $container->getParameter('fos_user.firewall_name');
$this->user = $userManager->findUserBy(['username' => 'admin']); $this->user = $userManager->findUserBy(['username' => 'admin']);
$loginManager->logInUser($firewallName, $this->user);
// save the login token into the session and put it in a cookie $client->loginUser($this->user, $firewallName);
$container->get(SessionInterface::class)->set('_security_' . $firewallName, serialize($container->get(TokenStorageInterface::class)->getToken()));
$container->get(SessionInterface::class)->save();
$session = $container->get(SessionInterface::class);
$client->getCookieJar()->set(new Cookie($session->getName(), $session->getId()));
return $client; return $client;
} }

View File

@ -5,12 +5,8 @@ namespace Tests\Wallabag\ApiBundle;
use Doctrine\ORM\EntityManagerInterface; use Doctrine\ORM\EntityManagerInterface;
use FOS\UserBundle\Model\UserInterface; use FOS\UserBundle\Model\UserInterface;
use FOS\UserBundle\Model\UserManager; use FOS\UserBundle\Model\UserManager;
use FOS\UserBundle\Security\LoginManager;
use Symfony\Bundle\FrameworkBundle\KernelBrowser; use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\BrowserKit\Cookie;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
abstract class WallabagApiTestCase extends WebTestCase abstract class WallabagApiTestCase extends WebTestCase
@ -18,7 +14,7 @@ abstract class WallabagApiTestCase extends WebTestCase
/** /**
* @var KernelBrowser * @var KernelBrowser
*/ */
protected $client = null; protected $client;
/** /**
* @var UserInterface * @var UserInterface
@ -51,19 +47,11 @@ abstract class WallabagApiTestCase extends WebTestCase
/** @var UserManager $userManager */ /** @var UserManager $userManager */
$userManager = $container->get('fos_user.user_manager.test'); $userManager = $container->get('fos_user.user_manager.test');
/** @var LoginManager $loginManager */
$loginManager = $container->get('fos_user.security.login_manager.test');
$firewallName = $container->getParameter('fos_user.firewall_name'); $firewallName = $container->getParameter('fos_user.firewall_name');
$this->user = $userManager->findUserBy(['username' => 'admin']); $this->user = $userManager->findUserBy(['username' => 'admin']);
$loginManager->logInUser($firewallName, $this->user);
// save the login token into the session and put it in a cookie $client->loginUser($this->user, $firewallName);
$container->get(SessionInterface::class)->set('_security_' . $firewallName, serialize($container->get(TokenStorageInterface::class)->getToken()));
$container->get(SessionInterface::class)->save();
$session = $container->get(SessionInterface::class);
$client->getCookieJar()->set(new Cookie($session->getName(), $session->getId()));
return $client; return $client;
} }

View File

@ -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'; 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; public $adminEntry;

View File

@ -36,7 +36,7 @@ class FeedControllerTest extends WallabagCoreTestCase
$this->assertSame('admin', $xpath->query('/a:feed/a:author/a:name')->item(0)->nodeValue); $this->assertSame('admin', $xpath->query('/a:feed/a:author/a:name')->item(0)->nodeValue);
$this->assertSame(1, $xpath->query('/a:feed/a:subtitle')->length); $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('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); $this->assertSame('Atom feed for entries tagged with ' . $tagValue, $xpath->query('/a:feed/a:subtitle')->item(0)->nodeValue);
} else { } else {

View File

@ -437,7 +437,7 @@ class ContentProxyTest extends TestCase
$ruleBasedIgnoreOriginProcessor->expects($this->once()) $ruleBasedIgnoreOriginProcessor->expects($this->once())
->method('process'); ->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()); $entry = new Entry(new User());
$proxy->updateEntry( $proxy->updateEntry(
$entry, $entry,
@ -483,7 +483,7 @@ class ContentProxyTest extends TestCase
$logHandler = new TestHandler(); $logHandler = new TestHandler();
$logger = new Logger('test', [$logHandler]); $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()); $entry = new Entry(new User());
$proxy->updateEntry( $proxy->updateEntry(
$entry, $entry,
@ -523,7 +523,7 @@ class ContentProxyTest extends TestCase
$handler = new TestHandler(); $handler = new TestHandler();
$logger->pushHandler($handler); $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()); $entry = new Entry(new User());
$proxy->updateEntry( $proxy->updateEntry(
$entry, $entry,
@ -565,7 +565,7 @@ class ContentProxyTest extends TestCase
$ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock(); $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()); $entry = new Entry(new User());
$proxy->updateEntry( $proxy->updateEntry(
$entry, $entry,
@ -609,7 +609,7 @@ class ContentProxyTest extends TestCase
$ruleBasedIgnoreOriginProcessor = $this->getRuleBasedIgnoreOriginProcessorMock(); $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()); $entry = new Entry(new User());
$proxy->updateEntry( $proxy->updateEntry(
$entry, $entry,
@ -620,7 +620,7 @@ class ContentProxyTest extends TestCase
'url' => 'http://1.1.1.1', 'url' => 'http://1.1.1.1',
'language' => 'fr', 'language' => 'fr',
'status' => '200', 'status' => '200',
//'og_title' => 'my OG title', // 'og_title' => 'my OG title',
'description' => 'OG desc', 'description' => 'OG desc',
'image' => 'http://3.3.3.3/cover.jpg', 'image' => 'http://3.3.3.3/cover.jpg',
'headers' => [ 'headers' => [
@ -1043,7 +1043,7 @@ class ContentProxyTest extends TestCase
->method('process') ->method('process')
->willReturn($processor_result); ->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 = new Entry(new User());
$entry->setOriginUrl($origin_url); $entry->setOriginUrl($origin_url);
$proxy->updateEntry( $proxy->updateEntry(
@ -1069,8 +1069,6 @@ class ContentProxyTest extends TestCase
/** /**
* https://stackoverflow.com/a/18506801. * https://stackoverflow.com/a/18506801.
* *
* @param $string
*
* @return string * @return string
*/ */
private function strToHex($string) private function strToHex($string)
@ -1090,8 +1088,6 @@ class ContentProxyTest extends TestCase
* *
* @see https://stackoverflow.com/a/18506801 * @see https://stackoverflow.com/a/18506801
* *
* @param $hex
*
* @return string * @return string
*/ */
private function hexToStr($hex) private function hexToStr($hex)

View File

@ -61,8 +61,8 @@ class DownloadImagesTest extends TestCase
public function singleImage() public function singleImage()
{ {
return [ return [
['image/pjpeg', 'jpeg'], ['image/pjpeg', 'jpg'],
['image/jpeg', 'jpeg'], ['image/jpeg', 'jpg'],
['image/png', 'png'], ['image/png', 'png'],
['image/gif', 'gif'], ['image/gif', 'gif'],
['image/webp', 'webp'], ['image/webp', 'webp'],

View File

@ -6,10 +6,8 @@ use Doctrine\ORM\EntityManagerInterface;
use Symfony\Bundle\FrameworkBundle\Console\Application; use Symfony\Bundle\FrameworkBundle\Console\Application;
use Symfony\Bundle\FrameworkBundle\KernelBrowser; use Symfony\Bundle\FrameworkBundle\KernelBrowser;
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase; use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
use Symfony\Component\BrowserKit\Cookie;
use Symfony\Component\Console\Input\ArrayInput; use Symfony\Component\Console\Input\ArrayInput;
use Symfony\Component\Console\Output\NullOutput; use Symfony\Component\Console\Output\NullOutput;
use Symfony\Component\HttpFoundation\Session\SessionInterface;
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface; use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
use Wallabag\UserBundle\Entity\User; use Wallabag\UserBundle\Entity\User;
@ -18,7 +16,7 @@ abstract class WallabagCoreTestCase extends WebTestCase
/** /**
* @var KernelBrowser|null * @var KernelBrowser|null
*/ */
private $client = null; private $client;
protected function setUp(): void protected function setUp(): void
{ {
@ -88,10 +86,8 @@ abstract class WallabagCoreTestCase extends WebTestCase
public function logInAs($username) public function logInAs($username)
{ {
$container = $this->client->getContainer(); $container = $this->client->getContainer();
$session = $container->get(SessionInterface::class);
$userManager = $container->get('fos_user.user_manager.test'); $userManager = $container->get('fos_user.user_manager.test');
$loginManager = $container->get('fos_user.security.login_manager.test');
$firewallName = $container->getParameter('fos_user.firewall_name'); $firewallName = $container->getParameter('fos_user.firewall_name');
$user = $userManager->findUserBy(['username' => $username]); $user = $userManager->findUserBy(['username' => $username]);
@ -100,13 +96,7 @@ abstract class WallabagCoreTestCase extends WebTestCase
throw new \Exception('Unable to find user "' . $username . '". Does fixtures were loaded?'); throw new \Exception('Unable to find user "' . $username . '". Does fixtures were loaded?');
} }
$loginManager->logInUser($firewallName, $user); $this->client->loginUser($user, $firewallName);
$session->set('_security_' . $firewallName, serialize($container->get(TokenStorageInterface::class)->getToken()));
$session->save();
$cookie = new Cookie($session->getName(), $session->getId());
$this->client->getCookieJar()->set($cookie);
} }
/** /**

View File

@ -190,7 +190,7 @@ class PocketImportTest extends TestCase
} }
} }
JSON JSON
)); ));
$pocketImport = $this->getPocketImport('ConsumerKey', 1); $pocketImport = $this->getPocketImport('ConsumerKey', 1);
@ -280,7 +280,7 @@ JSON
} }
} }
JSON JSON
)); ));
$pocketImport = $this->getPocketImport('ConsumerKey', 2); $pocketImport = $this->getPocketImport('ConsumerKey', 2);