@@ -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 | } |
@@ -43,7 +43,7 @@ discard block |
||
43 | 43 | // Create registrations |
44 | 44 | for ($i = 0; $i < 5; $i++) { |
45 | 45 | $payment = new Payment(); |
46 | - $payment->setTransactionId('payment' . $i); |
|
46 | + $payment->setTransactionId('payment'.$i); |
|
47 | 47 | $payment->setMethod('cash'); |
48 | 48 | $em->persist($payment); |
49 | 49 | $registration = new Registration(); |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | $this->assertObjectHasAttribute('tags', $ticket); |
100 | 100 | $this->assertObjectHasAttribute('code', $ticket); |
101 | 101 | $this->assertObjectHasAttribute('day', $ticket); |
102 | - $this->assertEquals('#' . strtolower(str_replace(' ', '', $ticket->name)), $ticket->tags); |
|
102 | + $this->assertEquals('#'.strtolower(str_replace(' ', '', $ticket->name)), $ticket->tags); |
|
103 | 103 | $this->assertEquals(1, preg_match('/^PRNT[0-9]+$/', $ticket->code)); |
104 | 104 | $this->assertEquals(2, $ticket->day); |
105 | 105 | |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $client->request('GET', '/api/printing/queue'); |
130 | 130 | $response = $client->getResponse(); |
131 | 131 | $queue2 = json_decode($response->getContent()); |
132 | - $this->assertFalse(in_array($items[0]->{'@subject'}, array_map(function ($item) { |
|
132 | + $this->assertFalse(in_array($items[0]->{'@subject'}, array_map(function($item) { |
|
133 | 133 | return $item->{'@subject'}; |
134 | 134 | }, $queue2->items))); |
135 | 135 | |
@@ -145,7 +145,7 @@ discard block |
||
145 | 145 | */ |
146 | 146 | public function ticketsCanBeReprinted(array $items) |
147 | 147 | { |
148 | - $client = static::createClient(array(), array( |
|
148 | + $client = static::createClient(array(), array( |
|
149 | 149 | 'PHP_AUTH_USER' => 'concierge', |
150 | 150 | 'PHP_AUTH_PW' => 'letmein', |
151 | 151 | )); |
@@ -64,9 +64,9 @@ discard block |
||
64 | 64 | $data->lastname = isset($nameParts[1]) ? $nameParts[1] : null; |
65 | 65 | $data->day = $ticket->day == Ticket::DAY_SATURDAY ? 'Sa' : 'So'; |
66 | 66 | $badge = $env->render($template, (array)$data); |
67 | - $badgeFileName = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $ticket->code; |
|
68 | - $badgeSVG = $badgeFileName . '.svg'; |
|
69 | - $badgePDF = $badgeFileName . '.pdf'; |
|
67 | + $badgeFileName = sys_get_temp_dir().DIRECTORY_SEPARATOR.$ticket->code; |
|
68 | + $badgeSVG = $badgeFileName.'.svg'; |
|
69 | + $badgePDF = $badgeFileName.'.pdf'; |
|
70 | 70 | file_put_contents($badgeSVG, $badge); |
71 | 71 | exec( |
72 | 72 | sprintf( |
@@ -75,11 +75,11 @@ discard block |
||
75 | 75 | escapeshellarg($badgeSVG) |
76 | 76 | ) |
77 | 77 | ); |
78 | - $printFile = rtrim($input->getOption('output'), DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . $ticket->code . '.pdf'; |
|
78 | + $printFile = rtrim($input->getOption('output'), DIRECTORY_SEPARATOR).DIRECTORY_SEPARATOR.$ticket->code.'.pdf'; |
|
79 | 79 | if (is_file($printFile)) { |
80 | 80 | $counter = 1; |
81 | 81 | do { |
82 | - $printFile = preg_replace('/(\.[0-9]+)*\.pdf$/', '.' . ($counter++) . '.pdf', $printFile); |
|
82 | + $printFile = preg_replace('/(\.[0-9]+)*\.pdf$/', '.'.($counter++).'.pdf', $printFile); |
|
83 | 83 | } while (is_file($printFile)); |
84 | 84 | } |
85 | 85 | copy($badgePDF, $printFile); |
@@ -58,7 +58,7 @@ |
||
58 | 58 | $type = null; |
59 | 59 | $items[] = array( |
60 | 60 | '@context' => 'http://barcamp-rheinmain.de/jsonld/Ticket', |
61 | - '@subject' => $this->schemeAndHost . $this->router->generate('bcrmprint_ticket', array('id' => $ticket->getId(), 'code' => $ticket->getCode())), |
|
61 | + '@subject' => $this->schemeAndHost.$this->router->generate('bcrmprint_ticket', array('id' => $ticket->getId(), 'code' => $ticket->getCode())), |
|
62 | 62 | 'name' => $ticket->getName(), |
63 | 63 | 'twitter' => $registration->getTwitter(), |
64 | 64 | 'code' => $ticket->getCode(), |
@@ -27,7 +27,7 @@ |
||
27 | 27 | $container->setParameter('bcrm_web.content_dir', $config['content_dir']); |
28 | 28 | $container->setParameter('bcrm_web.content_path', $config['content_path']); |
29 | 29 | |
30 | - $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); |
|
30 | + $loader = new Loader\XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config')); |
|
31 | 31 | $loader->load('controllers.xml'); |
32 | 32 | $loader->load('services.xml'); |
33 | 33 | } |
@@ -129,7 +129,7 @@ discard block |
||
129 | 129 | $this->assertNull($registration->getPayment()); |
130 | 130 | |
131 | 131 | $client = static::createClient(); |
132 | - $client->request('GET', '/anmeldung/' . $registration->getUuid() . '/payment'); |
|
132 | + $client->request('GET', '/anmeldung/'.$registration->getUuid().'/payment'); |
|
133 | 133 | $response = $client->getResponse(); |
134 | 134 | $this->assertEquals(200, $response->getStatusCode()); |
135 | 135 | preg_match('/data-number="([^"]+)"/', $response->getContent(), $registrationUuidMatch); |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | |
291 | 291 | // Create registrations |
292 | 292 | for ($i = 1; $i <= 5; $i++) { |
293 | - $email = 'john.doe.198' . $i . '@domain.com'; |
|
293 | + $email = 'john.doe.198'.$i.'@domain.com'; |
|
294 | 294 | $registration = new Registration(); |
295 | 295 | $registration->setName($i); |
296 | 296 | $registration->setEvent($event); |
@@ -313,7 +313,7 @@ discard block |
||
313 | 313 | 'day' => Ticket::DAY_SATURDAY, |
314 | 314 | )); |
315 | 315 | $this->assertEquals(3, count($tickets)); |
316 | - $this->assertInArray('[email protected]', array_map(function (Ticket $t) { |
|
316 | + $this->assertInArray('[email protected]', array_map(function(Ticket $t) { |
|
317 | 317 | return $t->getEmail(); |
318 | 318 | }, $tickets)); |
319 | 319 | |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | 'day' => Ticket::DAY_SATURDAY, |
341 | 341 | )); |
342 | 342 | $this->assertEquals(3, count($tickets)); |
343 | - $this->assertNotInArray('[email protected]', array_map(function (Ticket $t) { |
|
343 | + $this->assertNotInArray('[email protected]', array_map(function(Ticket $t) { |
|
344 | 344 | return $t->getEmail(); |
345 | 345 | }, $tickets)); |
346 | 346 | } |
@@ -79,8 +79,8 @@ |
||
79 | 79 | ->getManager(); |
80 | 80 | |
81 | 81 | // Create a payment |
82 | - $txId = sha1('someid' . $email); |
|
83 | - $payment = $em->getRepository('BCRMBackendBundle:Payment')->findOneByTxId($txId); |
|
82 | + $txId = sha1('someid'.$email); |
|
83 | + $payment = $em->getRepository('BCRMBackendBundle:Payment')->findOneByTxId($txId); |
|
84 | 84 | if (!$payment) { |
85 | 85 | $payment = new Payment(); |
86 | 86 | $payment->setTransactionId($txId); |
@@ -114,7 +114,7 @@ discard block |
||
114 | 114 | public function pageAction(Request $request, $path) |
115 | 115 | { |
116 | 116 | try { |
117 | - $pageInfo = $this->reader->getInfo($path . '.md'); |
|
117 | + $pageInfo = $this->reader->getInfo($path.'.md'); |
|
118 | 118 | } catch (FileNotFoundException $e) { |
119 | 119 | throw new NotFoundHttpException(); |
120 | 120 | } |
@@ -122,7 +122,7 @@ discard block |
||
122 | 122 | $response->setETag($pageInfo->getEtag()); |
123 | 123 | $lastModified = $pageInfo->getLastModified(); |
124 | 124 | if ($this->assetsVersion - $pageInfo->getLastModified()->getTimestamp() > 0) { |
125 | - $lastModified = new \DateTime('@' . $this->assetsVersion); |
|
125 | + $lastModified = new \DateTime('@'.$this->assetsVersion); |
|
126 | 126 | } |
127 | 127 | $response->setLastModified($lastModified); |
128 | 128 | $response->setPublic(); |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | return $response; |
131 | 131 | } |
132 | 132 | |
133 | - $p = $this->reader->getPage($path . '.md'); |
|
133 | + $p = $this->reader->getPage($path.'.md'); |
|
134 | 134 | if ($p->isHidden()) throw new NotFoundHttpException(); |
135 | 135 | |
136 | 136 | return $this->renderer->renderResponse('BCRMWebBundle:Web:page.html.twig', array( |
@@ -150,12 +150,12 @@ discard block |
||
150 | 150 | */ |
151 | 151 | public function contentAction(Request $request, $path) |
152 | 152 | { |
153 | - $pageInfo = $this->reader->getInfo($path . '.md'); |
|
153 | + $pageInfo = $this->reader->getInfo($path.'.md'); |
|
154 | 154 | $response = new Response(); |
155 | 155 | $response->setETag($pageInfo->getEtag()); |
156 | 156 | $lastModified = $pageInfo->getLastModified(); |
157 | 157 | if ($this->assetsVersion - $pageInfo->getLastModified()->getTimestamp() > 0) { |
158 | - $lastModified = new \DateTime('@' . $this->assetsVersion); |
|
158 | + $lastModified = new \DateTime('@'.$this->assetsVersion); |
|
159 | 159 | } |
160 | 160 | $response->setLastModified($lastModified); |
161 | 161 | $response->setPublic(); |
@@ -163,7 +163,7 @@ discard block |
||
163 | 163 | return $response; |
164 | 164 | } |
165 | 165 | |
166 | - $p = $this->reader->getPage($path . '.md'); |
|
166 | + $p = $this->reader->getPage($path.'.md'); |
|
167 | 167 | $response->setContent($p->getContent()); |
168 | 168 | return $response; |
169 | 169 | } |
@@ -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 | } |