diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2018-09-05 16:38:20 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-09-05 16:38:20 +0000 |
commit | ada5d5b2694ec95c6ca84aa91f22add1973343e0 (patch) | |
tree | df0b695eb99e96dc55b63b27a404080c23421639 /src/Wallabag/ApiBundle | |
parent | 685a5d745e2b723a09111d7d31157cced67ea9b4 (diff) | |
parent | 2a1ceb67b4400f46f4d3067e887ff54aa906f0a2 (diff) | |
download | wallabag-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/ApiBundle')
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/EntryRestController.php | 8 | ||||
-rw-r--r-- | src/Wallabag/ApiBundle/Controller/TagRestController.php | 4 |
2 files changed, 6 insertions, 6 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index fc47c479..0b4e74a0 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php | |||
@@ -102,7 +102,7 @@ class EntryRestController extends WallabagRestController | |||
102 | $order = $request->query->get('order', 'desc'); | 102 | $order = $request->query->get('order', 'desc'); |
103 | $page = (int) $request->query->get('page', 1); | 103 | $page = (int) $request->query->get('page', 1); |
104 | $perPage = (int) $request->query->get('perPage', 30); | 104 | $perPage = (int) $request->query->get('perPage', 30); |
105 | $tags = is_array($request->query->get('tags')) ? '' : (string) $request->query->get('tags', ''); | 105 | $tags = \is_array($request->query->get('tags')) ? '' : (string) $request->query->get('tags', ''); |
106 | $since = $request->query->get('since', 0); | 106 | $since = $request->query->get('since', 0); |
107 | 107 | ||
108 | /** @var \Pagerfanta\Pagerfanta $pager */ | 108 | /** @var \Pagerfanta\Pagerfanta $pager */ |
@@ -253,7 +253,7 @@ class EntryRestController extends WallabagRestController | |||
253 | 253 | ||
254 | $limit = $this->container->getParameter('wallabag_core.api_limit_mass_actions'); | 254 | $limit = $this->container->getParameter('wallabag_core.api_limit_mass_actions'); |
255 | 255 | ||
256 | if (count($urls) > $limit) { | 256 | if (\count($urls) > $limit) { |
257 | throw new HttpException(400, 'API limit reached'); | 257 | throw new HttpException(400, 'API limit reached'); |
258 | } | 258 | } |
259 | 259 | ||
@@ -347,7 +347,7 @@ class EntryRestController extends WallabagRestController | |||
347 | 'open_graph' => [ | 347 | 'open_graph' => [ |
348 | 'og_image' => !empty($data['picture']) ? $data['picture'] : $entry->getPreviewPicture(), | 348 | 'og_image' => !empty($data['picture']) ? $data['picture'] : $entry->getPreviewPicture(), |
349 | ], | 349 | ], |
350 | 'authors' => is_string($data['authors']) ? explode(',', $data['authors']) : $entry->getPublishedBy(), | 350 | 'authors' => \is_string($data['authors']) ? explode(',', $data['authors']) : $entry->getPublishedBy(), |
351 | ] | 351 | ] |
352 | ); | 352 | ); |
353 | } catch (\Exception $e) { | 353 | } catch (\Exception $e) { |
@@ -461,7 +461,7 @@ class EntryRestController extends WallabagRestController | |||
461 | $contentProxy->updateLanguage($entry, $data['language']); | 461 | $contentProxy->updateLanguage($entry, $data['language']); |
462 | } | 462 | } |
463 | 463 | ||
464 | if (!empty($data['authors']) && is_string($data['authors'])) { | 464 | if (!empty($data['authors']) && \is_string($data['authors'])) { |
465 | $entry->setPublishedBy(explode(',', $data['authors'])); | 465 | $entry->setPublishedBy(explode(',', $data['authors'])); |
466 | } | 466 | } |
467 | 467 | ||
diff --git a/src/Wallabag/ApiBundle/Controller/TagRestController.php b/src/Wallabag/ApiBundle/Controller/TagRestController.php index 9d333fe4..c6d6df6a 100644 --- a/src/Wallabag/ApiBundle/Controller/TagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/TagRestController.php | |||
@@ -138,14 +138,14 @@ class TagRestController extends WallabagRestController | |||
138 | */ | 138 | */ |
139 | private function cleanOrphanTag($tags) | 139 | private function cleanOrphanTag($tags) |
140 | { | 140 | { |
141 | if (!is_array($tags)) { | 141 | if (!\is_array($tags)) { |
142 | $tags = [$tags]; | 142 | $tags = [$tags]; |
143 | } | 143 | } |
144 | 144 | ||
145 | $em = $this->getDoctrine()->getManager(); | 145 | $em = $this->getDoctrine()->getManager(); |
146 | 146 | ||
147 | foreach ($tags as $tag) { | 147 | foreach ($tags as $tag) { |
148 | if (0 === count($tag->getEntries())) { | 148 | if (0 === \count($tag->getEntries())) { |
149 | $em->remove($tag); | 149 | $em->remove($tag); |
150 | } | 150 | } |
151 | } | 151 | } |