@@ -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 | } |
@@ -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 |
@@ -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 | } |
@@ -48,7 +48,9 @@ discard block |
||
48 | 48 | $subNav = array(); |
49 | 49 | foreach ($this->getSubnav($this->getFilePath($path)) as $subPage) { |
50 | 50 | $s = $this->buildPage($subPage, false); |
51 | - if ($s->isHidden()) continue; |
|
51 | + if ($s->isHidden()) { |
|
52 | + continue; |
|
53 | + } |
|
52 | 54 | $n = new Nav(); |
53 | 55 | $n->setTitle($s->getProperties()->get('title')); |
54 | 56 | $n->setPath(str_replace('.md', '', $subPage)); |
@@ -81,7 +83,9 @@ discard block |
||
81 | 83 | |
82 | 84 | protected function fixLinks($html, $page) |
83 | 85 | { |
84 | - if (!preg_match_all('/src="([^"]+)"/', $html, $matches, PREG_SET_ORDER)) return $html; |
|
86 | + if (!preg_match_all('/src="([^"]+)"/', $html, $matches, PREG_SET_ORDER)) { |
|
87 | + return $html; |
|
88 | + } |
|
85 | 89 | $path = $this->contentPath . '/' . dirname($page) . '/'; |
86 | 90 | foreach ($matches as $match) { |
87 | 91 | $srcpath = $this->normalizePath($path . $match[1]); |
@@ -100,9 +104,14 @@ discard block |
||
100 | 104 | { |
101 | 105 | $out = array(); |
102 | 106 | foreach (explode('/', $path) as $i => $fold) { |
103 | - if ($fold == '' || $fold == '.') continue; |
|
104 | - if ($fold == '..' && $i > 0 && end($out) != '..') array_pop($out); |
|
105 | - else $out[] = $fold; |
|
107 | + if ($fold == '' || $fold == '.') { |
|
108 | + continue; |
|
109 | + } |
|
110 | + if ($fold == '..' && $i > 0 && end($out) != '..') { |
|
111 | + array_pop($out); |
|
112 | + } else { |
|
113 | + $out[] = $fold; |
|
114 | + } |
|
106 | 115 | } |
107 | 116 | return ($path{0} == '/' ? '/' : '') . join('/', $out); |
108 | 117 | } |
@@ -112,7 +112,9 @@ |
||
112 | 112 | Ticket::DAY_SATURDAY => $formData->getSaturday(), |
113 | 113 | Ticket::DAY_SUNDAY => $formData->getSunday(), |
114 | 114 | ) as $day => $want) { |
115 | - if (!$want) continue; |
|
115 | + if (!$want) { |
|
116 | + continue; |
|
117 | + } |
|
116 | 118 | $ticketCommand = new CreateTicketCommand(); |
117 | 119 | $ticketCommand->day = $day; |
118 | 120 | $ticketCommand->event = $event; |
@@ -131,7 +131,9 @@ |
||
131 | 131 | } |
132 | 132 | |
133 | 133 | $p = $this->reader->getPage($path . '.md'); |
134 | - if ($p->isHidden()) throw new NotFoundHttpException(); |
|
134 | + if ($p->isHidden()) { |
|
135 | + throw new NotFoundHttpException(); |
|
136 | + } |
|
135 | 137 | |
136 | 138 | return $this->renderer->renderResponse('BCRMWebBundle:Web:page.html.twig', array( |
137 | 139 | 'page' => $p, |
@@ -67,8 +67,12 @@ |
||
67 | 67 | |
68 | 68 | protected function createTicket($day, $checkedIn = null, $email = null) |
69 | 69 | { |
70 | - if ($email === null) $email = sprintf('stats.doe.198%[email protected]', $this->ticketCounter); |
|
71 | - if ($checkedIn === null) $checkedIn = true; |
|
70 | + if ($email === null) { |
|
71 | + $email = sprintf('stats.doe.198%[email protected]', $this->ticketCounter); |
|
72 | + } |
|
73 | + if ($checkedIn === null) { |
|
74 | + $checkedIn = true; |
|
75 | + } |
|
72 | 76 | $client = static::createClient(); |
73 | 77 | $container = $client->getContainer(); |
74 | 78 |