@@ -65,6 +65,9 @@ |
||
65 | 65 | $commandBus->handle($command); |
66 | 66 | } |
67 | 67 | |
68 | + /** |
|
69 | + * @param string $msg |
|
70 | + */ |
|
68 | 71 | protected function logVerbose($msg) |
69 | 72 | { |
70 | 73 | if ($this->output->getVerbosity() < OutputInterface::VERBOSITY_VERBOSE) return; |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | } |
45 | 45 | |
46 | 46 | /** |
47 | - * @param $path |
|
47 | + * @param string $path |
|
48 | 48 | * |
49 | 49 | * @return \SplFileInfo |
50 | 50 | */ |
@@ -71,6 +71,9 @@ discard block |
||
71 | 71 | return $c; |
72 | 72 | } |
73 | 73 | |
74 | + /** |
|
75 | + * @param string $markdown |
|
76 | + */ |
|
74 | 77 | protected function readProperties($markdown) |
75 | 78 | { |
76 | 79 | $properties = array(); |
@@ -81,6 +84,11 @@ discard block |
||
81 | 84 | return $properties; |
82 | 85 | } |
83 | 86 | |
87 | + /** |
|
88 | + * @param string $markdown |
|
89 | + * |
|
90 | + * @return string |
|
91 | + */ |
|
84 | 92 | protected function removeProperties($markdown) |
85 | 93 | { |
86 | 94 | return preg_replace(static::PROPERTIES_MATCH, '', $markdown); |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | { |
39 | 39 | $file = $this->getFilePath($path); |
40 | 40 | $info = new Info(); |
41 | - $info->setLastModified(new \DateTime('@' . filemtime($file))); |
|
41 | + $info->setLastModified(new \DateTime('@'.filemtime($file))); |
|
42 | 42 | $info->setEtag(md5_file($file)); |
43 | 43 | return $info; |
44 | 44 | } |
@@ -50,8 +50,8 @@ discard block |
||
50 | 50 | */ |
51 | 51 | protected function getFilePath($path) |
52 | 52 | { |
53 | - $contentdir = $this->contentDir->getPathname() . DIRECTORY_SEPARATOR; |
|
54 | - $file = $contentdir . $path; |
|
53 | + $contentdir = $this->contentDir->getPathname().DIRECTORY_SEPARATOR; |
|
54 | + $file = $contentdir.$path; |
|
55 | 55 | if (!is_file($file)) throw new FileNotFoundException($path); |
56 | 56 | return new \SplFileInfo($file); |
57 | 57 | } |
@@ -251,7 +251,7 @@ |
||
251 | 251 | } |
252 | 252 | |
253 | 253 | /** |
254 | - * @return \DateTime|null |
|
254 | + * @return boolean |
|
255 | 255 | */ |
256 | 256 | public function getCheckinTime() |
257 | 257 | { |
@@ -158,7 +158,7 @@ |
||
158 | 158 | } else { |
159 | 159 | $days[] = 'SU'; |
160 | 160 | } |
161 | - $str .= ' (' . join('+', $days) . ')'; |
|
161 | + $str .= ' ('.join('+', $days).')'; |
|
162 | 162 | return $str; |
163 | 163 | } |
164 | 164 |
@@ -34,7 +34,6 @@ |
||
34 | 34 | |
35 | 35 | /** |
36 | 36 | * @param CommandBus $commandBus |
37 | - * @param RouterInterface $router |
|
38 | 37 | * @param PaymentRepository $paymentRepo |
39 | 38 | * @param RegistrationRepository $registrationRepo |
40 | 39 | */ |
@@ -79,6 +79,12 @@ discard block |
||
79 | 79 | return $page; |
80 | 80 | } |
81 | 81 | |
82 | + /** |
|
83 | + * @param string $html |
|
84 | + * @param string $page |
|
85 | + * |
|
86 | + * @return string |
|
87 | + */ |
|
82 | 88 | protected function fixLinks($html, $page) |
83 | 89 | { |
84 | 90 | if (!preg_match_all('/src="([^"]+)"/', $html, $matches, PREG_SET_ORDER)) return $html; |
@@ -91,7 +97,7 @@ discard block |
||
91 | 97 | } |
92 | 98 | |
93 | 99 | /** |
94 | - * @param $path |
|
100 | + * @param string $path |
|
95 | 101 | * |
96 | 102 | * @return string |
97 | 103 | * @see http://www.php.net/manual/en/function.realpath.php#81935 |
@@ -82,9 +82,9 @@ discard block |
||
82 | 82 | protected function fixLinks($html, $page) |
83 | 83 | { |
84 | 84 | if (!preg_match_all('/src="([^"]+)"/', $html, $matches, PREG_SET_ORDER)) return $html; |
85 | - $path = $this->contentPath . '/' . dirname($page) . '/'; |
|
85 | + $path = $this->contentPath.'/'.dirname($page).'/'; |
|
86 | 86 | foreach ($matches as $match) { |
87 | - $srcpath = $this->normalizePath($path . $match[1]); |
|
87 | + $srcpath = $this->normalizePath($path.$match[1]); |
|
88 | 88 | $html = str_replace($match[1], $srcpath, $html); |
89 | 89 | } |
90 | 90 | return $html; |
@@ -104,16 +104,16 @@ discard block |
||
104 | 104 | if ($fold == '..' && $i > 0 && end($out) != '..') array_pop($out); |
105 | 105 | else $out[] = $fold; |
106 | 106 | } |
107 | - return ($path{0} == '/' ? '/' : '') . join('/', $out); |
|
107 | + return ($path{0} == '/' ? '/' : '').join('/', $out); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | protected function getSubnav(\SplFileInfo $file) |
111 | 111 | { |
112 | - $dir = dirname($file->getPathname()) . DIRECTORY_SEPARATOR; |
|
113 | - $contentdir = $this->contentDir->getPathname() . DIRECTORY_SEPARATOR; |
|
114 | - return array_map(function ($entry) use ($contentdir) { |
|
112 | + $dir = dirname($file->getPathname()).DIRECTORY_SEPARATOR; |
|
113 | + $contentdir = $this->contentDir->getPathname().DIRECTORY_SEPARATOR; |
|
114 | + return array_map(function($entry) use ($contentdir) { |
|
115 | 115 | $entry = str_replace($contentdir, '', $entry); |
116 | 116 | return $entry; |
117 | - }, glob($dir . '*.md')); |
|
117 | + }, glob($dir.'*.md')); |
|
118 | 118 | } |
119 | 119 | } |
@@ -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' |
@@ -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 | } |
@@ -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 | } |
@@ -168,7 +168,7 @@ |
||
168 | 168 | $end->setTime(23, 59, 59); |
169 | 169 | $day = $now->between($start, $end) ? Ticket::DAY_SATURDAY : Ticket::DAY_SUNDAY; |
170 | 170 | |
171 | - $tickets = array_map(function (Ticket $ticket) { |
|
171 | + $tickets = array_map(function(Ticket $ticket) { |
|
172 | 172 | return array( |
173 | 173 | 'code' => $ticket->getCode(), |
174 | 174 | 'email' => $ticket->getEmail(), |