@@ -59,10 +59,10 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | $service = $response->getResourceOwner()->getName(); |
| 61 | 61 | |
| 62 | - $setter = 'set' . ucfirst($service); |
|
| 63 | - $setter_id = $setter . 'Id'; |
|
| 64 | - $setter_token = $setter . 'AccessToken'; |
|
| 65 | - $setter_username = $setter . 'Username'; |
|
| 62 | + $setter = 'set'.ucfirst($service); |
|
| 63 | + $setter_id = $setter.'Id'; |
|
| 64 | + $setter_token = $setter.'AccessToken'; |
|
| 65 | + $setter_username = $setter.'Username'; |
|
| 66 | 66 | |
| 67 | 67 | if (null !== $previousUser = $this->userManager->findUserBy(array("{$service}Id" => $username))) { |
| 68 | 68 | throw new AlreadyLinkedAccount(); |
@@ -91,10 +91,10 @@ discard block |
||
| 91 | 91 | |
| 92 | 92 | |
| 93 | 93 | $service = $response->getResourceOwner()->getName(); |
| 94 | - $setter = 'set' . ucfirst($service); |
|
| 95 | - $setter_id = $setter . 'Id'; |
|
| 96 | - $setter_token = $setter . 'AccessToken'; |
|
| 97 | - $setter_username = $setter . 'Username'; |
|
| 94 | + $setter = 'set'.ucfirst($service); |
|
| 95 | + $setter_id = $setter.'Id'; |
|
| 96 | + $setter_token = $setter.'AccessToken'; |
|
| 97 | + $setter_username = $setter.'Username'; |
|
| 98 | 98 | |
| 99 | 99 | $newUser = false; |
| 100 | 100 | $user = $this->userManager->findUserBy(array("{$service}Id" => $username)); |
@@ -169,7 +169,7 @@ discard block |
||
| 169 | 169 | $user = parent::loadUserByOAuthUserResponse($response); |
| 170 | 170 | |
| 171 | 171 | $serviceName = $response->getResourceOwner()->getName(); |
| 172 | - $setter = 'set' . ucfirst($serviceName) . 'AccessToken'; |
|
| 172 | + $setter = 'set'.ucfirst($serviceName).'AccessToken'; |
|
| 173 | 173 | |
| 174 | 174 | $user->$setter($response->getAccessToken()); |
| 175 | 175 | |
@@ -66,13 +66,13 @@ |
||
| 66 | 66 | |
| 67 | 67 | public function formatCep($var) |
| 68 | 68 | { |
| 69 | - $var = substr($var, 0, 5) . '-' . substr($var, 5, 3); |
|
| 69 | + $var = substr($var, 0, 5).'-'.substr($var, 5, 3); |
|
| 70 | 70 | return $var; |
| 71 | 71 | } |
| 72 | 72 | |
| 73 | 73 | public function formatCpf($var) |
| 74 | 74 | { |
| 75 | - $var = substr($var, 0, 3). '.'. substr($var, 3, 3). '.' . substr($var, 6, 3) . '-' . substr($var, 9); |
|
| 75 | + $var = substr($var, 0, 3).'.'.substr($var, 3, 3).'.'.substr($var, 6, 3).'-'.substr($var, 9); |
|
| 76 | 76 | return $var; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | public function fragmentAction($name) |
| 15 | 15 | { |
| 16 | 16 | return $this->render('LoginCidadaoInfiniteScrollBundle:Default:index.html.twig', |
| 17 | - array('name' => $name)); |
|
| 17 | + array('name' => $name)); |
|
| 18 | 18 | } |
| 19 | 19 | |
| 20 | 20 | /** |
@@ -29,9 +29,9 @@ |
||
| 29 | 29 | |
| 30 | 30 | foreach ($iterator as $notifications) { |
| 31 | 31 | foreach ($notifications as $notification) { |
| 32 | - echo $notification->getId() . PHP_EOL; |
|
| 32 | + echo $notification->getId().PHP_EOL; |
|
| 33 | 33 | } |
| 34 | - echo '-----' . PHP_EOL; |
|
| 34 | + echo '-----'.PHP_EOL; |
|
| 35 | 35 | } |
| 36 | 36 | die(); |
| 37 | 37 | } |
@@ -140,7 +140,7 @@ |
||
| 140 | 140 | } |
| 141 | 141 | |
| 142 | 142 | private function getNotificationGrid($offset = 0, $perIteration = 10, |
| 143 | - ClientInterface $client = null) |
|
| 143 | + ClientInterface $client = null) |
|
| 144 | 144 | { |
| 145 | 145 | $handler = $this->getAuthenticatedNotificationHandler(); |
| 146 | 146 | if ($client instanceof ClientInterface) { |
@@ -157,9 +157,9 @@ |
||
| 157 | 157 | // } |
| 158 | 158 | |
| 159 | 159 | public function setHtmlTemplate(ArrayCollection $placeholders, $title, $shortText) { |
| 160 | - $this->htmlTemplate = NotificationHandler::renderHtmlByCategory($this->getCategory(), $placeholders, $title, $shortText); |
|
| 161 | - $this->mailTemplate = NotificationHandler::renderHtmlByCategory($this->getCategory(), $placeholders, $title, $shortText); |
|
| 162 | - return $this; |
|
| 160 | + $this->htmlTemplate = NotificationHandler::renderHtmlByCategory($this->getCategory(), $placeholders, $title, $shortText); |
|
| 161 | + $this->mailTemplate = NotificationHandler::renderHtmlByCategory($this->getCategory(), $placeholders, $title, $shortText); |
|
| 162 | + return $this; |
|
| 163 | 163 | } |
| 164 | 164 | |
| 165 | 165 | public function setMailTemplate($var) { |
@@ -4,10 +4,7 @@ |
||
| 4 | 4 | |
| 5 | 5 | use Doctrine\ORM\Mapping as ORM; |
| 6 | 6 | use Doctrine\Common\Collections\ArrayCollection; |
| 7 | -use LoginCidadao\OAuthBundle\Entity\Client; |
|
| 8 | 7 | use LoginCidadao\CoreBundle\Entity\Person; |
| 9 | -use Symfony\Component\Validator\Constraints as Assert; |
|
| 10 | -use JMS\Serializer\Annotation as JMS; |
|
| 11 | 8 | use LoginCidadao\NotificationBundle\Handler\NotificationHandler; |
| 12 | 9 | |
| 13 | 10 | /** |
@@ -11,7 +11,7 @@ discard block |
||
| 11 | 11 | { |
| 12 | 12 | |
| 13 | 13 | public function findUnconfigured(PersonInterface $person, |
| 14 | - ClientInterface $client = null) |
|
| 14 | + ClientInterface $client = null) |
|
| 15 | 15 | { |
| 16 | 16 | $qb = $this->getEntityManager()->createQueryBuilder() |
| 17 | 17 | ->select('c') |
@@ -19,7 +19,7 @@ discard block |
||
| 19 | 19 | ->innerJoin('LoginCidadaoCoreBundle:Authorization', 'a', |
| 20 | 20 | 'WITH', 'a.client = c.client AND a.person = :person') |
| 21 | 21 | ->leftJoin('LoginCidadaoNotificationBundle:PersonNotificationOption', |
| 22 | - 'o', 'WITH', 'o.category = c AND a.person = o.person') |
|
| 22 | + 'o', 'WITH', 'o.category = c AND a.person = o.person') |
|
| 23 | 23 | ->where('o is null') |
| 24 | 24 | ->setParameter('person', $person); |
| 25 | 25 | |
@@ -19,7 +19,7 @@ |
||
| 19 | 19 | ->getRepository('LoginCidadaoNotificationBundle:FailedCallback') |
| 20 | 20 | ->createQueryBuilder('f') |
| 21 | 21 | ->join('LoginCidadaoNotificationBundle:Notification', 'n', |
| 22 | - 'WITH', 'f.notification = n') |
|
| 22 | + 'WITH', 'f.notification = n') |
|
| 23 | 23 | ->where('n.sender = :client') |
| 24 | 24 | ->setParameter('client', $client); |
| 25 | 25 | return $qb->getQuery()->getResult(); |
@@ -19,9 +19,9 @@ discard block |
||
| 19 | 19 | $qb = $this->getEntityManager()->createQueryBuilder() |
| 20 | 20 | ->select('s') |
| 21 | 21 | ->from('LoginCidadaoNotificationBundle:PersonNotificationOption', |
| 22 | - 's') |
|
| 22 | + 's') |
|
| 23 | 23 | ->join('LoginCidadaoNotificationBundle:Category', 'c', |
| 24 | - 'WITH', 's.category = c') |
|
| 24 | + 'WITH', 's.category = c') |
|
| 25 | 25 | ->innerJoin('LoginCidadaoOAuthBundle:Client', 'cli', 'WITH', |
| 26 | 26 | 'c.client = cli') |
| 27 | 27 | ->innerJoin('LoginCidadaoCoreBundle:Authorization', 'a', |
@@ -31,14 +31,14 @@ discard block |
||
| 31 | 31 | } |
| 32 | 32 | |
| 33 | 33 | public function findByClient(PersonInterface $person, |
| 34 | - ClientInterface $client) |
|
| 34 | + ClientInterface $client) |
|
| 35 | 35 | { |
| 36 | 36 | return $this->findByPerson($person, null, $client); |
| 37 | 37 | } |
| 38 | 38 | |
| 39 | 39 | public function findByPerson(PersonInterface $person, |
| 40 | - CategoryInterface $category = null, |
|
| 41 | - ClientInterface $client = null) |
|
| 40 | + CategoryInterface $category = null, |
|
| 41 | + ClientInterface $client = null) |
|
| 42 | 42 | { |
| 43 | 43 | $qb = $this->getBaseQuery() |
| 44 | 44 | ->where('s.person = :person') |
@@ -48,7 +48,7 @@ discard block |
||
| 48 | 48 | |
| 49 | 49 | if (null !== $category) { |
| 50 | 50 | $qb->andWhere('s.category = :category')->setParameter('category', |
| 51 | - $category); |
|
| 51 | + $category); |
|
| 52 | 52 | } |
| 53 | 53 | if (null !== $client) { |
| 54 | 54 | $qb->andWhere('c.client = :client')->setParameter('client', $client); |
@@ -11,15 +11,15 @@ |
||
| 11 | 11 | { |
| 12 | 12 | |
| 13 | 13 | public function findOwnedPlaceholdersByCategoryId(PersonInterface $person, |
| 14 | - $categoryId) |
|
| 14 | + $categoryId) |
|
| 15 | 15 | { |
| 16 | 16 | return $this->getEntityManager() |
| 17 | 17 | ->getRepository('LoginCidadaoNotificationBundle:Placeholder') |
| 18 | 18 | ->createQueryBuilder('p') |
| 19 | 19 | ->join('LoginCidadaoNotificationBundle:Category', 'cat', |
| 20 | - 'WITH', 'p.category = cat') |
|
| 20 | + 'WITH', 'p.category = cat') |
|
| 21 | 21 | ->join('LoginCidadaoOAuthBundle:Client', 'c', 'WITH', |
| 22 | - 'cat.client = c') |
|
| 22 | + 'cat.client = c') |
|
| 23 | 23 | ->where(':person MEMBER OF c.owners') |
| 24 | 24 | ->andWhere('cat.id = :categoryId') |
| 25 | 25 | ->setParameter('person', $person) |