diff options
Diffstat (limited to 'src/Wallabag/CoreBundle')
14 files changed, 15 insertions, 15 deletions
diff --git a/src/Wallabag/CoreBundle/Command/ListUserCommand.php b/src/Wallabag/CoreBundle/Command/ListUserCommand.php index 20660d18..68e515da 100644 --- a/src/Wallabag/CoreBundle/Command/ListUserCommand.php +++ b/src/Wallabag/CoreBundle/Command/ListUserCommand.php | |||
@@ -52,7 +52,7 @@ class ListUserCommand extends ContainerAwareCommand | |||
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 | $input->getArgument('search') === null ? '' : ' (filtered)' | 55 | null === $input->getArgument('search') ? '' : ' (filtered)' |
56 | ) | 56 | ) |
57 | ); | 57 | ); |
58 | 58 | ||
diff --git a/src/Wallabag/CoreBundle/Command/ShowUserCommand.php b/src/Wallabag/CoreBundle/Command/ShowUserCommand.php index 2dca32c4..a0184267 100644 --- a/src/Wallabag/CoreBundle/Command/ShowUserCommand.php +++ b/src/Wallabag/CoreBundle/Command/ShowUserCommand.php | |||
@@ -56,7 +56,7 @@ class ShowUserCommand extends ContainerAwareCommand | |||
56 | sprintf('Email: %s', $user->getEmail()), | 56 | sprintf('Email: %s', $user->getEmail()), |
57 | sprintf('Display name: %s', $user->getName()), | 57 | sprintf('Display name: %s', $user->getName()), |
58 | sprintf('Creation date: %s', $user->getCreatedAt()->format('Y-m-d H:i:s')), | 58 | sprintf('Creation date: %s', $user->getCreatedAt()->format('Y-m-d H:i:s')), |
59 | sprintf('Last login: %s', $user->getLastLogin() !== null ? $user->getLastLogin()->format('Y-m-d H:i:s') : 'never'), | 59 | sprintf('Last login: %s', null !== $user->getLastLogin() ? $user->getLastLogin()->format('Y-m-d H:i:s') : 'never'), |
60 | sprintf('2FA activated: %s', $user->isTwoFactorAuthentication() ? 'yes' : 'no'), | 60 | sprintf('2FA activated: %s', $user->isTwoFactorAuthentication() ? 'yes' : 'no'), |
61 | ]); | 61 | ]); |
62 | } | 62 | } |
diff --git a/src/Wallabag/CoreBundle/Controller/ConfigController.php b/src/Wallabag/CoreBundle/Controller/ConfigController.php index 7e39992d..a89bb780 100644 --- a/src/Wallabag/CoreBundle/Controller/ConfigController.php +++ b/src/Wallabag/CoreBundle/Controller/ConfigController.php | |||
@@ -348,7 +348,7 @@ class ConfigController extends Controller | |||
348 | $em = $this->getDoctrine()->getManager(); | 348 | $em = $this->getDoctrine()->getManager(); |
349 | 349 | ||
350 | foreach ($tags as $tag) { | 350 | foreach ($tags as $tag) { |
351 | if (count($tag->getEntries()) === 0) { | 351 | if (0 === count($tag->getEntries())) { |
352 | $em->remove($tag); | 352 | $em->remove($tag); |
353 | } | 353 | } |
354 | } | 354 | } |
diff --git a/src/Wallabag/CoreBundle/Controller/EntryController.php b/src/Wallabag/CoreBundle/Controller/EntryController.php index b0b74c38..840dc254 100644 --- a/src/Wallabag/CoreBundle/Controller/EntryController.php +++ b/src/Wallabag/CoreBundle/Controller/EntryController.php | |||
@@ -195,7 +195,7 @@ class EntryController extends Controller | |||
195 | public function showUnreadAction(Request $request, $page) | 195 | public function showUnreadAction(Request $request, $page) |
196 | { | 196 | { |
197 | // load the quickstart if no entry in database | 197 | // load the quickstart if no entry in database |
198 | if ((int) $page === 1 && $this->get('wallabag_core.entry_repository')->countAllEntriesByUser($this->getUser()->getId()) === 0) { | 198 | if (1 === (int) $page && 0 === $this->get('wallabag_core.entry_repository')->countAllEntriesByUser($this->getUser()->getId())) { |
199 | return $this->redirect($this->generateUrl('quickstart')); | 199 | return $this->redirect($this->generateUrl('quickstart')); |
200 | } | 200 | } |
201 | 201 | ||
diff --git a/src/Wallabag/CoreBundle/Controller/ExportController.php b/src/Wallabag/CoreBundle/Controller/ExportController.php index 35a22046..7ca89239 100644 --- a/src/Wallabag/CoreBundle/Controller/ExportController.php +++ b/src/Wallabag/CoreBundle/Controller/ExportController.php | |||
@@ -59,7 +59,7 @@ class ExportController extends Controller | |||
59 | $methodBuilder = 'getBuilderFor' . $method . 'ByUser'; | 59 | $methodBuilder = 'getBuilderFor' . $method . 'ByUser'; |
60 | $repository = $this->get('wallabag_core.entry_repository'); | 60 | $repository = $this->get('wallabag_core.entry_repository'); |
61 | 61 | ||
62 | if ($category === 'tag_entries') { | 62 | if ('tag_entries' === $category) { |
63 | $tag = $this->get('wallabag_core.tag_repository')->findOneBySlug($request->query->get('tag')); | 63 | $tag = $this->get('wallabag_core.tag_repository')->findOneBySlug($request->query->get('tag')); |
64 | 64 | ||
65 | $entries = $repository->findAllByTagId( | 65 | $entries = $repository->findAllByTagId( |
diff --git a/src/Wallabag/CoreBundle/Controller/TagController.php b/src/Wallabag/CoreBundle/Controller/TagController.php index be2dff98..616c37f2 100644 --- a/src/Wallabag/CoreBundle/Controller/TagController.php +++ b/src/Wallabag/CoreBundle/Controller/TagController.php | |||
@@ -65,7 +65,7 @@ class TagController extends Controller | |||
65 | $em->flush(); | 65 | $em->flush(); |
66 | 66 | ||
67 | // remove orphan tag in case no entries are associated to it | 67 | // remove orphan tag in case no entries are associated to it |
68 | if (count($tag->getEntries()) === 0) { | 68 | if (0 === count($tag->getEntries())) { |
69 | $em->remove($tag); | 69 | $em->remove($tag); |
70 | $em->flush(); | 70 | $em->flush(); |
71 | } | 71 | } |
diff --git a/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php b/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php index 35902654..fb8f225f 100644 --- a/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php +++ b/src/Wallabag/CoreBundle/Event/Subscriber/TablePrefixSubscriber.php | |||
@@ -42,7 +42,7 @@ class TablePrefixSubscriber implements EventSubscriber | |||
42 | $classMetadata->setPrimaryTable(['name' => $this->prefix . $classMetadata->getTableName()]); | 42 | $classMetadata->setPrimaryTable(['name' => $this->prefix . $classMetadata->getTableName()]); |
43 | 43 | ||
44 | foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) { | 44 | foreach ($classMetadata->getAssociationMappings() as $fieldName => $mapping) { |
45 | if ($mapping['type'] === ClassMetadataInfo::MANY_TO_MANY && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) { | 45 | if (ClassMetadataInfo::MANY_TO_MANY === $mapping['type'] && isset($classMetadata->associationMappings[$fieldName]['joinTable']['name'])) { |
46 | $mappedTableName = $classMetadata->associationMappings[$fieldName]['joinTable']['name']; | 46 | $mappedTableName = $classMetadata->associationMappings[$fieldName]['joinTable']['name']; |
47 | $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->prefix . $mappedTableName; | 47 | $classMetadata->associationMappings[$fieldName]['joinTable']['name'] = $this->prefix . $mappedTableName; |
48 | } | 48 | } |
diff --git a/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php b/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php index cb4bee83..57dbc95e 100644 --- a/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php +++ b/src/Wallabag/CoreBundle/Form/DataTransformer/StringToListTransformer.php | |||
@@ -48,7 +48,7 @@ class StringToListTransformer implements DataTransformerInterface | |||
48 | */ | 48 | */ |
49 | public function reverseTransform($string) | 49 | public function reverseTransform($string) |
50 | { | 50 | { |
51 | if ($string === null) { | 51 | if (null === $string) { |
52 | return; | 52 | return; |
53 | } | 53 | } |
54 | 54 | ||
diff --git a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php index da19fe31..2c85da62 100644 --- a/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php +++ b/src/Wallabag/CoreBundle/GuzzleSiteAuthenticator/GrabySiteConfigBuilder.php | |||
@@ -58,7 +58,7 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder | |||
58 | { | 58 | { |
59 | // required by credentials below | 59 | // required by credentials below |
60 | $host = strtolower($host); | 60 | $host = strtolower($host); |
61 | if (substr($host, 0, 4) === 'www.') { | 61 | if ('www.' === substr($host, 0, 4)) { |
62 | $host = substr($host, 4); | 62 | $host = substr($host, 4); |
63 | } | 63 | } |
64 | 64 | ||
@@ -113,7 +113,7 @@ class GrabySiteConfigBuilder implements SiteConfigBuilder | |||
113 | 113 | ||
114 | $extraFields = []; | 114 | $extraFields = []; |
115 | foreach ($extraFieldsStrings as $extraField) { | 115 | foreach ($extraFieldsStrings as $extraField) { |
116 | if (strpos($extraField, '=') === false) { | 116 | if (false === strpos($extraField, '=')) { |
117 | continue; | 117 | continue; |
118 | } | 118 | } |
119 | 119 | ||
diff --git a/src/Wallabag/CoreBundle/Helper/ContentProxy.php b/src/Wallabag/CoreBundle/Helper/ContentProxy.php index 1ac7ad83..854acb6a 100644 --- a/src/Wallabag/CoreBundle/Helper/ContentProxy.php +++ b/src/Wallabag/CoreBundle/Helper/ContentProxy.php | |||
@@ -125,7 +125,7 @@ class ContentProxy | |||
125 | $date = $value; | 125 | $date = $value; |
126 | 126 | ||
127 | // is it a timestamp? | 127 | // is it a timestamp? |
128 | if (filter_var($date, FILTER_VALIDATE_INT) !== false) { | 128 | if (false !== filter_var($date, FILTER_VALIDATE_INT)) { |
129 | $date = '@' . $date; | 129 | $date = '@' . $date; |
130 | } | 130 | } |
131 | 131 | ||
diff --git a/src/Wallabag/CoreBundle/Operator/Doctrine/Matches.php b/src/Wallabag/CoreBundle/Operator/Doctrine/Matches.php index e6bb03b1..e1610161 100644 --- a/src/Wallabag/CoreBundle/Operator/Doctrine/Matches.php +++ b/src/Wallabag/CoreBundle/Operator/Doctrine/Matches.php | |||
@@ -16,7 +16,7 @@ class Matches | |||
16 | { | 16 | { |
17 | public function __invoke($subject, $pattern) | 17 | public function __invoke($subject, $pattern) |
18 | { | 18 | { |
19 | if ($pattern[0] === "'") { | 19 | if ("'" === $pattern[0]) { |
20 | $pattern = sprintf("'%%%s%%'", substr($pattern, 1, -1)); | 20 | $pattern = sprintf("'%%%s%%'", substr($pattern, 1, -1)); |
21 | } | 21 | } |
22 | 22 | ||
diff --git a/src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php b/src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php index b7f9da57..8e50f8d6 100644 --- a/src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php +++ b/src/Wallabag/CoreBundle/Operator/Doctrine/NotMatches.php | |||
@@ -16,7 +16,7 @@ class NotMatches | |||
16 | { | 16 | { |
17 | public function __invoke($subject, $pattern) | 17 | public function __invoke($subject, $pattern) |
18 | { | 18 | { |
19 | if ($pattern[0] === "'") { | 19 | if ("'" === $pattern[0]) { |
20 | $pattern = sprintf("'%%%s%%'", substr($pattern, 1, -1)); | 20 | $pattern = sprintf("'%%%s%%'", substr($pattern, 1, -1)); |
21 | } | 21 | } |
22 | 22 | ||
diff --git a/src/Wallabag/CoreBundle/Operator/PHP/Matches.php b/src/Wallabag/CoreBundle/Operator/PHP/Matches.php index 987ed2a5..bc0c3f8f 100644 --- a/src/Wallabag/CoreBundle/Operator/PHP/Matches.php +++ b/src/Wallabag/CoreBundle/Operator/PHP/Matches.php | |||
@@ -16,6 +16,6 @@ class Matches | |||
16 | { | 16 | { |
17 | public function __invoke($subject, $pattern) | 17 | public function __invoke($subject, $pattern) |
18 | { | 18 | { |
19 | return stripos($subject, $pattern) !== false; | 19 | return false !== stripos($subject, $pattern); |
20 | } | 20 | } |
21 | } | 21 | } |
diff --git a/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php b/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php index 68b2676f..bd4d887a 100644 --- a/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php +++ b/src/Wallabag/CoreBundle/Operator/PHP/NotMatches.php | |||
@@ -16,6 +16,6 @@ class NotMatches | |||
16 | { | 16 | { |
17 | public function __invoke($subject, $pattern) | 17 | public function __invoke($subject, $pattern) |
18 | { | 18 | { |
19 | return stripos($subject, $pattern) === false; | 19 | return false === stripos($subject, $pattern); |
20 | } | 20 | } |
21 | } | 21 | } |