@@ -2,17 +2,10 @@ |
||
| 2 | 2 | |
| 3 | 3 | namespace LoginCidadao\NotificationBundle\Handler; |
| 4 | 4 | |
| 5 | -use Doctrine\Common\Persistence\ObjectManager; |
|
| 6 | -use Symfony\Component\Form\FormFactoryInterface; |
|
| 7 | 5 | use LoginCidadao\NotificationBundle\Handler\NotificationHandlerInterface; |
| 8 | -use LoginCidadao\NotificationBundle\Form\NotificationType; |
|
| 9 | -use LoginCidadao\NotificationBundle\Model\NotificationInterface; |
|
| 10 | -use LoginCidadao\NotificationBundle\Exception\InvalidFormException; |
|
| 11 | 6 | use LoginCidadao\CoreBundle\Model\PersonInterface; |
| 12 | 7 | use LoginCidadao\OAuthBundle\Model\ClientInterface; |
| 13 | 8 | use LoginCidadao\NotificationBundle\Model\CategoryInterface; |
| 14 | -use LoginCidadao\NotificationBundle\Entity\PersonNotificationOption; |
|
| 15 | -use LoginCidadao\NotificationBundle\Model\NotificationSettings; |
|
| 16 | 9 | use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException; |
| 17 | 10 | |
| 18 | 11 | class AuthenticatedNotificationHandler implements AuthenticatedNotificationHandlerInterface |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function getAllFromClient(ClientInterface $client, $limit = 5, |
| 48 | - $offset = 0, $orderby = null) |
|
| 48 | + $offset = 0, $orderby = null) |
|
| 49 | 49 | { |
| 50 | 50 | return $this->handler->getAllFromPersonByClient($this->person, $client, |
| 51 | 51 | $limit, $offset, |
@@ -78,10 +78,10 @@ discard block |
||
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | public function getGroupedSettings(ClientInterface $client = null, |
| 81 | - CategoryInterface $category = null) |
|
| 81 | + CategoryInterface $category = null) |
|
| 82 | 82 | { |
| 83 | 83 | return $this->handler->getGroupedSettings($this->person, $client, |
| 84 | - $category); |
|
| 84 | + $category); |
|
| 85 | 85 | } |
| 86 | 86 | |
| 87 | 87 | public function countUnread() |
@@ -10,12 +10,7 @@ |
||
| 10 | 10 | use LoginCidadao\NotificationBundle\Entity\Notification; |
| 11 | 11 | use LoginCidadao\NotificationBundle\Entity\Category; |
| 12 | 12 | use LoginCidadao\NotificationBundle\Exception\MissingCategoryException; |
| 13 | -use Symfony\Component\Serializer\Normalizer\GetSetMethodNormalizer; |
|
| 14 | -use Symfony\Component\Serializer\Encoder\JsonEncoder; |
|
| 15 | -use Symfony\Component\Serializer\Serializer; |
|
| 16 | -use LoginCidadao\NotificationBundle\Form\NotificationType; |
|
| 17 | 13 | use JMS\Serializer\SerializationContext; |
| 18 | -use LoginCidadao\NotificationBundle\Handler\NotificationHandler; |
|
| 19 | 14 | use LoginCidadao\NotificationBundle\Entity\Placeholder; |
| 20 | 15 | |
| 21 | 16 | class NotificationsHelper |
@@ -3,7 +3,6 @@ |
||
| 3 | 3 | namespace LoginCidadao\NotificationBundle\Model; |
| 4 | 4 | |
| 5 | 5 | use LoginCidadao\NotificationBundle\Entity\Placeholder; |
| 6 | -use Doctrine\Common\Collections\ArrayCollection; |
|
| 7 | 6 | use Doctrine\ORM\EntityManager; |
| 8 | 7 | |
| 9 | 8 | class BroadcastPlaceholder |
@@ -34,13 +34,13 @@ |
||
| 34 | 34 | |
| 35 | 35 | public function getValue() |
| 36 | 36 | { |
| 37 | - return $this->value; |
|
| 37 | + return $this->value; |
|
| 38 | 38 | } |
| 39 | 39 | |
| 40 | 40 | public function setValue($value) |
| 41 | 41 | { |
| 42 | - $this->value = $value; |
|
| 43 | - return $this; |
|
| 42 | + $this->value = $value; |
|
| 43 | + return $this; |
|
| 44 | 44 | } |
| 45 | 45 | |
| 46 | 46 | public function getName() |
@@ -8,7 +8,6 @@ |
||
| 8 | 8 | use LoginCidadao\NotificationBundle\Entity\Notification; |
| 9 | 9 | use Symfony\Component\HttpFoundation\File\File; |
| 10 | 10 | use Symfony\Component\Validator\Constraints as Assert; |
| 11 | -use JMS\Serializer\Tests\Fixtures\Publisher; |
|
| 12 | 11 | use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity; |
| 13 | 12 | use JMS\Serializer\Annotation as JMS; |
| 14 | 13 | use OAuth2\OAuth2; |
@@ -52,7 +52,7 @@ discard block |
||
| 52 | 52 | * @return array |
| 53 | 53 | */ |
| 54 | 54 | public function getNotificationsAction(Request $request, |
| 55 | - ParamFetcherInterface $paramFetcher) |
|
| 55 | + ParamFetcherInterface $paramFetcher) |
|
| 56 | 56 | { |
| 57 | 57 | $offset = $paramFetcher->get('offset'); |
| 58 | 58 | $offset = null == $offset ? 0 : $offset; |
@@ -64,13 +64,13 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | if (array_search('get_all_notifications', $scopes) === false) { |
| 66 | 66 | $notifications = $this->getNotificationHandler()->getAllFromPersonByClient($person, |
| 67 | - $client, |
|
| 68 | - $limit, |
|
| 69 | - $offset); |
|
| 67 | + $client, |
|
| 68 | + $limit, |
|
| 69 | + $offset); |
|
| 70 | 70 | } else { |
| 71 | 71 | $notifications = $this->getNotificationHandler()->getAllFromPerson($person, |
| 72 | - $limit, |
|
| 73 | - $offset); |
|
| 72 | + $limit, |
|
| 73 | + $offset); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | return $this->renderWithContext($notifications); |
@@ -192,7 +192,7 @@ discard block |
||
| 192 | 192 | $user = $token->getUser(); |
| 193 | 193 | if ($user instanceof ClientUser) { |
| 194 | 194 | return $this->validateNotificationAsClient($user->getClient(), |
| 195 | - $request); |
|
| 195 | + $request); |
|
| 196 | 196 | } elseif ($user instanceof PersonInterface) { |
| 197 | 197 | return $this->validateNotificationAsPerson($user, $request); |
| 198 | 198 | } else { |
@@ -81,7 +81,7 @@ |
||
| 81 | 81 | * @return \Doctrine\ORM\QueryBuilder |
| 82 | 82 | */ |
| 83 | 83 | private function getImpersonatonsWithoutReportsQuery($limit = null, |
| 84 | - PersonInterface $impersonator |
|
| 84 | + PersonInterface $impersonator |
|
| 85 | 85 | = null) |
| 86 | 86 | { |
| 87 | 87 | $query = $this->createQueryBuilder('l') |
@@ -36,7 +36,7 @@ |
||
| 36 | 36 | foreach ($this->reader->getMethodAnnotations($method) as $annotation) { |
| 37 | 37 | if ($annotation instanceof Loggable) { |
| 38 | 38 | $this->logger->logActivity($event->getRequest(), $annotation, |
| 39 | - $controller); |
|
| 39 | + $controller); |
|
| 40 | 40 | } |
| 41 | 41 | } |
| 42 | 42 | } |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | * @return ActionLog |
| 91 | 91 | */ |
| 92 | 92 | private function initLog(Request $request, $actionType, $controllerAction, |
| 93 | - $auditUsername) |
|
| 93 | + $auditUsername) |
|
| 94 | 94 | { |
| 95 | 95 | $controller = get_class($controllerAction[0]); |
| 96 | 96 | $action = $controllerAction[1]; |
@@ -124,7 +124,7 @@ discard block |
||
| 124 | 124 | } |
| 125 | 125 | |
| 126 | 126 | public function registerLogin(Request $request, PersonInterface $person, |
| 127 | - array $controllerAction) |
|
| 127 | + array $controllerAction) |
|
| 128 | 128 | { |
| 129 | 129 | $auditUsername = $this->auditConfig->getCurrentUsername(); |
| 130 | 130 | $actionType = ActionLog::TYPE_LOGIN; |
@@ -23,12 +23,12 @@ discard block |
||
| 23 | 23 | $result = array(); |
| 24 | 24 | if (is_numeric($id)) { |
| 25 | 25 | $result = $this->getDoctrine() |
| 26 | - ->getManager () |
|
| 26 | + ->getManager() |
|
| 27 | 27 | ->getRepository('LoginCidadaoCoreBundle:State') |
| 28 | 28 | ->createQueryBuilder('u') |
| 29 | 29 | ->select('u.id, u.name') |
| 30 | 30 | ->where('u.country = :country') |
| 31 | - ->andWhere('u.reviewed = ' . State::REVIEWED_OK) |
|
| 31 | + ->andWhere('u.reviewed = '.State::REVIEWED_OK) |
|
| 32 | 32 | ->setParameters(array('country' => new Country($id))) |
| 33 | 33 | ->orderBy('u.name', 'ASC') |
| 34 | 34 | ->getQuery() |
@@ -46,12 +46,12 @@ discard block |
||
| 46 | 46 | $result = array(); |
| 47 | 47 | if (is_numeric($id)) { |
| 48 | 48 | $result = $this->getDoctrine() |
| 49 | - ->getManager () |
|
| 49 | + ->getManager() |
|
| 50 | 50 | ->getRepository('LoginCidadaoCoreBundle:City') |
| 51 | 51 | ->createQueryBuilder('u') |
| 52 | 52 | ->select('u.id, u.name') |
| 53 | 53 | ->where('u.state = :state') |
| 54 | - ->andWhere('u.reviewed = ' . City::REVIEWED_OK) |
|
| 54 | + ->andWhere('u.reviewed = '.City::REVIEWED_OK) |
|
| 55 | 55 | ->setParameters(array('state' => new State($id))) |
| 56 | 56 | ->orderBy('u.name', 'ASC') |
| 57 | 57 | ->getQuery() |