aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/Wallabag/CoreBundle/Command
diff options
context:
space:
mode:
authorKevin Decherf <kevin@kdecherf.com>2018-09-05 14:25:32 +0200
committerKevin Decherf <kevin@kdecherf.com>2018-09-05 14:25:32 +0200
commit2a1ceb67b4400f46f4d3067e887ff54aa906f0a2 (patch)
treedf0b695eb99e96dc55b63b27a404080c23421639 /src/Wallabag/CoreBundle/Command
parent685a5d745e2b723a09111d7d31157cced67ea9b4 (diff)
downloadwallabag-2a1ceb67b4400f46f4d3067e887ff54aa906f0a2.tar.gz
wallabag-2a1ceb67b4400f46f4d3067e887ff54aa906f0a2.tar.zst
wallabag-2a1ceb67b4400f46f4d3067e887ff54aa906f0a2.zip
php-cs-fixer
Signed-off-by: Kevin Decherf <kevin@kdecherf.com>
Diffstat (limited to 'src/Wallabag/CoreBundle/Command')
-rw-r--r--src/Wallabag/CoreBundle/Command/CleanDuplicatesCommand.php8
-rw-r--r--src/Wallabag/CoreBundle/Command/ExportCommand.php2
-rw-r--r--src/Wallabag/CoreBundle/Command/InstallCommand.php8
-rw-r--r--src/Wallabag/CoreBundle/Command/ListUserCommand.php2
-rw-r--r--src/Wallabag/CoreBundle/Command/ReloadEntryCommand.php2
5 files changed, 11 insertions, 11 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;
diff --git a/src/Wallabag/CoreBundle/Command/ExportCommand.php b/src/Wallabag/CoreBundle/Command/ExportCommand.php
index 75e9ad91..128f9d65 100644
--- a/src/Wallabag/CoreBundle/Command/ExportCommand.php
+++ b/src/Wallabag/CoreBundle/Command/ExportCommand.php
@@ -47,7 +47,7 @@ class ExportCommand extends ContainerAwareCommand
47 ->getQuery() 47 ->getQuery()
48 ->getResult(); 48 ->getResult();
49 49
50 $io->text(sprintf('Exporting <info>%d</info> entrie(s) for user <info>%s</info>...', count($entries), $user->getUserName())); 50 $io->text(sprintf('Exporting <info>%d</info> entrie(s) for user <info>%s</info>...', \count($entries), $user->getUserName()));
51 51
52 $filePath = $input->getArgument('filepath'); 52 $filePath = $input->getArgument('filepath');
53 53
diff --git a/src/Wallabag/CoreBundle/Command/InstallCommand.php b/src/Wallabag/CoreBundle/Command/InstallCommand.php
index a56a3257..3c76545c 100644
--- a/src/Wallabag/CoreBundle/Command/InstallCommand.php
+++ b/src/Wallabag/CoreBundle/Command/InstallCommand.php
@@ -81,7 +81,7 @@ class InstallCommand extends ContainerAwareCommand
81 $status = '<info>OK!</info>'; 81 $status = '<info>OK!</info>';
82 $help = ''; 82 $help = '';
83 83
84 if (!extension_loaded($this->getContainer()->getParameter('database_driver'))) { 84 if (!\extension_loaded($this->getContainer()->getParameter('database_driver'))) {
85 $fulfilled = false; 85 $fulfilled = false;
86 $status = '<error>ERROR!</error>'; 86 $status = '<error>ERROR!</error>';
87 $help = 'Database driver "' . $this->getContainer()->getParameter('database_driver') . '" is not installed.'; 87 $help = 'Database driver "' . $this->getContainer()->getParameter('database_driver') . '" is not installed.';
@@ -146,7 +146,7 @@ class InstallCommand extends ContainerAwareCommand
146 $status = '<info>OK!</info>'; 146 $status = '<info>OK!</info>';
147 $help = ''; 147 $help = '';
148 148
149 if (!function_exists($functionRequired)) { 149 if (!\function_exists($functionRequired)) {
150 $fulfilled = false; 150 $fulfilled = false;
151 $status = '<error>ERROR!</error>'; 151 $status = '<error>ERROR!</error>';
152 $help = 'You need the ' . $functionRequired . ' function activated'; 152 $help = 'You need the ' . $functionRequired . ' function activated';
@@ -371,7 +371,7 @@ class InstallCommand extends ContainerAwareCommand
371 } 371 }
372 372
373 try { 373 try {
374 return in_array($databaseName, $schemaManager->listDatabases(), true); 374 return \in_array($databaseName, $schemaManager->listDatabases(), true);
375 } catch (\Doctrine\DBAL\Exception\DriverException $e) { 375 } catch (\Doctrine\DBAL\Exception\DriverException $e) {
376 // it means we weren't able to get database list, assume the database doesn't exist 376 // it means we weren't able to get database list, assume the database doesn't exist
377 377
@@ -389,6 +389,6 @@ class InstallCommand extends ContainerAwareCommand
389 { 389 {
390 $schemaManager = $this->getContainer()->get('doctrine')->getManager()->getConnection()->getSchemaManager(); 390 $schemaManager = $this->getContainer()->get('doctrine')->getManager()->getConnection()->getSchemaManager();
391 391
392 return count($schemaManager->listTableNames()) > 0 ? true : false; 392 return \count($schemaManager->listTableNames()) > 0 ? true : false;
393 } 393 }
394} 394}
diff --git a/src/Wallabag/CoreBundle/Command/ListUserCommand.php b/src/Wallabag/CoreBundle/Command/ListUserCommand.php
index 68e515da..a7101a02 100644
--- a/src/Wallabag/CoreBundle/Command/ListUserCommand.php
+++ b/src/Wallabag/CoreBundle/Command/ListUserCommand.php
@@ -50,7 +50,7 @@ class ListUserCommand extends ContainerAwareCommand
50 $io->success( 50 $io->success(
51 sprintf( 51 sprintf(
52 '%s/%s%s user(s) displayed.', 52 '%s/%s%s user(s) displayed.',
53 count($users), 53 \count($users),
54 $nbUsers, 54 $nbUsers,
55 null === $input->getArgument('search') ? '' : ' (filtered)' 55 null === $input->getArgument('search') ? '' : ' (filtered)'
56 ) 56 )
diff --git a/src/Wallabag/CoreBundle/Command/ReloadEntryCommand.php b/src/Wallabag/CoreBundle/Command/ReloadEntryCommand.php
index 91998841..10918872 100644
--- a/src/Wallabag/CoreBundle/Command/ReloadEntryCommand.php
+++ b/src/Wallabag/CoreBundle/Command/ReloadEntryCommand.php
@@ -43,7 +43,7 @@ class ReloadEntryCommand extends ContainerAwareCommand
43 $entryRepository = $this->getContainer()->get('wallabag_core.entry_repository'); 43 $entryRepository = $this->getContainer()->get('wallabag_core.entry_repository');
44 $entryIds = $entryRepository->findAllEntriesIdByUserId($userId); 44 $entryIds = $entryRepository->findAllEntriesIdByUserId($userId);
45 45
46 $nbEntries = count($entryIds); 46 $nbEntries = \count($entryIds);
47 if (!$nbEntries) { 47 if (!$nbEntries) {
48 $io->success('No entry to reload.'); 48 $io->success('No entry to reload.');
49 49