mirror of
https://github.com/wallabag/wallabag.git
synced 2024-11-22 17:11:07 +00:00
Cleanup
This commit is contained in:
parent
af6363bbbd
commit
b7dba18cb2
41 changed files with 285 additions and 950 deletions
|
@ -1,55 +1,10 @@
|
|||
parameters:
|
||||
ignoreErrors:
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagAnnotationBundle\\:Annotation\\>\\:\\:findAnnotationsByPageId\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/AnnotationBundle/Controller/WallabagAnnotationController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagApiBundle\\:Client\\>\\:\\:findByUser\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ApiBundle/Controller/DeveloperController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagCoreBundle\\:Entry\\>\\:\\:findByUserIdAndBatchHashedUrls\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ApiBundle/Controller/EntryRestController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagCoreBundle\\:Tag\\>\\:\\:findOneByLabel\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ApiBundle/Controller/EntryRestController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Psr\\\\Container\\\\ContainerInterface\\:\\:getParameter\\(\\)\\.$#"
|
||||
count: 2
|
||||
path: src/Wallabag/ApiBundle/Controller/EntryRestController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagCoreBundle\\:Entry\\>\\:\\:removeTag\\(\\)\\.$#"
|
||||
count: 2
|
||||
path: src/Wallabag/ApiBundle/Controller/TagRestController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagCoreBundle\\:Entry\\>\\:\\:removeTags\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ApiBundle/Controller/TagRestController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagCoreBundle\\:Tag\\>\\:\\:findAllTags\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ApiBundle/Controller/TagRestController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagCoreBundle\\:Tag\\>\\:\\:findByLabelsAndUser\\(\\)\\.$#"
|
||||
count: 3
|
||||
path: src/Wallabag/ApiBundle/Controller/TagRestController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method FOS\\\\UserBundle\\\\Model\\\\UserInterface\\:\\:addClient\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ApiBundle/Controller/UserRestController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Psr\\\\Container\\\\ContainerInterface\\:\\:getParameter\\(\\)\\.$#"
|
||||
count: 1
|
||||
|
@ -60,471 +15,41 @@ parameters:
|
|||
count: 3
|
||||
path: src/Wallabag/ApiBundle/Controller/WallabagRestController.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method getId\\(\\) on string\\|Stringable\\|Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\.$#"
|
||||
count: 2
|
||||
path: src/Wallabag/ApiBundle/Controller/WallabagRestController.php
|
||||
|
||||
-
|
||||
message: "#^Property Wallabag\\\\ApiBundle\\\\Entity\\\\AccessToken\\:\\:\\$client has unknown class FOS\\\\OAuthServerBundle\\\\Entity\\\\ClientInterface as its type\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ApiBundle/Entity/AccessToken.php
|
||||
|
||||
-
|
||||
message: "#^Property Wallabag\\\\ApiBundle\\\\Entity\\\\AccessToken\\:\\:\\$user has unknown class FOS\\\\OAuthServerBundle\\\\Entity\\\\UserInterface as its type\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ApiBundle/Entity/AccessToken.php
|
||||
|
||||
-
|
||||
message: "#^Property Wallabag\\\\ApiBundle\\\\Entity\\\\AuthCode\\:\\:\\$client has unknown class FOS\\\\OAuthServerBundle\\\\Entity\\\\ClientInterface as its type\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ApiBundle/Entity/AuthCode.php
|
||||
|
||||
-
|
||||
message: "#^Property Wallabag\\\\ApiBundle\\\\Entity\\\\AuthCode\\:\\:\\$user has unknown class FOS\\\\OAuthServerBundle\\\\Entity\\\\UserInterface as its type\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ApiBundle/Entity/AuthCode.php
|
||||
|
||||
-
|
||||
message: "#^Property Wallabag\\\\ApiBundle\\\\Entity\\\\RefreshToken\\:\\:\\$client has unknown class FOS\\\\OAuthServerBundle\\\\Entity\\\\ClientInterface as its type\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ApiBundle/Entity/RefreshToken.php
|
||||
|
||||
-
|
||||
message: "#^Property Wallabag\\\\ApiBundle\\\\Entity\\\\RefreshToken\\:\\:\\$user has unknown class FOS\\\\OAuthServerBundle\\\\Entity\\\\UserInterface as its type\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ApiBundle/Entity/RefreshToken.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.entry\\.download_images\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Command/CleanDownloadedImagesCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.entry_repository\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Command/CleanDownloadedImagesCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.entry_repository\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_user\\.user_repository\" is private\\.$#"
|
||||
count: 2
|
||||
path: src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.entry_repository\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Command/ExportCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.helper\\.entries_export\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Command/ExportCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_user\\.user_repository\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Command/ExportCommand.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getConnection\\(\\)\\.$#"
|
||||
count: 5
|
||||
path: src/Wallabag/CoreBundle/Command/InstallCommand.php
|
||||
|
||||
-
|
||||
message: "#^Method Wallabag\\\\CoreBundle\\\\Command\\\\InstallCommand\\:\\:execute\\(\\) should return int\\|null but return statement is missing\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Command/InstallCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"fos_user\\.user_manager\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Command/InstallCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_user\\.user_repository\" is private\\.$#"
|
||||
count: 2
|
||||
path: src/Wallabag/CoreBundle/Command/ListUserCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.content_proxy\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Command/ReloadEntryCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.entry_repository\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Command/ReloadEntryCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_user\\.user_repository\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Command/ReloadEntryCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_user\\.user_repository\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Command/ShowUserCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.rule_based_tagger\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Command/TagAllCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_user\\.user_repository\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Command/TagAllCommand.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagAnnotationBundle\\:Annotation\\>\\:\\:findAllArchivedEntriesByUser\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagAnnotationBundle\\:Annotation\\>\\:\\:removeAllByUserId\\(\\)\\.$#"
|
||||
count: 2
|
||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagCoreBundle\\:Config\\>\\:\\:findOneByUser\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Entity\\\\RuleInterface\\:\\:getConfig\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||
|
||||
-
|
||||
message: "#^Call to method getConfig\\(\\) on an unknown class WallabagCoreBundle\\:IgnoreOriginUserRule\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||
|
||||
-
|
||||
message: "#^Call to method getConfig\\(\\) on an unknown class WallabagCoreBundle\\:TaggingRule\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||
|
||||
-
|
||||
message: "#^Call to method getId\\(\\) on an unknown class WallabagCoreBundle\\:IgnoreOriginUserRule\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||
|
||||
-
|
||||
message: "#^Call to method getId\\(\\) on an unknown class WallabagCoreBundle\\:TaggingRule\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||
|
||||
-
|
||||
message: "#^Call to method setConfig\\(\\) on an unknown class WallabagCoreBundle\\:IgnoreOriginUserRule\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||
|
||||
-
|
||||
message: "#^Call to method setConfig\\(\\) on an unknown class WallabagCoreBundle\\:TaggingRule\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"fos_user\\.user_manager\" is private\\.$#"
|
||||
count: 7
|
||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"liip_theme\\.active_theme\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.entry_repository\" is private\\.$#"
|
||||
count: 3
|
||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.tag_repository\" is private\\.$#"
|
||||
count: 2
|
||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_user\\.user_repository\" is private\\.$#"
|
||||
count: 2
|
||||
path: src/Wallabag/CoreBundle/Controller/ConfigController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Repository\\\\EntryRepository\\:\\:findById\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/EntryController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"logger\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/EntryController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.content_proxy\" is private\\.$#"
|
||||
count: 3
|
||||
path: src/Wallabag/CoreBundle/Controller/EntryController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.entry_repository\" is private\\.$#"
|
||||
count: 6
|
||||
path: src/Wallabag/CoreBundle/Controller/EntryController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.helper\\.prepare_pager_for_entries\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/EntryController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.helper\\.redirect\" is private\\.$#"
|
||||
count: 4
|
||||
path: src/Wallabag/CoreBundle/Controller/EntryController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Repository\\\\TagRepository\\:\\:findOneBySlug\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/ExportController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.entry_repository\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/ExportController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.helper\\.entries_export\" is private\\.$#"
|
||||
count: 2
|
||||
path: src/Wallabag/CoreBundle/Controller/ExportController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.tag_repository\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/ExportController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.entry_repository\" is private\\.$#"
|
||||
count: 2
|
||||
path: src/Wallabag/CoreBundle/Controller/FeedController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.helper\\.prepare_pager_for_entries\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/FeedController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.ignore_origin_instance_rule_repository\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/IgnoreOriginInstanceRuleController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Repository\\\\SiteCredentialRepository\\:\\:findByUser\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/SiteCredentialController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.helper\\.crypto_proxy\" is private\\.$#"
|
||||
count: 4
|
||||
path: src/Wallabag/CoreBundle/Controller/SiteCredentialController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.site_credential_repository\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/SiteCredentialController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Psr\\\\Container\\\\ContainerInterface\\:\\:getParameter\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/StaticController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Repository\\\\TagRepository\\:\\:findOneByLabel\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/TagController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.entry_repository\" is private\\.$#"
|
||||
count: 5
|
||||
path: src/Wallabag/CoreBundle/Controller/TagController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.helper\\.prepare_pager_for_entries\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Controller/TagController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.helper\\.redirect\" is private\\.$#"
|
||||
count: 4
|
||||
path: src/Wallabag/CoreBundle/Controller/TagController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.tag_repository\" is private\\.$#"
|
||||
count: 2
|
||||
path: src/Wallabag/CoreBundle/Controller/TagController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.tags_assigner\" is private\\.$#"
|
||||
count: 3
|
||||
path: src/Wallabag/CoreBundle/Controller/TagController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.helper\\.crypto_proxy\" is private\\.$#"
|
||||
count: 4
|
||||
path: src/Wallabag/CoreBundle/DataFixtures/SiteCredentialFixtures.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/DependencyInjection/Configuration.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method getConfig\\(\\) on string\\|Stringable\\|Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\.$#"
|
||||
count: 2
|
||||
path: src/Wallabag/CoreBundle/Event/Listener/UserLocaleListener.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Lexik\\\\Bundle\\\\FormFilterBundle\\\\Filter\\\\Query\\\\QueryInterface\\:\\:getExpressionBuilder\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Event/Subscriber/CustomDoctrineORMSubscriber.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\:\\:findDistinctLanguageByUser\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Lexik\\\\Bundle\\\\FormFilterBundle\\\\Filter\\\\Query\\\\QueryInterface\\:\\:getExpr\\(\\)\\.$#"
|
||||
count: 10
|
||||
path: src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method getConfig\\(\\) on string\\|Stringable\\|Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\.$#"
|
||||
count: 2
|
||||
path: src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method getId\\(\\) on string\\|Stringable\\|Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Form/Type/EntryFilterType.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method getConfig\\(\\) on string\\|Stringable\\|Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\.$#"
|
||||
count: 2
|
||||
path: src/Wallabag/CoreBundle/Helper/EntriesExport.php
|
||||
|
||||
-
|
||||
message: "#^PHPDoc tag @var has invalid value \\(\\[\\\\GuzzleHttp\\\\Event\\\\SubscriberInterface\\]\\)\\: Unexpected token \"\\[\", expected type at offset 9$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Helper/HttpClientFactory.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Stringable\\|Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\:\\:getConfig\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Helper/PreparePagerForEntries.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Stringable\\|Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\:\\:getConfig\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Helper/Redirect.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Repository\\\\TagRepository\\:\\:findOneByLabel\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Helper/RuleBasedTagger.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Wallabag\\\\CoreBundle\\\\Repository\\\\TagRepository\\:\\:findOneByLabel\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/Helper/TagsAssigner.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<object\\>\\:\\:findOneByUsernameAndFeedtoken\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/CoreBundle/ParamConverter/UsernameFeedTokenConverter.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Stringable\\|Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\:\\:getConfig\\(\\)\\.$#"
|
||||
count: 2
|
||||
path: src/Wallabag/CoreBundle/Twig/WallabagExtension.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Stringable\\|Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\:\\:getCreatedAt\\(\\)\\.$#"
|
||||
count: 2
|
||||
path: src/Wallabag/CoreBundle/Twig/WallabagExtension.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Stringable\\|Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\:\\:getId\\(\\)\\.$#"
|
||||
count: 7
|
||||
path: src/Wallabag/CoreBundle/Twig/WallabagExtension.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagUserBundle\\:User\\>\\:\\:findOneById\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Command/ImportCommand.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagUserBundle\\:User\\>\\:\\:findOneByUsername\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Command/ImportCommand.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\Persistence\\\\ObjectManager\\:\\:getConnection\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Command/ImportCommand.php
|
||||
|
||||
-
|
||||
message: "#^Method Wallabag\\\\ImportBundle\\\\Command\\\\ImportCommand\\:\\:execute\\(\\) should return int\\|null but return statement is missing\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Command/ImportCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.chrome\\.import\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Command/ImportCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.delicious\\.import\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Command/ImportCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.firefox\\.import\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Command/ImportCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.instapaper\\.import\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Command/ImportCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.pinboard\\.import\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Command/ImportCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.readability\\.import\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Command/ImportCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.wallabag_v1\\.import\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Command/ImportCommand.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.wallabag_v2\\.import\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Command/ImportCommand.php
|
||||
|
||||
-
|
||||
message: "#^Method Wallabag\\\\ImportBundle\\\\Command\\\\RedisWorkerCommand\\:\\:execute\\(\\) should return int\\|null but return statement is missing\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Command/RedisWorkerCommand.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setFilepath\\(\\)\\.$#"
|
||||
count: 1
|
||||
|
@ -535,96 +60,6 @@ parameters:
|
|||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/BrowserController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.chrome\\.import\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/ChromeController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.producer\\.redis\\.chrome\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/ChromeController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.delicious\\.import\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/DeliciousController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.producer\\.redis\\.delicious\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/DeliciousController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.elcurator\\.import\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/ElcuratorController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.producer\\.redis\\.elcurator\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/ElcuratorController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.firefox\\.import\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/FirefoxController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.producer\\.redis\\.firefox\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/FirefoxController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_core\\.redis\\.client\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/ImportController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.chain\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/ImportController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.instapaper\\.import\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/InstapaperController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.producer\\.redis\\.instapaper\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/InstapaperController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.pinboard\\.import\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/PinboardController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.producer\\.redis\\.pinboard\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/PinboardController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.pocket\\.import\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/PocketController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.producer\\.redis\\.pocket\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/PocketController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.producer\\.redis\\.readability\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/ReadabilityController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.readability\\.import\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/ReadabilityController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Wallabag\\\\ImportBundle\\\\Import\\\\ImportInterface\\:\\:setFilepath\\(\\)\\.$#"
|
||||
count: 1
|
||||
|
@ -635,186 +70,16 @@ parameters:
|
|||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/WallabagController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.producer\\.redis\\.wallabag_v1\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.wallabag_v1\\.import\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/WallabagV1Controller.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.producer\\.redis\\.wallabag_v2\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php
|
||||
|
||||
-
|
||||
message: "#^Service \"wallabag_import\\.wallabag_v2\\.import\" is private\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/Controller/WallabagV2Controller.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/ImportBundle/DependencyInjection/Configuration.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagUserBundle\\:User\\>\\:\\:getQueryBuilderForSearch\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/UserBundle/Controller/ManageController.php
|
||||
|
||||
-
|
||||
message: "#^Service \"fos_user\\.user_manager\" is private\\.$#"
|
||||
count: 2
|
||||
path: src/Wallabag/UserBundle/Controller/ManageController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Psr\\\\Container\\\\ContainerInterface\\:\\:getParameter\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/UserBundle/Controller/RegistrationController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Psr\\\\Container\\\\ContainerInterface\\:\\:getParameter\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/UserBundle/Controller/SecurityController.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Symfony\\\\Component\\\\Config\\\\Definition\\\\Builder\\\\NodeDefinition\\:\\:children\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: src/Wallabag/UserBundle/DependencyInjection/Configuration.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Scheb\\\\TwoFactorBundle\\\\Model\\\\Email\\\\TwoFactorInterface\\:\\:getName\\(\\)\\.$#"
|
||||
count: 2
|
||||
path: src/Wallabag/UserBundle/Mailer/AuthCodeMailer.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagAnnotationBundle\\:Annotation\\>\\:\\:findAnnotationById\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagAnnotationBundle\\:Annotation\\>\\:\\:findLastAnnotationByPageId\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagAnnotationBundle\\:Annotation\\>\\:\\:findOneById\\(\\)\\.$#"
|
||||
count: 2
|
||||
path: tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagCoreBundle\\:Entry\\>\\:\\:findOneByUsernameAndNotArchived\\(\\)\\.$#"
|
||||
count: 7
|
||||
path: tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagUserBundle\\:User\\>\\:\\:findOneByUserName\\(\\)\\.$#"
|
||||
count: 3
|
||||
path: tests/Wallabag/AnnotationBundle/Controller/AnnotationControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^PHPDoc tag @var has invalid value \\(\\$loginManager \\\\FOS\\\\UserBundle\\\\Security\\\\LoginManager\\)\\: Unexpected token \"\\$loginManager\", expected type at offset 9$#"
|
||||
count: 1
|
||||
path: tests/Wallabag/AnnotationBundle/WallabagAnnotationTestCase.php
|
||||
|
||||
-
|
||||
message: "#^PHPDoc tag @var has invalid value \\(\\$userManager \\\\FOS\\\\UserBundle\\\\Doctrine\\\\UserManager\\)\\: Unexpected token \"\\$userManager\", expected type at offset 9$#"
|
||||
count: 1
|
||||
path: tests/Wallabag/AnnotationBundle/WallabagAnnotationTestCase.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagCoreBundle\\:Entry\\>\\:\\:findByUrlAndUserId\\(\\)\\.$#"
|
||||
count: 3
|
||||
path: tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagCoreBundle\\:Entry\\>\\:\\:findOneByUser\\(\\)\\.$#"
|
||||
count: 7
|
||||
path: tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagCoreBundle\\:Entry\\>\\:\\:findOneWithTags\\(\\)\\.$#"
|
||||
count: 2
|
||||
path: tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to method getId\\(\\) on an unknown class WallabagCoreBundle\\:Entry\\.$#"
|
||||
count: 10
|
||||
path: tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to method getOriginUrl\\(\\) on an unknown class WallabagCoreBundle\\:Entry\\.$#"
|
||||
count: 1
|
||||
path: tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to method getTags\\(\\) on an unknown class WallabagCoreBundle\\:Entry\\.$#"
|
||||
count: 3
|
||||
path: tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to method getTitle\\(\\) on an unknown class WallabagCoreBundle\\:Entry\\.$#"
|
||||
count: 4
|
||||
path: tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to method getUrl\\(\\) on an unknown class WallabagCoreBundle\\:Entry\\.$#"
|
||||
count: 3
|
||||
path: tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to method getUserEmail\\(\\) on an unknown class WallabagCoreBundle\\:Entry\\.$#"
|
||||
count: 1
|
||||
path: tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to method getUserId\\(\\) on an unknown class WallabagCoreBundle\\:Entry\\.$#"
|
||||
count: 1
|
||||
path: tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to method getUserName\\(\\) on an unknown class WallabagCoreBundle\\:Entry\\.$#"
|
||||
count: 1
|
||||
path: tests/Wallabag/ApiBundle/Controller/EntryRestControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagCoreBundle\\:Entry\\>\\:\\:findAllByTagId\\(\\)\\.$#"
|
||||
count: 4
|
||||
path: tests/Wallabag/ApiBundle/Controller/TagRestControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagCoreBundle\\:Entry\\>\\:\\:findOneWithTags\\(\\)\\.$#"
|
||||
count: 3
|
||||
path: tests/Wallabag/ApiBundle/Controller/TagRestControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagCoreBundle\\:Tag\\>\\:\\:findOneByLabel\\(\\)\\.$#"
|
||||
count: 2
|
||||
path: tests/Wallabag/ApiBundle/Controller/TagRestControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method Doctrine\\\\ORM\\\\EntityRepository\\<WallabagUserBundle\\:User\\>\\:\\:findOneByUserName\\(\\)\\.$#"
|
||||
count: 1
|
||||
path: tests/Wallabag/ApiBundle/WallabagApiTestCase.php
|
||||
|
||||
-
|
||||
message: "#^PHPDoc tag @var has invalid value \\(\\$loginManager \\\\FOS\\\\UserBundle\\\\Security\\\\LoginManager\\)\\: Unexpected token \"\\$loginManager\", expected type at offset 9$#"
|
||||
count: 1
|
||||
path: tests/Wallabag/ApiBundle/WallabagApiTestCase.php
|
||||
|
||||
-
|
||||
message: "#^PHPDoc tag @var has invalid value \\(\\$userManager \\\\FOS\\\\UserBundle\\\\Doctrine\\\\UserManager\\)\\: Unexpected token \"\\$userManager\", expected type at offset 9$#"
|
||||
count: 1
|
||||
path: tests/Wallabag/ApiBundle/WallabagApiTestCase.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method getId\\(\\) on string\\|Stringable\\|Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\.$#"
|
||||
count: 9
|
||||
path: tests/Wallabag/CoreBundle/Controller/ConfigControllerTest.php
|
||||
|
||||
-
|
||||
message: "#^Call to an undefined method DOMNode\\:\\:getAttribute\\(\\)\\.$#"
|
||||
count: 1
|
||||
|
@ -825,11 +90,6 @@ parameters:
|
|||
count: 2
|
||||
path: tests/Wallabag/CoreBundle/Helper/RedirectTest.php
|
||||
|
||||
-
|
||||
message: "#^Cannot call method getConfig\\(\\) on string\\|Stringable\\|Symfony\\\\Component\\\\Security\\\\Core\\\\User\\\\UserInterface\\.$#"
|
||||
count: 3
|
||||
path: tests/Wallabag/CoreBundle/Helper/RedirectTest.php
|
||||
|
||||
-
|
||||
message: "#^Property Tests\\\\Wallabag\\\\CoreBundle\\\\Helper\\\\RedirectTest\\:\\:\\$routerMock has unknown class PHPUnit_Framework_MockObject_MockObject as its type\\.$#"
|
||||
count: 1
|
||||
|
|
|
@ -14,3 +14,6 @@ parameters:
|
|||
- vendor/bin/.phpunit/phpunit-8.5-0/vendor/autoload.php
|
||||
|
||||
inferPrivatePropertyTypeFromConstructor: true
|
||||
|
||||
ignoreErrors:
|
||||
- '#^Service ".+" is private\.?#'
|
||||
|
|
|
@ -52,7 +52,7 @@ class WallabagAnnotationController extends AbstractFOSRestController
|
|||
{
|
||||
$data = json_decode($request->getContent(), true);
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$annotation = new Annotation($this->getUser());
|
||||
$annotation->setEntry($entry);
|
||||
|
||||
|
@ -95,7 +95,7 @@ class WallabagAnnotationController extends AbstractFOSRestController
|
|||
$form->submit($data);
|
||||
|
||||
if ($form->isValid()) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($annotation);
|
||||
$em->flush();
|
||||
|
||||
|
@ -119,7 +119,7 @@ class WallabagAnnotationController extends AbstractFOSRestController
|
|||
*/
|
||||
public function deleteAnnotationAction(Annotation $annotation)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->remove($annotation);
|
||||
$em->flush();
|
||||
|
||||
|
|
|
@ -9,6 +9,8 @@ use Wallabag\AnnotationBundle\Entity\Annotation;
|
|||
|
||||
/**
|
||||
* AnnotationRepository.
|
||||
*
|
||||
* @method Annotation|null findOneById(int $id)
|
||||
*/
|
||||
class AnnotationRepository extends ServiceEntityRepository
|
||||
{
|
||||
|
|
|
@ -23,7 +23,7 @@ class DeveloperController extends Controller
|
|||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
$clients = $this->getDoctrine()->getRepository(Client::class)->findByUser($this->getUser()->getId());
|
||||
$clients = $this->get('doctrine')->getRepository(Client::class)->findByUser($this->getUser()->getId());
|
||||
|
||||
return $this->render('@WallabagCore/Developer/index.html.twig', [
|
||||
'clients' => $clients,
|
||||
|
@ -39,7 +39,7 @@ class DeveloperController extends Controller
|
|||
*/
|
||||
public function createClientAction(Request $request)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$client = new Client($this->getUser());
|
||||
$clientForm = $this->createForm(ClientType::class, $client);
|
||||
$clientForm->handleRequest($request);
|
||||
|
@ -79,7 +79,7 @@ class DeveloperController extends Controller
|
|||
throw $this->createAccessDeniedException('You can not access this client.');
|
||||
}
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->remove($client);
|
||||
$em->flush();
|
||||
|
||||
|
|
|
@ -88,7 +88,7 @@ class EntryRestController extends WallabagRestController
|
|||
public function getEntriesExistsAction(Request $request)
|
||||
{
|
||||
$this->validateAuthentication();
|
||||
$repo = $this->getDoctrine()->getRepository(Entry::class);
|
||||
$repo = $this->get('doctrine')->getRepository(Entry::class);
|
||||
|
||||
$returnId = (null === $request->query->get('return_id')) ? false : (bool) $request->query->get('return_id');
|
||||
|
||||
|
@ -464,7 +464,7 @@ class EntryRestController extends WallabagRestController
|
|||
// entry deleted, dispatch event about it!
|
||||
$this->get(EventDispatcherInterface::class)->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->remove($entry);
|
||||
$em->flush();
|
||||
}
|
||||
|
@ -532,7 +532,7 @@ class EntryRestController extends WallabagRestController
|
|||
$this->get(ContentProxy::class)->updateEntry($entry, $url);
|
||||
}
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($entry);
|
||||
$em->flush();
|
||||
|
||||
|
@ -755,7 +755,7 @@ class EntryRestController extends WallabagRestController
|
|||
$this->get(ContentProxy::class)->setDefaultEntryTitle($entry);
|
||||
}
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($entry);
|
||||
$em->flush();
|
||||
|
||||
|
@ -971,7 +971,7 @@ class EntryRestController extends WallabagRestController
|
|||
$this->get(ContentProxy::class)->setDefaultEntryTitle($entry);
|
||||
}
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($entry);
|
||||
$em->flush();
|
||||
|
||||
|
@ -1027,7 +1027,7 @@ class EntryRestController extends WallabagRestController
|
|||
return new JsonResponse([], 304);
|
||||
}
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($entry);
|
||||
$em->flush();
|
||||
|
||||
|
@ -1085,7 +1085,7 @@ class EntryRestController extends WallabagRestController
|
|||
// entry deleted, dispatch event about it!
|
||||
$this->get(EventDispatcherInterface::class)->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->remove($entry);
|
||||
$em->flush();
|
||||
|
||||
|
@ -1168,7 +1168,7 @@ class EntryRestController extends WallabagRestController
|
|||
$this->get(TagsAssigner::class)->assignTagsToEntry($entry, $tags);
|
||||
}
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($entry);
|
||||
$em->flush();
|
||||
|
||||
|
@ -1213,7 +1213,7 @@ class EntryRestController extends WallabagRestController
|
|||
$this->validateUserAccess($entry->getUser()->getId());
|
||||
|
||||
$entry->removeTag($tag);
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($entry);
|
||||
$em->flush();
|
||||
|
||||
|
@ -1272,7 +1272,7 @@ class EntryRestController extends WallabagRestController
|
|||
foreach ($tags as $label) {
|
||||
$label = trim($label);
|
||||
|
||||
$tag = $this->getDoctrine()
|
||||
$tag = $this->get('doctrine')
|
||||
->getRepository(Tag::class)
|
||||
->findOneByLabel($label);
|
||||
|
||||
|
@ -1281,7 +1281,7 @@ class EntryRestController extends WallabagRestController
|
|||
}
|
||||
}
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($entry);
|
||||
$em->flush();
|
||||
}
|
||||
|
@ -1340,7 +1340,7 @@ class EntryRestController extends WallabagRestController
|
|||
if (false !== $entry && !(empty($tags))) {
|
||||
$this->get(TagsAssigner::class)->assignTagsToEntry($entry, $tags);
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($entry);
|
||||
$em->flush();
|
||||
}
|
||||
|
|
|
@ -33,7 +33,7 @@ class TagRestController extends WallabagRestController
|
|||
{
|
||||
$this->validateAuthentication();
|
||||
|
||||
$tags = $this->getDoctrine()
|
||||
$tags = $this->get('doctrine')
|
||||
->getRepository(Tag::class)
|
||||
->findAllFlatTagsWithNbEntries($this->getUser()->getId());
|
||||
|
||||
|
@ -71,7 +71,7 @@ class TagRestController extends WallabagRestController
|
|||
$this->validateAuthentication();
|
||||
$label = $request->get('tag', '');
|
||||
|
||||
$tags = $this->getDoctrine()->getRepository(Tag::class)->findByLabelsAndUser([$label], $this->getUser()->getId());
|
||||
$tags = $this->get('doctrine')->getRepository(Tag::class)->findByLabelsAndUser([$label], $this->getUser()->getId());
|
||||
|
||||
if (empty($tags)) {
|
||||
throw $this->createNotFoundException('Tag not found');
|
||||
|
@ -79,7 +79,7 @@ class TagRestController extends WallabagRestController
|
|||
|
||||
$tag = $tags[0];
|
||||
|
||||
$this->getDoctrine()
|
||||
$this->get('doctrine')
|
||||
->getRepository(Entry::class)
|
||||
->removeTag($this->getUser()->getId(), $tag);
|
||||
|
||||
|
@ -122,13 +122,13 @@ class TagRestController extends WallabagRestController
|
|||
|
||||
$tagsLabels = $request->get('tags', '');
|
||||
|
||||
$tags = $this->getDoctrine()->getRepository(Tag::class)->findByLabelsAndUser(explode(',', $tagsLabels), $this->getUser()->getId());
|
||||
$tags = $this->get('doctrine')->getRepository(Tag::class)->findByLabelsAndUser(explode(',', $tagsLabels), $this->getUser()->getId());
|
||||
|
||||
if (empty($tags)) {
|
||||
throw $this->createNotFoundException('Tags not found');
|
||||
}
|
||||
|
||||
$this->getDoctrine()
|
||||
$this->get('doctrine')
|
||||
->getRepository(Entry::class)
|
||||
->removeTags($this->getUser()->getId(), $tags);
|
||||
|
||||
|
@ -167,13 +167,13 @@ class TagRestController extends WallabagRestController
|
|||
{
|
||||
$this->validateAuthentication();
|
||||
|
||||
$tagFromDb = $this->getDoctrine()->getRepository(Tag::class)->findByLabelsAndUser([$tag->getLabel()], $this->getUser()->getId());
|
||||
$tagFromDb = $this->get('doctrine')->getRepository(Tag::class)->findByLabelsAndUser([$tag->getLabel()], $this->getUser()->getId());
|
||||
|
||||
if (empty($tagFromDb)) {
|
||||
throw $this->createNotFoundException('Tag not found');
|
||||
}
|
||||
|
||||
$this->getDoctrine()
|
||||
$this->get('doctrine')
|
||||
->getRepository(Entry::class)
|
||||
->removeTag($this->getUser()->getId(), $tag);
|
||||
|
||||
|
@ -195,7 +195,7 @@ class TagRestController extends WallabagRestController
|
|||
$tags = [$tags];
|
||||
}
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
|
||||
foreach ($tags as $tag) {
|
||||
if (0 === \count($tag->getEntries())) {
|
||||
|
|
|
@ -102,6 +102,7 @@ class UserRestController extends WallabagRestController
|
|||
|
||||
$userManager = $this->get(UserManagerInterface::class);
|
||||
$user = $userManager->createUser();
|
||||
\assert($user instanceof User);
|
||||
// user will be disabled BY DEFAULT to avoid spamming account to be enabled
|
||||
$user->setEnabled(false);
|
||||
|
||||
|
@ -150,7 +151,7 @@ class UserRestController extends WallabagRestController
|
|||
$client = new Client($user);
|
||||
$client->setName($request->request->get('client_name', 'Default client'));
|
||||
|
||||
$this->getDoctrine()->getManager()->persist($client);
|
||||
$this->get('doctrine')->getManager()->persist($client);
|
||||
|
||||
$user->addClient($client);
|
||||
|
||||
|
|
|
@ -12,6 +12,7 @@ use Symfony\Component\Routing\Annotation\Route;
|
|||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Symfony\Component\Security\Core\Authorization\AuthorizationCheckerInterface;
|
||||
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
class WallabagRestController extends AbstractFOSRestController
|
||||
{
|
||||
|
@ -84,6 +85,7 @@ class WallabagRestController extends AbstractFOSRestController
|
|||
protected function validateUserAccess($requestUserId)
|
||||
{
|
||||
$user = $this->get(TokenStorageInterface::class)->getToken()->getUser();
|
||||
\assert($user instanceof User);
|
||||
if ($requestUserId !== $user->getId()) {
|
||||
throw $this->createAccessDeniedException('Access forbidden. Entry user id: ' . $requestUserId . ', logged user id: ' . $user->getId());
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@ namespace Wallabag\ApiBundle\Entity;
|
|||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use FOS\OAuthServerBundle\Entity\AccessToken as BaseAccessToken;
|
||||
use FOS\OAuthServerBundle\Model\ClientInterface;
|
||||
use FOS\UserBundle\Model\UserInterface;
|
||||
|
||||
/**
|
||||
* @ORM\Table("oauth2_access_tokens")
|
||||
|
@ -37,12 +39,16 @@ class AccessToken extends BaseAccessToken
|
|||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Client", inversedBy="accessTokens")
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
*
|
||||
* @var ClientInterface
|
||||
*/
|
||||
protected $client;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User")
|
||||
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
|
||||
*
|
||||
* @var UserInterface
|
||||
*/
|
||||
protected $user;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@ namespace Wallabag\ApiBundle\Entity;
|
|||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use FOS\OAuthServerBundle\Entity\AuthCode as BaseAuthCode;
|
||||
use FOS\OAuthServerBundle\Model\ClientInterface;
|
||||
use FOS\UserBundle\Model\UserInterface;
|
||||
|
||||
/**
|
||||
* @ORM\Table("oauth2_auth_codes")
|
||||
|
@ -37,12 +39,16 @@ class AuthCode extends BaseAuthCode
|
|||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Client")
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
*
|
||||
* @var ClientInterface
|
||||
*/
|
||||
protected $client;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User")
|
||||
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
|
||||
*
|
||||
* @var UserInterface
|
||||
*/
|
||||
protected $user;
|
||||
}
|
||||
|
|
|
@ -4,6 +4,8 @@ namespace Wallabag\ApiBundle\Entity;
|
|||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
use FOS\OAuthServerBundle\Entity\RefreshToken as BaseRefreshToken;
|
||||
use FOS\OAuthServerBundle\Model\ClientInterface;
|
||||
use FOS\UserBundle\Model\UserInterface;
|
||||
|
||||
/**
|
||||
* @ORM\Table("oauth2_refresh_tokens")
|
||||
|
@ -37,12 +39,16 @@ class RefreshToken extends BaseRefreshToken
|
|||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Client", inversedBy="refreshTokens")
|
||||
* @ORM\JoinColumn(nullable=false)
|
||||
*
|
||||
* @var ClientInterface
|
||||
*/
|
||||
protected $client;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(targetEntity="Wallabag\UserBundle\Entity\User")
|
||||
* @ORM\JoinColumn(name="user_id", referencedColumnName="id", onDelete="CASCADE")
|
||||
*
|
||||
* @var UserInterface
|
||||
*/
|
||||
protected $user;
|
||||
}
|
||||
|
|
|
@ -6,6 +6,9 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
|||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Wallabag\ApiBundle\Entity\Client;
|
||||
|
||||
/**
|
||||
* @method Client[] findByUser(int $userId)
|
||||
*/
|
||||
class ClientRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
|
|
|
@ -43,7 +43,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
|
|||
return 1;
|
||||
}
|
||||
} else {
|
||||
$users = $this->getDoctrine()->getRepository(User::class)->findAll();
|
||||
$users = $this->getContainer()->get('doctrine')->getRepository(User::class)->findAll();
|
||||
|
||||
$output->writeln(sprintf('Generating hashed urls for "%d" users', \count($users)));
|
||||
|
||||
|
@ -60,7 +60,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
|
|||
private function generateHashedUrls(User $user)
|
||||
{
|
||||
$em = $this->getContainer()->get(EntityManagerInterface::class);
|
||||
$repo = $this->getDoctrine()->getRepository(Entry::class);
|
||||
$repo = $this->getContainer()->get('doctrine')->getRepository(Entry::class);
|
||||
|
||||
$entries = $repo->findByEmptyHashedUrlAndUserId($user->getId());
|
||||
|
||||
|
@ -89,7 +89,7 @@ class GenerateUrlHashesCommand extends ContainerAwareCommand
|
|||
*/
|
||||
private function getUser($username)
|
||||
{
|
||||
return $this->getDoctrine()->getRepository(User::class)->findOneByUserName($username);
|
||||
return $this->getContainer()->get('doctrine')->getRepository(User::class)->findOneByUserName($username);
|
||||
}
|
||||
|
||||
private function getDoctrine()
|
||||
|
|
|
@ -20,6 +20,7 @@ use Symfony\Component\Console\Style\SymfonyStyle;
|
|||
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
|
||||
use Wallabag\CoreBundle\Entity\IgnoreOriginInstanceRule;
|
||||
use Wallabag\CoreBundle\Entity\InternalSetting;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
class InstallCommand extends ContainerAwareCommand
|
||||
{
|
||||
|
@ -79,6 +80,8 @@ class InstallCommand extends ContainerAwareCommand
|
|||
|
||||
$this->io->success('wallabag has been successfully installed.');
|
||||
$this->io->success('You can now configure your web server, see https://doc.wallabag.org');
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
private function checkRequirements()
|
||||
|
@ -261,6 +264,7 @@ class InstallCommand extends ContainerAwareCommand
|
|||
|
||||
$userManager = $this->getContainer()->get(UserManagerInterface::class);
|
||||
$user = $userManager->createUser();
|
||||
\assert($user instanceof User);
|
||||
|
||||
$user->setUsername($this->io->ask('Username', 'wallabag'));
|
||||
|
||||
|
|
|
@ -47,7 +47,7 @@ class TagAllCommand extends ContainerAwareCommand
|
|||
|
||||
$io->text('Persist ' . \count($entries) . ' entries... ');
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->getContainer()->get('doctrine')->getManager();
|
||||
foreach ($entries as $entry) {
|
||||
$em->persist($entry);
|
||||
}
|
||||
|
|
|
@ -44,7 +44,7 @@ class ConfigController extends Controller
|
|||
*/
|
||||
public function indexAction(Request $request)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$config = $this->getConfig();
|
||||
$userManager = $this->container->get(UserManagerInterface::class);
|
||||
$user = $this->getUser();
|
||||
|
@ -125,7 +125,7 @@ class ConfigController extends Controller
|
|||
$action = $this->generateUrl('config') . '#set5';
|
||||
|
||||
if ($request->query->has('tagging-rule')) {
|
||||
$taggingRule = $this->getDoctrine()
|
||||
$taggingRule = $this->get('doctrine')
|
||||
->getRepository(TaggingRule::class)
|
||||
->find($request->query->get('tagging-rule'));
|
||||
|
||||
|
@ -188,7 +188,7 @@ class ConfigController extends Controller
|
|||
$action = $this->generateUrl('config') . '#set6';
|
||||
|
||||
if ($request->query->has('ignore-origin-user-rule')) {
|
||||
$ignoreOriginUserRule = $this->getDoctrine()
|
||||
$ignoreOriginUserRule = $this->get('doctrine')
|
||||
->getRepository(IgnoreOriginUserRule::class)
|
||||
->find($request->query->get('ignore-origin-user-rule'));
|
||||
|
||||
|
@ -414,7 +414,7 @@ class ConfigController extends Controller
|
|||
$config = $this->getConfig();
|
||||
$config->setFeedToken(Utils::generateToken());
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($config);
|
||||
$em->flush();
|
||||
|
||||
|
@ -440,7 +440,7 @@ class ConfigController extends Controller
|
|||
$config = $this->getConfig();
|
||||
$config->setFeedToken(null);
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($config);
|
||||
$em->flush();
|
||||
|
||||
|
@ -467,7 +467,7 @@ class ConfigController extends Controller
|
|||
{
|
||||
$this->validateRuleAction($rule);
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->remove($rule);
|
||||
$em->flush();
|
||||
|
||||
|
@ -504,7 +504,7 @@ class ConfigController extends Controller
|
|||
{
|
||||
$this->validateRuleAction($rule);
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->remove($rule);
|
||||
$em->flush();
|
||||
|
||||
|
@ -541,7 +541,7 @@ class ConfigController extends Controller
|
|||
{
|
||||
switch ($type) {
|
||||
case 'annotations':
|
||||
$this->getDoctrine()
|
||||
$this->get('doctrine')
|
||||
->getRepository(Annotation::class)
|
||||
->removeAllByUserId($this->getUser()->getId());
|
||||
break;
|
||||
|
@ -552,7 +552,7 @@ class ConfigController extends Controller
|
|||
// SQLite doesn't care about cascading remove, so we need to manually remove associated stuff
|
||||
// otherwise they won't be removed ...
|
||||
if ($this->get(ManagerRegistry::class)->getConnection()->getDatabasePlatform() instanceof SqlitePlatform) {
|
||||
$this->getDoctrine()->getRepository(Annotation::class)->removeAllByUserId($this->getUser()->getId());
|
||||
$this->get('doctrine')->getRepository(Annotation::class)->removeAllByUserId($this->getUser()->getId());
|
||||
}
|
||||
|
||||
// manually remove tags to avoid orphan tag
|
||||
|
@ -622,7 +622,7 @@ class ConfigController extends Controller
|
|||
$user = $this->getUser();
|
||||
$user->getConfig()->setListMode(!$user->getConfig()->getListMode());
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($user);
|
||||
$em->flush();
|
||||
|
||||
|
@ -691,7 +691,7 @@ class ConfigController extends Controller
|
|||
->removeTags($userId, $tags);
|
||||
|
||||
// cleanup orphan tags
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
|
||||
foreach ($tags as $tag) {
|
||||
if (0 === \count($tag->getEntries())) {
|
||||
|
@ -726,9 +726,9 @@ class ConfigController extends Controller
|
|||
|
||||
private function removeAnnotationsForArchivedByUserId($userId)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
|
||||
$archivedEntriesAnnotations = $this->getDoctrine()
|
||||
$archivedEntriesAnnotations = $this->get('doctrine')
|
||||
->getRepository(Annotation::class)
|
||||
->findAllArchivedEntriesByUser($userId);
|
||||
|
||||
|
@ -757,7 +757,7 @@ class ConfigController extends Controller
|
|||
*/
|
||||
private function getConfig()
|
||||
{
|
||||
$config = $this->getDoctrine()
|
||||
$config = $this->get('doctrine')
|
||||
->getRepository(ConfigEntity::class)
|
||||
->findOneByUser($this->getUser());
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ class EntryController extends Controller
|
|||
*/
|
||||
public function massAction(Request $request)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$values = $request->request->all();
|
||||
|
||||
$tagsToAdd = [];
|
||||
|
@ -173,7 +173,7 @@ class EntryController extends Controller
|
|||
|
||||
$this->updateEntry($entry);
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($entry);
|
||||
$em->flush();
|
||||
|
||||
|
@ -201,7 +201,7 @@ class EntryController extends Controller
|
|||
if (false === $this->checkIfEntryAlreadyExists($entry)) {
|
||||
$this->updateEntry($entry);
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($entry);
|
||||
$em->flush();
|
||||
|
||||
|
@ -238,7 +238,7 @@ class EntryController extends Controller
|
|||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($entry);
|
||||
$em->flush();
|
||||
|
||||
|
@ -409,7 +409,7 @@ class EntryController extends Controller
|
|||
return $this->redirect($this->generateUrl('view', ['id' => $entry->getId()]));
|
||||
}
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($entry);
|
||||
$em->flush();
|
||||
|
||||
|
@ -431,7 +431,7 @@ class EntryController extends Controller
|
|||
$this->checkUserAction($entry);
|
||||
|
||||
$entry->toggleArchive();
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
$this->get('doctrine')->getManager()->flush();
|
||||
|
||||
$message = 'flashes.entry.notice.entry_unarchived';
|
||||
if ($entry->isArchived()) {
|
||||
|
@ -461,7 +461,7 @@ class EntryController extends Controller
|
|||
|
||||
$entry->toggleStar();
|
||||
$entry->updateStar($entry->isStarred());
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
$this->get('doctrine')->getManager()->flush();
|
||||
|
||||
$message = 'flashes.entry.notice.entry_unstarred';
|
||||
if ($entry->isStarred()) {
|
||||
|
@ -500,7 +500,7 @@ class EntryController extends Controller
|
|||
// entry deleted, dispatch event about it!
|
||||
$this->get(EventDispatcherInterface::class)->dispatch(EntryDeletedEvent::NAME, new EntryDeletedEvent($entry));
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->remove($entry);
|
||||
$em->flush();
|
||||
|
||||
|
@ -532,7 +532,7 @@ class EntryController extends Controller
|
|||
if (null === $entry->getUid()) {
|
||||
$entry->generateUid();
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($entry);
|
||||
$em->flush();
|
||||
}
|
||||
|
@ -555,7 +555,7 @@ class EntryController extends Controller
|
|||
|
||||
$entry->cleanUid();
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($entry);
|
||||
$em->flush();
|
||||
|
||||
|
|
|
@ -50,7 +50,7 @@ class IgnoreOriginInstanceRuleController extends Controller
|
|||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($ignoreOriginInstanceRule);
|
||||
$em->flush();
|
||||
|
||||
|
@ -82,7 +82,7 @@ class IgnoreOriginInstanceRuleController extends Controller
|
|||
$editForm->handleRequest($request);
|
||||
|
||||
if ($editForm->isSubmitted() && $editForm->isValid()) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($ignoreOriginInstanceRule);
|
||||
$em->flush();
|
||||
|
||||
|
@ -119,7 +119,7 @@ class IgnoreOriginInstanceRuleController extends Controller
|
|||
$this->get(TranslatorInterface::class)->trans('flashes.ignore_origin_instance_rule.notice.deleted')
|
||||
);
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->remove($ignoreOriginInstanceRule);
|
||||
$em->flush();
|
||||
}
|
||||
|
|
|
@ -60,7 +60,7 @@ class SiteCredentialController extends Controller
|
|||
$credential->setUsername($this->get(CryptoProxy::class)->crypt($credential->getUsername()));
|
||||
$credential->setPassword($this->get(CryptoProxy::class)->crypt($credential->getPassword()));
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($credential);
|
||||
$em->flush();
|
||||
|
||||
|
@ -99,7 +99,7 @@ class SiteCredentialController extends Controller
|
|||
$siteCredential->setUsername($this->get(CryptoProxy::class)->crypt($siteCredential->getUsername()));
|
||||
$siteCredential->setPassword($this->get(CryptoProxy::class)->crypt($siteCredential->getPassword()));
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($siteCredential);
|
||||
$em->flush();
|
||||
|
||||
|
@ -140,7 +140,7 @@ class SiteCredentialController extends Controller
|
|||
$this->get(TranslatorInterface::class)->trans('flashes.site_credential.notice.deleted', ['%host%' => $siteCredential->getHost()])
|
||||
);
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->remove($siteCredential);
|
||||
$em->flush();
|
||||
}
|
||||
|
|
|
@ -39,7 +39,7 @@ class TagController extends Controller
|
|||
$form->get('label')->getData()
|
||||
);
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->persist($entry);
|
||||
$em->flush();
|
||||
|
||||
|
@ -67,7 +67,7 @@ class TagController extends Controller
|
|||
public function removeTagFromEntry(Request $request, Entry $entry, Tag $tag)
|
||||
{
|
||||
$entry->removeTag($tag);
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->flush();
|
||||
|
||||
// remove orphan tag in case no entries are associated to it
|
||||
|
@ -188,7 +188,7 @@ class TagController extends Controller
|
|||
$entry->removeTag($tag);
|
||||
}
|
||||
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
$this->get('doctrine')->getManager()->flush();
|
||||
|
||||
$this->get(SessionInterface::class)->getFlashBag()->add(
|
||||
'notice',
|
||||
|
@ -212,7 +212,7 @@ class TagController extends Controller
|
|||
|
||||
/** @var QueryBuilder $qb */
|
||||
$qb = $this->get(EntryRepository::class)->getBuilderForSearchByUser($this->getUser()->getId(), $filter, $currentRoute);
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
|
||||
$entries = $qb->getQuery()->getResult();
|
||||
|
||||
|
@ -246,7 +246,7 @@ class TagController extends Controller
|
|||
|
||||
// remove orphan tag in case no entries are associated to it
|
||||
if (0 === \count($tag->getEntries())) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->remove($tag);
|
||||
$em->flush();
|
||||
}
|
||||
|
|
|
@ -4,6 +4,7 @@ namespace Wallabag\CoreBundle\Event\Listener;
|
|||
|
||||
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||
use Symfony\Component\Security\Http\Event\InteractiveLoginEvent;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
/**
|
||||
* Stores the locale of the user in the session after the login.
|
||||
|
@ -25,6 +26,7 @@ class UserLocaleListener
|
|||
public function onInteractiveLogin(InteractiveLoginEvent $event)
|
||||
{
|
||||
$user = $event->getAuthenticationToken()->getUser();
|
||||
\assert($user instanceof User);
|
||||
|
||||
if (null !== $user->getConfig()->getLanguage() && null === $this->session->get('_locale')) {
|
||||
$this->session->set('_locale', $user->getConfig()->getLanguage());
|
||||
|
|
|
@ -15,11 +15,12 @@ use Symfony\Component\HttpFoundation\Response;
|
|||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
class EntryFilterType extends AbstractType
|
||||
{
|
||||
private $user;
|
||||
private $repository;
|
||||
private $tokenStorage;
|
||||
|
||||
/**
|
||||
* Repository & user are used to get a list of language entries for this user.
|
||||
|
@ -27,16 +28,15 @@ class EntryFilterType extends AbstractType
|
|||
public function __construct(EntryRepository $entryRepository, TokenStorageInterface $tokenStorage)
|
||||
{
|
||||
$this->repository = $entryRepository;
|
||||
|
||||
$this->user = $tokenStorage->getToken() ? $tokenStorage->getToken()->getUser() : null;
|
||||
|
||||
if (null === $this->user || !\is_object($this->user)) {
|
||||
return;
|
||||
}
|
||||
$this->tokenStorage = $tokenStorage;
|
||||
}
|
||||
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
|
||||
|
||||
\assert($user instanceof User);
|
||||
|
||||
$builder
|
||||
->add('readingTime', NumberRangeFilterType::class, [
|
||||
'left_number_options' => [
|
||||
|
@ -47,17 +47,19 @@ class EntryFilterType extends AbstractType
|
|||
'condition_operator' => FilterOperands::OPERATOR_LOWER_THAN_EQUAL,
|
||||
'attr' => ['min' => 0],
|
||||
],
|
||||
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) {
|
||||
'apply_filter' => function (QueryInterface $filterQuery, $field, $values) use ($user) {
|
||||
$lower = $values['value']['left_number'][0];
|
||||
$upper = $values['value']['right_number'][0];
|
||||
|
||||
$min = (int) ($lower * $this->user->getConfig()->getReadingSpeed() / 200);
|
||||
$max = (int) ($upper * $this->user->getConfig()->getReadingSpeed() / 200);
|
||||
|
||||
if (null === $lower && null === $upper) {
|
||||
// no value? no filter
|
||||
return;
|
||||
} elseif (null === $lower && null !== $upper) {
|
||||
}
|
||||
|
||||
$min = (int) ($lower * $user->getConfig()->getReadingSpeed() / 200);
|
||||
$max = (int) ($upper * $user->getConfig()->getReadingSpeed() / 200);
|
||||
|
||||
if (null === $lower && null !== $upper) {
|
||||
// only lower value is defined: query all entries with reading LOWER THAN this value
|
||||
$expression = $filterQuery->getExpr()->lte($field, $max);
|
||||
} elseif (null !== $lower && null === $upper) {
|
||||
|
@ -176,7 +178,7 @@ class EntryFilterType extends AbstractType
|
|||
'label' => 'entry.filters.is_public_label',
|
||||
])
|
||||
->add('language', ChoiceFilterType::class, [
|
||||
'choices' => array_flip($this->repository->findDistinctLanguageByUser($this->user->getId())),
|
||||
'choices' => array_flip($this->repository->findDistinctLanguageByUser($user->getId())),
|
||||
'label' => 'entry.filters.language_label',
|
||||
])
|
||||
;
|
||||
|
|
|
@ -21,11 +21,11 @@ class EntriesExport
|
|||
private $wallabagUrl;
|
||||
private $logoPath;
|
||||
private $translator;
|
||||
private $tokenStorage;
|
||||
private $title = '';
|
||||
private $entries = [];
|
||||
private $author = 'wallabag';
|
||||
private $language = '';
|
||||
private $user;
|
||||
|
||||
/**
|
||||
* @param TranslatorInterface $translator Translator service
|
||||
|
@ -38,13 +38,7 @@ class EntriesExport
|
|||
$this->translator = $translator;
|
||||
$this->wallabagUrl = $wallabagUrl;
|
||||
$this->logoPath = $logoPath;
|
||||
|
||||
/* @var User $user */
|
||||
$this->user = $tokenStorage->getToken() ? $tokenStorage->getToken()->getUser() : null;
|
||||
|
||||
if (null === $this->user || !\is_object($this->user)) {
|
||||
return;
|
||||
}
|
||||
$this->tokenStorage = $tokenStorage;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -140,6 +134,9 @@ class EntriesExport
|
|||
*/
|
||||
private function produceEpub()
|
||||
{
|
||||
$user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
|
||||
\assert($user instanceof User);
|
||||
|
||||
/*
|
||||
* Start and End of the book
|
||||
*/
|
||||
|
@ -213,7 +210,7 @@ class EntriesExport
|
|||
$publishedDate = $entry->getPublishedAt()->format('Y-m-d');
|
||||
}
|
||||
|
||||
$readingTime = $entry->getReadingTime() / $this->user->getConfig()->getReadingSpeed() * 200;
|
||||
$readingTime = $entry->getReadingTime() / $user->getConfig()->getReadingSpeed() * 200;
|
||||
|
||||
$titlepage = $content_start .
|
||||
'<h1>' . $entry->getTitle() . '</h1>' .
|
||||
|
@ -306,6 +303,9 @@ class EntriesExport
|
|||
*/
|
||||
private function producePdf()
|
||||
{
|
||||
$user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
|
||||
\assert($user instanceof User);
|
||||
|
||||
$pdf = new \TCPDF(PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);
|
||||
|
||||
/*
|
||||
|
@ -331,7 +331,7 @@ class EntriesExport
|
|||
$authors = implode(',', $publishedBy);
|
||||
}
|
||||
|
||||
$readingTime = $entry->getReadingTime() / $this->user->getConfig()->getReadingSpeed() * 200;
|
||||
$readingTime = $entry->getReadingTime() / $user->getConfig()->getReadingSpeed() * 200;
|
||||
|
||||
$pdf->addPage();
|
||||
$html = '<h1>' . $entry->getTitle() . '</h1>' .
|
||||
|
|
|
@ -15,7 +15,7 @@ use Psr\Log\LoggerInterface;
|
|||
*/
|
||||
class HttpClientFactory implements ClientFactory
|
||||
{
|
||||
/** @var [\GuzzleHttp\Event\SubscriberInterface] */
|
||||
/** @var SubscriberInterface[] */
|
||||
private $subscribers = [];
|
||||
|
||||
/** @var CookieJar */
|
||||
|
|
|
@ -27,7 +27,7 @@ class PreparePagerForEntries
|
|||
$user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
|
||||
}
|
||||
|
||||
if (null === $user || !\is_object($user)) {
|
||||
if (!$user instanceof User) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
@ -5,6 +5,7 @@ namespace Wallabag\CoreBundle\Helper;
|
|||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\Storage\TokenStorageInterface;
|
||||
use Wallabag\CoreBundle\Entity\Config;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
/**
|
||||
* Manage redirections to avoid redirecting to empty routes.
|
||||
|
@ -31,7 +32,7 @@ class Redirect
|
|||
{
|
||||
$user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
|
||||
|
||||
if (null === $user || !\is_object($user)) {
|
||||
if (!$user instanceof User) {
|
||||
return $url;
|
||||
}
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ use Sensio\Bundle\FrameworkExtraBundle\Request\ParamConverter\ParamConverterInte
|
|||
use Symfony\Component\HttpFoundation\Request;
|
||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
use Wallabag\UserBundle\Repository\UserRepository;
|
||||
|
||||
/**
|
||||
* ParamConverter used in the Feed controller to retrieve the right user according to
|
||||
|
@ -76,6 +77,7 @@ class UsernameFeedTokenConverter implements ParamConverterInterface
|
|||
// Get actual entity manager for class
|
||||
$em = $this->registry->getManagerForClass($configuration->getClass());
|
||||
|
||||
/** @var UserRepository $userRepository */
|
||||
$userRepository = $em->getRepository($configuration->getClass());
|
||||
|
||||
// Try to find user by its username and config feed_token
|
||||
|
|
|
@ -6,6 +6,9 @@ use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
|
|||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Wallabag\CoreBundle\Entity\Config;
|
||||
|
||||
/**
|
||||
* @method Config|null findOneByUser(int $userId)
|
||||
*/
|
||||
class ConfigRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
|
|
|
@ -12,6 +12,10 @@ use Wallabag\CoreBundle\Entity\Entry;
|
|||
use Wallabag\CoreBundle\Entity\Tag;
|
||||
use Wallabag\CoreBundle\Helper\UrlHasher;
|
||||
|
||||
/**
|
||||
* @method Entry[] findById(int $id)
|
||||
* @method Entry|null findOneByUser(int $userId)
|
||||
*/
|
||||
class EntryRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
|
|
|
@ -9,6 +9,8 @@ use Wallabag\CoreBundle\Helper\CryptoProxy;
|
|||
|
||||
/**
|
||||
* SiteCredentialRepository.
|
||||
*
|
||||
* @method SiteCredential[] findByUser(int $userId)
|
||||
*/
|
||||
class SiteCredentialRepository extends ServiceEntityRepository
|
||||
{
|
||||
|
|
|
@ -7,6 +7,10 @@ use Doctrine\ORM\QueryBuilder;
|
|||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Wallabag\CoreBundle\Entity\Tag;
|
||||
|
||||
/**
|
||||
* @method Tag|null findOneByLabel(string $label)
|
||||
* @method Tag|null findOneBySlug(string $slug)
|
||||
*/
|
||||
class TagRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
|
|
|
@ -10,6 +10,7 @@ use Twig\TwigFilter;
|
|||
use Twig\TwigFunction;
|
||||
use Wallabag\CoreBundle\Repository\EntryRepository;
|
||||
use Wallabag\CoreBundle\Repository\TagRepository;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
class WallabagExtension extends AbstractExtension implements GlobalsInterface
|
||||
{
|
||||
|
@ -81,7 +82,7 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface
|
|||
{
|
||||
$user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
|
||||
|
||||
if (null === $user || !\is_object($user)) {
|
||||
if (!$user instanceof User) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -127,7 +128,7 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface
|
|||
{
|
||||
$user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
|
||||
|
||||
if (null === $user || !\is_object($user)) {
|
||||
if (!$user instanceof User) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -143,7 +144,7 @@ class WallabagExtension extends AbstractExtension implements GlobalsInterface
|
|||
{
|
||||
$user = $this->tokenStorage->getToken() ? $this->tokenStorage->getToken()->getUser() : null;
|
||||
|
||||
if (null === $user || !\is_object($user)) {
|
||||
if (!$user instanceof User) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -112,5 +112,7 @@ class ImportCommand extends ContainerAwareCommand
|
|||
$em->clear();
|
||||
|
||||
$output->writeln('End : ' . (new \DateTime())->format('d-m-Y G:i:s') . ' ---');
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -40,5 +40,7 @@ class RedisWorkerCommand extends ContainerAwareCommand
|
|||
);
|
||||
|
||||
$worker->start();
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -37,6 +37,7 @@ class ManageController extends Controller
|
|||
$userManager = $this->container->get(UserManagerInterface::class);
|
||||
|
||||
$user = $userManager->createUser();
|
||||
\assert($user instanceof User);
|
||||
// enable created user by default
|
||||
$user->setEnabled(true);
|
||||
|
||||
|
@ -127,7 +128,7 @@ class ManageController extends Controller
|
|||
$this->get(TranslatorInterface::class)->trans('flashes.user.notice.deleted', ['%username%' => $user->getUsername()])
|
||||
);
|
||||
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$em->remove($user);
|
||||
$em->flush();
|
||||
}
|
||||
|
@ -147,7 +148,7 @@ class ManageController extends Controller
|
|||
*/
|
||||
public function searchFormAction(Request $request, $page = 1)
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em = $this->get('doctrine')->getManager();
|
||||
$qb = $em->getRepository(User::class)->createQueryBuilder('u');
|
||||
|
||||
$form = $this->createForm(SearchUserType::class);
|
||||
|
|
|
@ -7,6 +7,9 @@ use Doctrine\ORM\QueryBuilder;
|
|||
use Doctrine\Persistence\ManagerRegistry;
|
||||
use Wallabag\UserBundle\Entity\User;
|
||||
|
||||
/**
|
||||
* @method User|null findOneById(int $id)
|
||||
*/
|
||||
class UserRepository extends ServiceEntityRepository
|
||||
{
|
||||
public function __construct(ManagerRegistry $registry)
|
||||
|
|
|
@ -3,6 +3,8 @@
|
|||
namespace Tests\Wallabag\AnnotationBundle;
|
||||
|
||||
use FOS\UserBundle\Model\UserInterface;
|
||||
use FOS\UserBundle\Model\UserManager;
|
||||
use FOS\UserBundle\Security\LoginManager;
|
||||
use Symfony\Bundle\FrameworkBundle\Client;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
use Symfony\Component\BrowserKit\Cookie;
|
||||
|
@ -47,9 +49,9 @@ abstract class WallabagAnnotationTestCase extends WebTestCase
|
|||
$client = static::createClient();
|
||||
$container = $client->getContainer();
|
||||
|
||||
/** @var $userManager \FOS\UserBundle\Doctrine\UserManager */
|
||||
/** @var UserManager $userManager */
|
||||
$userManager = $container->get('fos_user.user_manager.test');
|
||||
/** @var $loginManager \FOS\UserBundle\Security\LoginManager */
|
||||
/** @var LoginManager $loginManager */
|
||||
$loginManager = $container->get('fos_user.security.login_manager.test');
|
||||
$firewallName = $container->getParameter('fos_user.firewall_name');
|
||||
|
||||
|
|
|
@ -4,6 +4,8 @@ namespace Tests\Wallabag\ApiBundle;
|
|||
|
||||
use Doctrine\ORM\EntityManagerInterface;
|
||||
use FOS\UserBundle\Model\UserInterface;
|
||||
use FOS\UserBundle\Model\UserManager;
|
||||
use FOS\UserBundle\Security\LoginManager;
|
||||
use Symfony\Bundle\FrameworkBundle\Client;
|
||||
use Symfony\Bundle\FrameworkBundle\Test\WebTestCase;
|
||||
use Symfony\Component\BrowserKit\Cookie;
|
||||
|
@ -37,9 +39,9 @@ abstract class WallabagApiTestCase extends WebTestCase
|
|||
$client = static::createClient();
|
||||
$container = $client->getContainer();
|
||||
|
||||
/** @var $userManager \FOS\UserBundle\Doctrine\UserManager */
|
||||
/** @var UserManager $userManager */
|
||||
$userManager = $container->get('fos_user.user_manager.test');
|
||||
/** @var $loginManager \FOS\UserBundle\Security\LoginManager */
|
||||
/** @var LoginManager $loginManager */
|
||||
$loginManager = $container->get('fos_user.security.login_manager.test');
|
||||
$firewallName = $container->getParameter('fos_user.firewall_name');
|
||||
|
||||
|
|
|
@ -895,6 +895,8 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
|||
|
||||
$user = static::$kernel->getContainer()->get(TokenStorageInterface::class)->getToken()->getUser();
|
||||
|
||||
\assert($user instanceof User);
|
||||
|
||||
$tag = new Tag();
|
||||
$tag->setLabel('super');
|
||||
$em->persist($tag);
|
||||
|
@ -980,6 +982,8 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
|||
|
||||
$user = static::$kernel->getContainer()->get(TokenStorageInterface::class)->getToken()->getUser();
|
||||
|
||||
\assert($user instanceof User);
|
||||
|
||||
$tag = new Tag();
|
||||
$tag->setLabel('super');
|
||||
$em->persist($tag);
|
||||
|
@ -1056,6 +1060,8 @@ class ConfigControllerTest extends WallabagCoreTestCase
|
|||
|
||||
$user = static::$kernel->getContainer()->get(TokenStorageInterface::class)->getToken()->getUser();
|
||||
|
||||
\assert($user instanceof User);
|
||||
|
||||
$tag = new Tag();
|
||||
$tag->setLabel('super');
|
||||
$em->persist($tag);
|
||||
|
|
|
@ -18,6 +18,9 @@ class RedirectTest extends TestCase
|
|||
/** @var Redirect */
|
||||
private $redirect;
|
||||
|
||||
/** @var User */
|
||||
private $user;
|
||||
|
||||
/** @var UsernamePasswordToken */
|
||||
private $token;
|
||||
|
||||
|
@ -32,24 +35,24 @@ class RedirectTest extends TestCase
|
|||
->with('homepage')
|
||||
->willReturn('homepage');
|
||||
|
||||
$user = new User();
|
||||
$user->setName('youpi');
|
||||
$user->setEmail('youpi@youpi.org');
|
||||
$user->setUsername('youpi');
|
||||
$user->setPlainPassword('youpi');
|
||||
$user->setEnabled(true);
|
||||
$user->addRole('ROLE_SUPER_ADMIN');
|
||||
$this->user = new User();
|
||||
$this->user->setName('youpi');
|
||||
$this->user->setEmail('youpi@youpi.org');
|
||||
$this->user->setUsername('youpi');
|
||||
$this->user->setPlainPassword('youpi');
|
||||
$this->user->setEnabled(true);
|
||||
$this->user->addRole('ROLE_SUPER_ADMIN');
|
||||
|
||||
$config = new Config($user);
|
||||
$config = new Config($this->user);
|
||||
$config->setItemsPerPage(30);
|
||||
$config->setReadingSpeed(200);
|
||||
$config->setLanguage('en');
|
||||
$config->setPocketConsumerKey('xxxxx');
|
||||
$config->setActionMarkAsRead(Config::REDIRECT_TO_CURRENT_PAGE);
|
||||
|
||||
$user->setConfig($config);
|
||||
$this->user->setConfig($config);
|
||||
|
||||
$this->token = new UsernamePasswordToken($user, 'password', 'key');
|
||||
$this->token = new UsernamePasswordToken($this->user, 'password', 'key');
|
||||
$tokenStorage = new TokenStorage();
|
||||
$tokenStorage->setToken($this->token);
|
||||
|
||||
|
@ -87,7 +90,7 @@ class RedirectTest extends TestCase
|
|||
|
||||
public function testUserForRedirectToHomepage()
|
||||
{
|
||||
$this->token->getUser()->getConfig()->setActionMarkAsRead(Config::REDIRECT_TO_HOMEPAGE);
|
||||
$this->user->getConfig()->setActionMarkAsRead(Config::REDIRECT_TO_HOMEPAGE);
|
||||
|
||||
$redirectUrl = $this->redirect->to('/unread/list');
|
||||
|
||||
|
@ -96,7 +99,7 @@ class RedirectTest extends TestCase
|
|||
|
||||
public function testUserForRedirectWithIgnoreActionMarkAsRead()
|
||||
{
|
||||
$this->token->getUser()->getConfig()->setActionMarkAsRead(Config::REDIRECT_TO_HOMEPAGE);
|
||||
$this->user->getConfig()->setActionMarkAsRead(Config::REDIRECT_TO_HOMEPAGE);
|
||||
|
||||
$redirectUrl = $this->redirect->to('/unread/list', '', true);
|
||||
|
||||
|
@ -105,7 +108,7 @@ class RedirectTest extends TestCase
|
|||
|
||||
public function testUserForRedirectNullWithFallbackWithIgnoreActionMarkAsRead()
|
||||
{
|
||||
$this->token->getUser()->getConfig()->setActionMarkAsRead(Config::REDIRECT_TO_HOMEPAGE);
|
||||
$this->user->getConfig()->setActionMarkAsRead(Config::REDIRECT_TO_HOMEPAGE);
|
||||
|
||||
$redirectUrl = $this->redirect->to(null, 'fallback', true);
|
||||
|
||||
|
|
Loading…
Reference in a new issue