@@ -1,6 +1,6 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Newsletter\Service; |
| 6 | 6 | |
@@ -15,14 +15,14 @@ |
||
| 15 | 15 | |
| 16 | 16 | public function registerNew($email) |
| 17 | 17 | { |
| 18 | - if(!filter_var($email, FILTER_VALIDATE_EMAIL)) { |
|
| 18 | + if (!filter_var($email, FILTER_VALIDATE_EMAIL)) { |
|
| 19 | 19 | throw new \Exception('Email is not valid!', 400); |
| 20 | 20 | } |
| 21 | 21 | |
| 22 | - $current = $this->newsletterMapper->select(['email' => $email])->current(); |
|
| 22 | + $current = $this->newsletterMapper->select([ 'email' => $email ])->current(); |
|
| 23 | 23 | |
| 24 | - if(!$current) { |
|
| 25 | - return $this->newsletterMapper->insert(['email' => $email]); |
|
| 24 | + if (!$current) { |
|
| 25 | + return $this->newsletterMapper->insert([ 'email' => $email ]); |
|
| 26 | 26 | } |
| 27 | 27 | } |
| 28 | 28 | } |
@@ -9,7 +9,7 @@ discard block |
||
| 9 | 9 | return [ |
| 10 | 10 | 'templates' => [ |
| 11 | 11 | 'paths' => [ |
| 12 | - 'newsletter' => [__DIR__ . '/../templates/newsletter'], |
|
| 12 | + 'newsletter' => [ __DIR__ . '/../templates/newsletter' ], |
|
| 13 | 13 | ], |
| 14 | 14 | ], |
| 15 | 15 | |
@@ -26,7 +26,7 @@ discard block |
||
| 26 | 26 | 'name' => 'newsletter-post', |
| 27 | 27 | 'path' => '/newsletter', |
| 28 | 28 | 'middleware' => Web\Action\HandlePostAction::class, |
| 29 | - 'allowed_methods' => ['POST'], |
|
| 29 | + 'allowed_methods' => [ 'POST' ], |
|
| 30 | 30 | ], |
| 31 | 31 | ], |
| 32 | 32 | ]; |
@@ -7,9 +7,9 @@ |
||
| 7 | 7 | |
| 8 | 8 | public function change() |
| 9 | 9 | { |
| 10 | - $this->table('newsletter', ['id' => false]) |
|
| 10 | + $this->table('newsletter', [ 'id' => false ]) |
|
| 11 | 11 | ->addColumn('email', 'text') |
| 12 | - ->addColumn('created_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP']) |
|
| 12 | + ->addColumn('created_at', 'timestamp', [ 'default' => 'CURRENT_TIMESTAMP' ]) |
|
| 13 | 13 | ->create(); |
| 14 | 14 | } |
| 15 | 15 | } |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -declare(strict_types=1); |
|
| 3 | +declare(strict_types = 1); |
|
| 4 | 4 | |
| 5 | 5 | namespace Web\Action; |
| 6 | 6 | |
@@ -63,12 +63,12 @@ discard block |
||
| 63 | 63 | { |
| 64 | 64 | $eventSlug = $request->getAttribute('event_slug'); |
| 65 | 65 | $event = $this->eventService->fetchEventBySlug($eventSlug); |
| 66 | - $attendees = []; |
|
| 66 | + $attendees = [ ]; |
|
| 67 | 67 | |
| 68 | 68 | // Fetch going ppl |
| 69 | - if(strpos($event->event_url, 'meetup.com') !== false) { |
|
| 69 | + if (strpos($event->event_url, 'meetup.com') !== false) { |
|
| 70 | 70 | $parts = explode('/', $event->event_url); |
| 71 | - $attendees = $this->meetupService->getMeetupAttendees($parts[count($parts) - 2]); |
|
| 71 | + $attendees = $this->meetupService->getMeetupAttendees($parts[ count($parts) - 2 ]); |
|
| 72 | 72 | shuffle($attendees); |
| 73 | 73 | } |
| 74 | 74 | |