aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
diff options
context:
space:
mode:
authorJérémy Benoist <j0k3r@users.noreply.github.com>2018-09-05 16:38:20 +0000
committerGitHub <noreply@github.com>2018-09-05 16:38:20 +0000
commitada5d5b2694ec95c6ca84aa91f22add1973343e0 (patch)
treedf0b695eb99e96dc55b63b27a404080c23421639 /src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
parent685a5d745e2b723a09111d7d31157cced67ea9b4 (diff)
parent2a1ceb67b4400f46f4d3067e887ff54aa906f0a2 (diff)
downloadwallabag-ada5d5b2694ec95c6ca84aa91f22add1973343e0.tar.gz
wallabag-ada5d5b2694ec95c6ca84aa91f22add1973343e0.tar.zst
wallabag-ada5d5b2694ec95c6ca84aa91f22add1973343e0.zip
Merge pull request #3716 from wallabag/csfixer
php-cs-fixer: native_function_invocation
Diffstat (limited to 'src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php')
-rw-r--r--src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php b/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
index b58909db..99170967 100644
--- a/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
+++ b/src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php
@@ -51,7 +51,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
51 } else { 51 } else {
52 $users = $this->getContainer()->get('wallabag_user.user_repository')->findAll(); 52 $users = $this->getContainer()->get('wallabag_user.user_repository')->findAll();
53 53
54 $this->io->text(sprintf('Cleaning through <info>%d</info> user accounts', count($users))); 54 $this->io->text(sprintf('Cleaning through <info>%d</info> user accounts', \count($users)));
55 55
56 foreach ($users as $user) { 56 foreach ($users as $user) {
57 $this->io->text(sprintf('Processing user <info>%s</info>', $user->getUsername())); 57 $this->io->text(sprintf('Processing user <info>%s</info>', $user->getUsername()));
@@ -79,7 +79,7 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
79 $url = $this->similarUrl($entry['url']); 79 $url = $this->similarUrl($entry['url']);
80 80
81 /* @var $entry Entry */ 81 /* @var $entry Entry */
82 if (in_array($url, $urls, true)) { 82 if (\in_array($url, $urls, true)) {
83 ++$duplicatesCount; 83 ++$duplicatesCount;
84 84
85 $em->remove($repo->find($entry['id'])); 85 $em->remove($repo->find($entry['id']));
@@ -96,8 +96,8 @@ class CleanDuplicatesCommand extends ContainerAwareCommand
96 96
97 private function similarUrl($url) 97 private function similarUrl($url)
98 { 98 {
99 if (in_array(substr($url, -1), ['/', '#'], true)) { // get rid of "/" and "#" and the end of urls 99 if (\in_array(substr($url, -1), ['/', '#'], true)) { // get rid of "/" and "#" and the end of urls
100 return substr($url, 0, strlen($url)); 100 return substr($url, 0, \strlen($url));
101 } 101 }
102 102
103 return $url; 103 return $url;