diff options
author | Jérémy Benoist <j0k3r@users.noreply.github.com> | 2017-07-03 13:39:54 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-03 13:39:54 +0200 |
commit | 71e1cbc8eb5928d393b0772055d6b711e90a09b3 (patch) | |
tree | 71795eadcf13fda9198b8cd9a3da26d51826bbd9 /src/Wallabag/ApiBundle | |
parent | 822c877949aff8ae57677671115f8f4fc69588d5 (diff) | |
parent | 38520658addc217f127b0627ea28dcf8d6e6178c (diff) | |
download | wallabag-71e1cbc8eb5928d393b0772055d6b711e90a09b3.tar.gz wallabag-71e1cbc8eb5928d393b0772055d6b711e90a09b3.tar.zst wallabag-71e1cbc8eb5928d393b0772055d6b711e90a09b3.zip |
Merge pull request #3258 from wallabag/cs-fixer
Add a real configuration for CS-Fixer
Diffstat (limited to 'src/Wallabag/ApiBundle')
8 files changed, 21 insertions, 21 deletions
diff --git a/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php b/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php index 2dd26c07..28d55ba9 100644 --- a/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php +++ b/src/Wallabag/ApiBundle/Controller/AnnotationRestController.php | |||
@@ -4,10 +4,10 @@ namespace Wallabag\ApiBundle\Controller; | |||
4 | 4 | ||
5 | use Nelmio\ApiDocBundle\Annotation\ApiDoc; | 5 | use Nelmio\ApiDocBundle\Annotation\ApiDoc; |
6 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; | 6 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\ParamConverter; |
7 | use Symfony\Component\HttpFoundation\Request; | ||
8 | use Symfony\Component\HttpFoundation\JsonResponse; | 7 | use Symfony\Component\HttpFoundation\JsonResponse; |
9 | use Wallabag\CoreBundle\Entity\Entry; | 8 | use Symfony\Component\HttpFoundation\Request; |
10 | use Wallabag\AnnotationBundle\Entity\Annotation; | 9 | use Wallabag\AnnotationBundle\Entity\Annotation; |
10 | use Wallabag\CoreBundle\Entity\Entry; | ||
11 | 11 | ||
12 | class AnnotationRestController extends WallabagRestController | 12 | class AnnotationRestController extends WallabagRestController |
13 | { | 13 | { |
diff --git a/src/Wallabag/ApiBundle/Controller/DeveloperController.php b/src/Wallabag/ApiBundle/Controller/DeveloperController.php index 9cb73f4c..c8a1c635 100644 --- a/src/Wallabag/ApiBundle/Controller/DeveloperController.php +++ b/src/Wallabag/ApiBundle/Controller/DeveloperController.php | |||
@@ -3,8 +3,8 @@ | |||
3 | namespace Wallabag\ApiBundle\Controller; | 3 | namespace Wallabag\ApiBundle\Controller; |
4 | 4 | ||
5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; | 5 | use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; |
6 | use Symfony\Component\HttpFoundation\Request; | ||
7 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; | 6 | use Symfony\Bundle\FrameworkBundle\Controller\Controller; |
7 | use Symfony\Component\HttpFoundation\Request; | ||
8 | use Wallabag\ApiBundle\Entity\Client; | 8 | use Wallabag\ApiBundle\Entity\Client; |
9 | use Wallabag\ApiBundle\Form\Type\ClientType; | 9 | use Wallabag\ApiBundle\Form\Type\ClientType; |
10 | 10 | ||
@@ -75,7 +75,7 @@ class DeveloperController extends Controller | |||
75 | */ | 75 | */ |
76 | public function deleteClientAction(Client $client) | 76 | public function deleteClientAction(Client $client) |
77 | { | 77 | { |
78 | if (null === $this->getUser() || $client->getUser()->getId() != $this->getUser()->getId()) { | 78 | if (null === $this->getUser() || $client->getUser()->getId() !== $this->getUser()->getId()) { |
79 | throw $this->createAccessDeniedException('You can not access this client.'); | 79 | throw $this->createAccessDeniedException('You can not access this client.'); |
80 | } | 80 | } |
81 | 81 | ||
diff --git a/src/Wallabag/ApiBundle/Controller/EntryRestController.php b/src/Wallabag/ApiBundle/Controller/EntryRestController.php index c7938633..ca460c84 100644 --- a/src/Wallabag/ApiBundle/Controller/EntryRestController.php +++ b/src/Wallabag/ApiBundle/Controller/EntryRestController.php | |||
@@ -6,14 +6,14 @@ use Hateoas\Configuration\Route; | |||
6 | use Hateoas\Representation\Factory\PagerfantaFactory; | 6 | use Hateoas\Representation\Factory\PagerfantaFactory; |
7 | use JMS\Serializer\SerializationContext; | 7 | use JMS\Serializer\SerializationContext; |
8 | use Nelmio\ApiDocBundle\Annotation\ApiDoc; | 8 | use Nelmio\ApiDocBundle\Annotation\ApiDoc; |
9 | use Symfony\Component\HttpKernel\Exception\HttpException; | ||
10 | use Symfony\Component\HttpFoundation\Request; | ||
11 | use Symfony\Component\HttpFoundation\JsonResponse; | 9 | use Symfony\Component\HttpFoundation\JsonResponse; |
10 | use Symfony\Component\HttpFoundation\Request; | ||
11 | use Symfony\Component\HttpKernel\Exception\HttpException; | ||
12 | use Symfony\Component\Routing\Generator\UrlGeneratorInterface; | 12 | use Symfony\Component\Routing\Generator\UrlGeneratorInterface; |
13 | use Wallabag\CoreBundle\Entity\Entry; | 13 | use Wallabag\CoreBundle\Entity\Entry; |
14 | use Wallabag\CoreBundle\Entity\Tag; | 14 | use Wallabag\CoreBundle\Entity\Tag; |
15 | use Wallabag\CoreBundle\Event\EntrySavedEvent; | ||
16 | use Wallabag\CoreBundle\Event\EntryDeletedEvent; | 15 | use Wallabag\CoreBundle\Event\EntryDeletedEvent; |
16 | use Wallabag\CoreBundle\Event\EntrySavedEvent; | ||
17 | 17 | ||
18 | class EntryRestController extends WallabagRestController | 18 | class EntryRestController extends WallabagRestController |
19 | { | 19 | { |
@@ -59,7 +59,7 @@ class EntryRestController extends WallabagRestController | |||
59 | $url = $request->query->get('url', ''); | 59 | $url = $request->query->get('url', ''); |
60 | 60 | ||
61 | if (empty($url)) { | 61 | if (empty($url)) { |
62 | throw $this->createAccessDeniedException('URL is empty?, logged user id: '.$this->getUser()->getId()); | 62 | throw $this->createAccessDeniedException('URL is empty?, logged user id: ' . $this->getUser()->getId()); |
63 | } | 63 | } |
64 | 64 | ||
65 | $res = $this->getDoctrine() | 65 | $res = $this->getDoctrine() |
@@ -239,9 +239,9 @@ class EntryRestController extends WallabagRestController | |||
239 | * } | 239 | * } |
240 | * ) | 240 | * ) |
241 | * | 241 | * |
242 | * @return JsonResponse | ||
243 | * | ||
244 | * @throws HttpException When limit is reached | 242 | * @throws HttpException When limit is reached |
243 | * | ||
244 | * @return JsonResponse | ||
245 | */ | 245 | */ |
246 | public function postEntriesListAction(Request $request) | 246 | public function postEntriesListAction(Request $request) |
247 | { | 247 | { |
@@ -678,11 +678,11 @@ class EntryRestController extends WallabagRestController | |||
678 | ]); | 678 | ]); |
679 | } | 679 | } |
680 | 680 | ||
681 | if (!is_null($isArchived)) { | 681 | if (null !== $isArchived) { |
682 | $entry->setArchived((bool) $isArchived); | 682 | $entry->setArchived((bool) $isArchived); |
683 | } | 683 | } |
684 | 684 | ||
685 | if (!is_null($isStarred)) { | 685 | if (null !== $isStarred) { |
686 | $entry->setStarred((bool) $isStarred); | 686 | $entry->setStarred((bool) $isStarred); |
687 | } | 687 | } |
688 | 688 | ||
@@ -690,7 +690,7 @@ class EntryRestController extends WallabagRestController | |||
690 | $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $tags); | 690 | $this->get('wallabag_core.tags_assigner')->assignTagsToEntry($entry, $tags); |
691 | } | 691 | } |
692 | 692 | ||
693 | if (!is_null($isPublic)) { | 693 | if (null !== $isPublic) { |
694 | if (true === (bool) $isPublic && null === $entry->getUid()) { | 694 | if (true === (bool) $isPublic && null === $entry->getUid()) { |
695 | $entry->generateUid(); | 695 | $entry->generateUid(); |
696 | } elseif (false === (bool) $isPublic) { | 696 | } elseif (false === (bool) $isPublic) { |
diff --git a/src/Wallabag/ApiBundle/Controller/TagRestController.php b/src/Wallabag/ApiBundle/Controller/TagRestController.php index 354187a0..efa4e8cf 100644 --- a/src/Wallabag/ApiBundle/Controller/TagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/TagRestController.php | |||
@@ -3,8 +3,8 @@ | |||
3 | namespace Wallabag\ApiBundle\Controller; | 3 | namespace Wallabag\ApiBundle\Controller; |
4 | 4 | ||
5 | use Nelmio\ApiDocBundle\Annotation\ApiDoc; | 5 | use Nelmio\ApiDocBundle\Annotation\ApiDoc; |
6 | use Symfony\Component\HttpFoundation\Request; | ||
7 | use Symfony\Component\HttpFoundation\JsonResponse; | 6 | use Symfony\Component\HttpFoundation\JsonResponse; |
7 | use Symfony\Component\HttpFoundation\Request; | ||
8 | use Wallabag\CoreBundle\Entity\Entry; | 8 | use Wallabag\CoreBundle\Entity\Entry; |
9 | use Wallabag\CoreBundle\Entity\Tag; | 9 | use Wallabag\CoreBundle\Entity\Tag; |
10 | 10 | ||
diff --git a/src/Wallabag/ApiBundle/Controller/UserRestController.php b/src/Wallabag/ApiBundle/Controller/UserRestController.php index 7471f5f6..6f47cff0 100644 --- a/src/Wallabag/ApiBundle/Controller/UserRestController.php +++ b/src/Wallabag/ApiBundle/Controller/UserRestController.php | |||
@@ -6,10 +6,10 @@ use FOS\UserBundle\Event\UserEvent; | |||
6 | use FOS\UserBundle\FOSUserEvents; | 6 | use FOS\UserBundle\FOSUserEvents; |
7 | use JMS\Serializer\SerializationContext; | 7 | use JMS\Serializer\SerializationContext; |
8 | use Nelmio\ApiDocBundle\Annotation\ApiDoc; | 8 | use Nelmio\ApiDocBundle\Annotation\ApiDoc; |
9 | use Symfony\Component\HttpFoundation\Request; | ||
10 | use Symfony\Component\HttpFoundation\JsonResponse; | 9 | use Symfony\Component\HttpFoundation\JsonResponse; |
11 | use Wallabag\UserBundle\Entity\User; | 10 | use Symfony\Component\HttpFoundation\Request; |
12 | use Wallabag\ApiBundle\Entity\Client; | 11 | use Wallabag\ApiBundle\Entity\Client; |
12 | use Wallabag\UserBundle\Entity\User; | ||
13 | 13 | ||
14 | class UserRestController extends WallabagRestController | 14 | class UserRestController extends WallabagRestController |
15 | { | 15 | { |
diff --git a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php index b1e08ca4..71da2a64 100644 --- a/src/Wallabag/ApiBundle/Controller/WallabagRestController.php +++ b/src/Wallabag/ApiBundle/Controller/WallabagRestController.php | |||
@@ -40,8 +40,8 @@ class WallabagRestController extends FOSRestController | |||
40 | protected function validateUserAccess($requestUserId) | 40 | protected function validateUserAccess($requestUserId) |
41 | { | 41 | { |
42 | $user = $this->get('security.token_storage')->getToken()->getUser(); | 42 | $user = $this->get('security.token_storage')->getToken()->getUser(); |
43 | if ($requestUserId != $user->getId()) { | 43 | if ($requestUserId !== $user->getId()) { |
44 | throw $this->createAccessDeniedException('Access forbidden. Entry user id: '.$requestUserId.', logged user id: '.$user->getId()); | 44 | throw $this->createAccessDeniedException('Access forbidden. Entry user id: ' . $requestUserId . ', logged user id: ' . $user->getId()); |
45 | } | 45 | } |
46 | } | 46 | } |
47 | } | 47 | } |
diff --git a/src/Wallabag/ApiBundle/Entity/Client.php b/src/Wallabag/ApiBundle/Entity/Client.php index c15fd3fa..e6f98f98 100644 --- a/src/Wallabag/ApiBundle/Entity/Client.php +++ b/src/Wallabag/ApiBundle/Entity/Client.php | |||
@@ -4,10 +4,10 @@ namespace Wallabag\ApiBundle\Entity; | |||
4 | 4 | ||
5 | use Doctrine\ORM\Mapping as ORM; | 5 | use Doctrine\ORM\Mapping as ORM; |
6 | use FOS\OAuthServerBundle\Entity\Client as BaseClient; | 6 | use FOS\OAuthServerBundle\Entity\Client as BaseClient; |
7 | use Wallabag\UserBundle\Entity\User; | ||
8 | use JMS\Serializer\Annotation\Groups; | 7 | use JMS\Serializer\Annotation\Groups; |
9 | use JMS\Serializer\Annotation\SerializedName; | 8 | use JMS\Serializer\Annotation\SerializedName; |
10 | use JMS\Serializer\Annotation\VirtualProperty; | 9 | use JMS\Serializer\Annotation\VirtualProperty; |
10 | use Wallabag\UserBundle\Entity\User; | ||
11 | 11 | ||
12 | /** | 12 | /** |
13 | * @ORM\Table("oauth2_clients") | 13 | * @ORM\Table("oauth2_clients") |
@@ -99,6 +99,6 @@ class Client extends BaseClient | |||
99 | */ | 99 | */ |
100 | public function getClientId() | 100 | public function getClientId() |
101 | { | 101 | { |
102 | return $this->getId().'_'.$this->getRandomId(); | 102 | return $this->getId() . '_' . $this->getRandomId(); |
103 | } | 103 | } |
104 | } | 104 | } |
diff --git a/src/Wallabag/ApiBundle/Form/Type/ClientType.php b/src/Wallabag/ApiBundle/Form/Type/ClientType.php index eaea4feb..fc22538f 100644 --- a/src/Wallabag/ApiBundle/Form/Type/ClientType.php +++ b/src/Wallabag/ApiBundle/Form/Type/ClientType.php | |||
@@ -5,8 +5,8 @@ namespace Wallabag\ApiBundle\Form\Type; | |||
5 | use Symfony\Component\Form\AbstractType; | 5 | use Symfony\Component\Form\AbstractType; |
6 | use Symfony\Component\Form\CallbackTransformer; | 6 | use Symfony\Component\Form\CallbackTransformer; |
7 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; | 7 | use Symfony\Component\Form\Extension\Core\Type\SubmitType; |
8 | use Symfony\Component\Form\Extension\Core\Type\UrlType; | ||
9 | use Symfony\Component\Form\Extension\Core\Type\TextType; | 8 | use Symfony\Component\Form\Extension\Core\Type\TextType; |
9 | use Symfony\Component\Form\Extension\Core\Type\UrlType; | ||
10 | use Symfony\Component\Form\FormBuilderInterface; | 10 | use Symfony\Component\Form\FormBuilderInterface; |
11 | use Symfony\Component\OptionsResolver\OptionsResolver; | 11 | use Symfony\Component\OptionsResolver\OptionsResolver; |
12 | 12 | ||