X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=src%2FWallabag%2FCoreBundle%2FCommand%2FCleanDuplicatesCommand.php;h=99170967018af889b1cf1e13d5beb5cb110308c5;hb=7083c0a21d27e7e1bf45a9807a76844116d61fb8;hp=1caaa39101e99219058bab3d292fc1d90ab37f30;hpb=e1b33efb3dd7c9ebb4dcfb23a2ca5efbda0a05f6;p=github%2Fwallabag%2Fwallabag.git diff --git a/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php b/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php index 1caaa391..99170967 100644 --- a/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php +++ b/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php @@ -51,7 +51,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand } else { $users = $this->getContainer()->get('wallabag_user.user_repository')->findAll(); - $this->io->text(sprintf('Cleaning through %d user accounts', count($users))); + $this->io->text(sprintf('Cleaning through %d user accounts', \count($users))); foreach ($users as $user) { $this->io->text(sprintf('Processing user %s', $user->getUsername())); @@ -71,7 +71,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand $em = $this->getContainer()->get('doctrine.orm.entity_manager'); $repo = $this->getContainer()->get('wallabag_core.entry_repository'); - $entries = $repo->getAllEntriesIdAndUrl($user->getId()); + $entries = $repo->findAllEntriesIdAndUrlByUserId($user->getId()); $duplicatesCount = 0; $urls = []; @@ -79,7 +79,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand $url = $this->similarUrl($entry['url']); /* @var $entry Entry */ - if (in_array($url, $urls, true)) { + if (\in_array($url, $urls, true)) { ++$duplicatesCount; $em->remove($repo->find($entry['id'])); @@ -96,8 +96,8 @@ class CleanDuplicatesCommand extends ContainerAwareCommand private function similarUrl($url) { - if (in_array(substr($url, -1), ['/', '#'], true)) { // get rid of "/" and "#" and the end of urls - return substr($url, 0, strlen($url)); + if (\in_array(substr($url, -1), ['/', '#'], true)) { // get rid of "/" and "#" and the end of urls + return substr($url, 0, \strlen($url)); } return $url;