@@ -67,7 +67,9 @@ |
||
| 67 | 67 | |
| 68 | 68 | protected function logVerbose($msg) |
| 69 | 69 | { |
| 70 | - if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERBOSE) return; |
|
| 70 | + if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERBOSE) { |
|
| 71 | + return; |
|
| 72 | + } |
|
| 71 | 73 | $this->output->writeln($msg); |
| 72 | 74 | } |
| 73 | 75 | } |
@@ -105,7 +105,7 @@ |
||
| 105 | 105 | */ |
| 106 | 106 | protected function toBatch(ArrayCollection $emails, $deep = true) |
| 107 | 107 | { |
| 108 | - return $emails->map(function ($email) use($deep) { |
|
| 108 | + return $emails->map(function($email) use($deep) { |
|
| 109 | 109 | return array( |
| 110 | 110 | 'email' => $deep ? array('email' => $email) : $email, |
| 111 | 111 | 'email_type' => 'html' |
@@ -61,7 +61,9 @@ |
||
| 61 | 61 | foreach ($ticketRepo->getTicketsForEvent($eventRepo->getNextEvent()->getOrThrow( |
| 62 | 62 | new BadMethodCallException('No event.') |
| 63 | 63 | )) as $ticket) { |
| 64 | - if ($participants->contains(strtolower($ticket->getEmail()))) continue; |
|
| 64 | + if ($participants->contains(strtolower($ticket->getEmail()))) { |
|
| 65 | + continue; |
|
| 66 | + } |
|
| 65 | 67 | $participants->add(strtolower($ticket->getEmail())); |
| 66 | 68 | } |
| 67 | 69 | |
@@ -52,7 +52,9 @@ discard block |
||
| 52 | 52 | { |
| 53 | 53 | $contentdir = $this->contentDir->getPathname() . DIRECTORY_SEPARATOR; |
| 54 | 54 | $file = $contentdir . $path; |
| 55 | - if (!is_file($file)) throw new FileNotFoundException($path); |
|
| 55 | + if (!is_file($file)) { |
|
| 56 | + throw new FileNotFoundException($path); |
|
| 57 | + } |
|
| 56 | 58 | return new \SplFileInfo($file); |
| 57 | 59 | } |
| 58 | 60 | |
@@ -74,7 +76,9 @@ discard block |
||
| 74 | 76 | protected function readProperties($markdown) |
| 75 | 77 | { |
| 76 | 78 | $properties = array(); |
| 77 | - if (!preg_match_all(static::PROPERTIES_MATCH, $markdown, $matches, PREG_SET_ORDER)) return $properties; |
|
| 79 | + if (!preg_match_all(static::PROPERTIES_MATCH, $markdown, $matches, PREG_SET_ORDER)) { |
|
| 80 | + return $properties; |
|
| 81 | + } |
|
| 78 | 82 | foreach ($matches as $match) { |
| 79 | 83 | $properties[$match[1]] = $match[2]; |
| 80 | 84 | } |
@@ -33,7 +33,9 @@ |
||
| 33 | 33 | |
| 34 | 34 | protected function getFile($name) |
| 35 | 35 | { |
| 36 | - if (!preg_match('/^bcrm_content:(.+)/', $name, $match)) throw new Twig_Error_Loader(sprintf('Unknown template: %s', $name)); |
|
| 36 | + if (!preg_match('/^bcrm_content:(.+)/', $name, $match)) { |
|
| 37 | + throw new Twig_Error_Loader(sprintf('Unknown template: %s', $name)); |
|
| 38 | + } |
|
| 37 | 39 | return $match[1]; |
| 38 | 40 | } |
| 39 | 41 | |
@@ -25,7 +25,7 @@ |
||
| 25 | 25 | $configuration = new Configuration(); |
| 26 | 26 | $config = $this->processConfiguration($configuration, $configs); |
| 27 | 27 | |
| 28 | - $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
| 28 | + $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
| 29 | 29 | $loader->load('services.xml'); |
| 30 | 30 | $loader->load('persistence.xml'); |
| 31 | 31 | } |
@@ -318,7 +318,7 @@ |
||
| 318 | 318 | $payment = $event->payment; |
| 319 | 319 | $registrationOptional = $this->registrationRepo->findByUuid($payment->getPayload()->get('item_number')); |
| 320 | 320 | if ($registrationOptional->isEmpty()) { |
| 321 | - Option::fromValue($this->logger)->map(function (LoggerInterface $logger) use ($payment) { |
|
| 321 | + Option::fromValue($this->logger)->map(function(LoggerInterface $logger) use ($payment) { |
|
| 322 | 322 | $logger->alert(sprintf('No registration found with uuid "%s"', $payment->getPayload()->get('item_number')), array($payment)); |
| 323 | 323 | }); |
| 324 | 324 | return; |
@@ -55,7 +55,7 @@ |
||
| 55 | 55 | $template = $this->cr->getContent($tplIdentifier); |
| 56 | 56 | $templateData = $command->templateData; |
| 57 | 57 | if ($command->image !== null) { |
| 58 | - $templateData['image'] = $message->embed(\Swift_Image::fromPath($command->image));; |
|
| 58 | + $templateData['image'] = $message->embed(\Swift_Image::fromPath($command->image)); ; |
|
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | // Subject |
@@ -100,11 +100,11 @@ |
||
| 100 | 100 | $event->payment = $payment; |
| 101 | 101 | $payment->setPayload(new ArrayCollection($data)); |
| 102 | 102 | $this->eventMessageBus->publish($event); |
| 103 | - Option::fromValue($this->logger)->map(function (LoggerInterface $logger) use ($payment) { |
|
| 103 | + Option::fromValue($this->logger)->map(function(LoggerInterface $logger) use ($payment) { |
|
| 104 | 104 | $logger->info(sprintf('Payment "%s" is verified.', $payment->getId()), array($payment)); |
| 105 | 105 | }); |
| 106 | 106 | } else { |
| 107 | - Option::fromValue($this->logger)->map(function (LoggerInterface $logger) use ($payment) { |
|
| 107 | + Option::fromValue($this->logger)->map(function(LoggerInterface $logger) use ($payment) { |
|
| 108 | 108 | $logger->alert(sprintf('Payment "%s" could not be verified.', $payment->getId()), array($payment)); |
| 109 | 109 | }); |
| 110 | 110 | } |
@@ -84,7 +84,9 @@ |
||
| 84 | 84 | |
| 85 | 85 | $data = array(); |
| 86 | 86 | foreach (explode("\n", $res) as $line) { |
| 87 | - if (!strpos($line, '=')) continue; |
|
| 87 | + if (!strpos($line, '=')) { |
|
| 88 | + continue; |
|
| 89 | + } |
|
| 88 | 90 | list($key, $value) = explode('=', $line); |
| 89 | 91 | $data[$key] = $value; |
| 90 | 92 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | { |
| 87 | 87 | $payment = $event->payment; |
| 88 | 88 | $registration = $event->registration; |
| 89 | - Option::fromValue($this->logger)->map(function (LoggerInterface $logger) use ($registration, $payment) { |
|
| 89 | + Option::fromValue($this->logger)->map(function(LoggerInterface $logger) use ($registration, $payment) { |
|
| 90 | 90 | $logger->alert(sprintf('Registration "%s" has been paid with payment "%s".', $registration->getId(), $payment->getId())); |
| 91 | 91 | }); |
| 92 | 92 | foreach ($this->ticketRepo->getTicketsForEmail( |
@@ -98,7 +98,7 @@ discard block |
||
| 98 | 98 | $updateCommand->id = $ticket->getId(); |
| 99 | 99 | $updateCommand->data = array('payment' => $payment); |
| 100 | 100 | $this->commandBus->handle($updateCommand); |
| 101 | - Option::fromValue($this->logger)->map(function (LoggerInterface $logger) use ($payment, $ticket) { |
|
| 101 | + Option::fromValue($this->logger)->map(function(LoggerInterface $logger) use ($payment, $ticket) { |
|
| 102 | 102 | $logger->alert(sprintf('Assigning payment "%s" to ticket "%s"', $payment->getId(), $ticket->getCode())); |
| 103 | 103 | }); |
| 104 | 104 | } |