@@ -331,7 +331,7 @@ |
||
331 | 331 | } |
332 | 332 | |
333 | 333 | /** |
334 | - * @param $requiredRole |
|
334 | + * @param string $requiredRole |
|
335 | 335 | */ |
336 | 336 | public function assertRole($requiredRole) |
337 | 337 | { |
@@ -57,7 +57,7 @@ discard block |
||
57 | 57 | public function upcomingAction() |
58 | 58 | { |
59 | 59 | $viewParams = $this->defaultViewParams(); |
60 | - $viewParams['freeze'] = (bool) $this->dataSource->getSetting('freeze'); |
|
60 | + $viewParams['freeze'] = (bool)$this->dataSource->getSetting('freeze'); |
|
61 | 61 | $viewParams['freezeMessage'] = $this->dataSource->getSetting('freezeMessage'); |
62 | 62 | |
63 | 63 | return $this->app['twig']->render('upcoming.html.twig', $viewParams); |
@@ -187,7 +187,7 @@ discard block |
||
187 | 187 | throw new \InvalidArgumentException('Order must be array!'); |
188 | 188 | } |
189 | 189 | |
190 | - $this->app['logger']->debug('New order: '.print_r($idOrder, true)); |
|
190 | + $this->app['logger']->debug('New order: ' . print_r($idOrder, true)); |
|
191 | 191 | |
192 | 192 | $res = true; |
193 | 193 | foreach ($idOrder as $offset => $id) { |
@@ -196,7 +196,7 @@ discard block |
||
196 | 196 | if ($res) { |
197 | 197 | $jsonResponse = new JsonResponse(['ok' => 'ok']); |
198 | 198 | } else { |
199 | - $this->app['logger']->warn('Failed to store track order: '.print_r($idOrder, true)); |
|
199 | + $this->app['logger']->warn('Failed to store track order: ' . print_r($idOrder, true)); |
|
200 | 200 | $jsonResponse = new JsonResponse(['ok' => 'fail', 'message' => 'Failed to store new sort order'], 500); |
201 | 201 | } |
202 | 202 | |
@@ -281,11 +281,11 @@ discard block |
||
281 | 281 | { |
282 | 282 | $this->assertRole(self::MANAGER_REQUIRED_ROLE); |
283 | 283 | |
284 | - $rootDir = realpath(__DIR__.'/../../../'); |
|
284 | + $rootDir = realpath(__DIR__ . '/../../../'); |
|
285 | 285 | $map = [ |
286 | - 'readme' => $rootDir.'/README.md', |
|
287 | - 'CONTRIBUTING' => $rootDir.'/docs/CONTRIBUTING.md', |
|
288 | - 'TODO' => $rootDir.'/docs/TODO.md', |
|
286 | + 'readme' => $rootDir . '/README.md', |
|
287 | + 'CONTRIBUTING' => $rootDir . '/docs/CONTRIBUTING.md', |
|
288 | + 'TODO' => $rootDir . '/docs/TODO.md', |
|
289 | 289 | ]; |
290 | 290 | |
291 | 291 | if (!isset($map[$section])) { |
@@ -310,14 +310,14 @@ discard block |
||
310 | 310 | { |
311 | 311 | //$this->assertRole(self::MANAGER_REQUIRED_ROLE); |
312 | 312 | |
313 | - $rootDir = realpath(__DIR__.'/../../../'); |
|
314 | - $announceDir = $rootDir.'/docs/announcements'; |
|
313 | + $rootDir = realpath(__DIR__ . '/../../../'); |
|
314 | + $announceDir = $rootDir . '/docs/announcements'; |
|
315 | 315 | |
316 | 316 | if (!preg_match('/^\w+$/', $section)) { |
317 | 317 | throw new NotFoundHttpException(); // don't give access to anything but plain names |
318 | 318 | } |
319 | 319 | |
320 | - $candidateFile = $announceDir.'/'.$section.'.md'; |
|
320 | + $candidateFile = $announceDir . '/' . $section . '.md'; |
|
321 | 321 | |
322 | 322 | if (!file_exists($candidateFile)) { |
323 | 323 | throw new NotFoundHttpException(); |
@@ -381,8 +381,8 @@ discard block |
||
381 | 381 | { |
382 | 382 | /* @noinspection PhpUnusedParameterInspection */ |
383 | 383 | $this->app->error( |
384 | - function (\Exception $e, $code) { |
|
385 | - $message = 'Threw '.get_class($e).': '.$e->getMessage(); |
|
384 | + function(\Exception $e, $code) { |
|
385 | + $message = 'Threw ' . get_class($e) . ': ' . $e->getMessage(); |
|
386 | 386 | |
387 | 387 | return new JsonResponse(['error' => $message]); |
388 | 388 | } |
@@ -396,7 +396,7 @@ discard block |
||
396 | 396 | { |
397 | 397 | $protocol = $_SERVER['HTTPS'] ? 'https' : 'http'; |
398 | 398 | $viewParams = [ |
399 | - 'serverInfo' => $protocol.'://'.$_SERVER['SERVER_ADDR'].':'.$_SERVER['SERVER_PORT'].'/', |
|
399 | + 'serverInfo' => $protocol . '://' . $_SERVER['SERVER_ADDR'] . ':' . $_SERVER['SERVER_PORT'] . '/', |
|
400 | 400 | ]; |
401 | 401 | $viewParams['displayOptions'] = $this->getDisplayOptions(); |
402 | 402 |
@@ -39,7 +39,7 @@ discard block |
||
39 | 39 | $app['twig'] = $app->share( |
40 | 40 | $app->extend( |
41 | 41 | 'twig', |
42 | - function (\Twig_Environment $twig, $app) { |
|
42 | + function(\Twig_Environment $twig, $app) { |
|
43 | 43 | // add custom globals, filters, tags, ... |
44 | 44 | $engine = new MichelfMarkdownEngine(); |
45 | 45 | $twig->addExtension(new MarkdownExtension($engine)); |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | ); |
50 | 50 | |
51 | 51 | $app['ticket.controller'] = $app->share( |
52 | - function (Application $app) { |
|
52 | + function(Application $app) { |
|
53 | 53 | return new Controller($app); |
54 | 54 | } |
55 | 55 | ); |
@@ -94,7 +94,7 @@ |
||
94 | 94 | |
95 | 95 | if (is_array($band) && !empty($band[$instrument])) { |
96 | 96 | $performers = array_map( |
97 | - function ($performer) { |
|
97 | + function($performer) { |
|
98 | 98 | return $performer['performerName']; |
99 | 99 | }, |
100 | 100 | $band[$instrument] |
@@ -210,6 +210,9 @@ discard block |
||
210 | 210 | } |
211 | 211 | } |
212 | 212 | |
213 | + /** |
|
214 | + * @param string $performerName |
|
215 | + */ |
|
213 | 216 | public function getPerformerIdByName($performerName, $createMissing = false) |
214 | 217 | { |
215 | 218 | $conn = $this->getDbConn(); |
@@ -582,7 +585,7 @@ discard block |
||
582 | 585 | /** |
583 | 586 | * Return SQL in appropriate dialect to concatenate the listed values |
584 | 587 | * |
585 | - * @param array $fields |
|
588 | + * @param string[] $fields |
|
586 | 589 | * |
587 | 590 | * @return string |
588 | 591 | */ |
@@ -24,7 +24,7 @@ discard block |
||
24 | 24 | * @param $title |
25 | 25 | * @param $songId |
26 | 26 | * |
27 | - * @return int|false |
|
27 | + * @return string|false |
|
28 | 28 | */ |
29 | 29 | public function storeNewTicket($title, $songId) |
30 | 30 | { |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @param $performerName |
49 | 49 | * @param bool|false $createMissing |
50 | 50 | * |
51 | - * @return mixed |
|
51 | + * @return string|boolean |
|
52 | 52 | */ |
53 | 53 | public function getPerformerIdByName($performerName, $createMissing = false) |
54 | 54 | { |
@@ -15,7 +15,7 @@ |
||
15 | 15 | */ |
16 | 16 | protected function concatenateEscapedFields($fields) |
17 | 17 | { |
18 | - return 'CONCAT('.implode(', ', $fields).')'; |
|
18 | + return 'CONCAT(' . implode(', ', $fields) . ')'; |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | /** |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | * Adds a mandatory requirement in form of a php.ini configuration. |
224 | 224 | * |
225 | 225 | * @param string $cfgName The configuration name used for ini_get() |
226 | - * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, |
|
226 | + * @param boolean|string $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, |
|
227 | 227 | * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement |
228 | 228 | * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. |
229 | 229 | * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | * Adds an optional recommendation in form of a php.ini configuration. |
242 | 242 | * |
243 | 243 | * @param string $cfgName The configuration name used for ini_get() |
244 | - * @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, |
|
244 | + * @param string|false $evaluation Either a boolean indicating whether the configuration should evaluate to true or false, |
|
245 | 245 | * or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement |
246 | 246 | * @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false. |
247 | 247 | * This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin. |
@@ -49,11 +49,11 @@ discard block |
||
49 | 49 | */ |
50 | 50 | public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false) |
51 | 51 | { |
52 | - $this->fulfilled = (bool) $fulfilled; |
|
53 | - $this->testMessage = (string) $testMessage; |
|
54 | - $this->helpHtml = (string) $helpHtml; |
|
55 | - $this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string) $helpText; |
|
56 | - $this->optional = (bool) $optional; |
|
52 | + $this->fulfilled = (bool)$fulfilled; |
|
53 | + $this->testMessage = (string)$testMessage; |
|
54 | + $this->helpHtml = (string)$helpHtml; |
|
55 | + $this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string)$helpText; |
|
56 | + $this->optional = (bool)$optional; |
|
57 | 57 | } |
58 | 58 | |
59 | 59 | /** |
@@ -417,13 +417,13 @@ discard block |
||
417 | 417 | ); |
418 | 418 | |
419 | 419 | $this->addRequirement( |
420 | - is_dir(__DIR__.'/../vendor/composer'), |
|
420 | + is_dir(__DIR__ . '/../vendor/composer'), |
|
421 | 421 | 'Vendor libraries must be installed', |
422 | - 'Vendor libraries are missing. Install composer following instructions from <a href="http://getcomposer.org/">http://getcomposer.org/</a>. '. |
|
422 | + 'Vendor libraries are missing. Install composer following instructions from <a href="http://getcomposer.org/">http://getcomposer.org/</a>. ' . |
|
423 | 423 | 'Then run "<strong>php composer.phar install</strong>" to install them.' |
424 | 424 | ); |
425 | 425 | |
426 | - $cacheDir = is_dir(__DIR__.'/../var/cache') ? __DIR__.'/../var/cache' : __DIR__.'/cache'; |
|
426 | + $cacheDir = is_dir(__DIR__ . '/../var/cache') ? __DIR__ . '/../var/cache' : __DIR__ . '/cache'; |
|
427 | 427 | |
428 | 428 | $this->addRequirement( |
429 | 429 | is_writable($cacheDir), |
@@ -431,7 +431,7 @@ discard block |
||
431 | 431 | 'Change the permissions of either "<strong>app/cache/</strong>" or "<strong>var/cache/</strong>" directory so that the web server can write into it.' |
432 | 432 | ); |
433 | 433 | |
434 | - $logsDir = is_dir(__DIR__.'/../var/logs') ? __DIR__.'/../var/logs' : __DIR__.'/logs'; |
|
434 | + $logsDir = is_dir(__DIR__ . '/../var/logs') ? __DIR__ . '/../var/logs' : __DIR__ . '/logs'; |
|
435 | 435 | |
436 | 436 | $this->addRequirement( |
437 | 437 | is_writable($logsDir), |
@@ -544,7 +544,7 @@ discard block |
||
544 | 544 | ); |
545 | 545 | } |
546 | 546 | |
547 | - $pcreVersion = defined('PCRE_VERSION') ? (float) PCRE_VERSION : null; |
|
547 | + $pcreVersion = defined('PCRE_VERSION') ? (float)PCRE_VERSION : null; |
|
548 | 548 | |
549 | 549 | $this->addRequirement( |
550 | 550 | null !== $pcreVersion, |
@@ -564,13 +564,13 @@ discard block |
||
564 | 564 | |
565 | 565 | /* optional recommendations follow */ |
566 | 566 | |
567 | - if (file_exists(__DIR__.'/../vendor/composer')) { |
|
568 | - require_once __DIR__.'/../vendor/autoload.php'; |
|
567 | + if (file_exists(__DIR__ . '/../vendor/composer')) { |
|
568 | + require_once __DIR__ . '/../vendor/autoload.php'; |
|
569 | 569 | |
570 | 570 | try { |
571 | 571 | $r = new ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle'); |
572 | 572 | |
573 | - $contents = file_get_contents(dirname($r->getFileName()).'/Resources/skeleton/app/SymfonyRequirements.php'); |
|
573 | + $contents = file_get_contents(dirname($r->getFileName()) . '/Resources/skeleton/app/SymfonyRequirements.php'); |
|
574 | 574 | } catch (ReflectionException $e) { |
575 | 575 | $contents = ''; |
576 | 576 | } |
@@ -783,7 +783,7 @@ discard block |
||
783 | 783 | $unit = ''; |
784 | 784 | if (!ctype_digit($size)) { |
785 | 785 | $unit = strtolower(substr($size, -1, 1)); |
786 | - $size = (int) substr($size, 0, -1); |
|
786 | + $size = (int)substr($size, 0, -1); |
|
787 | 787 | } |
788 | 788 | switch ($unit) { |
789 | 789 | case 'g': |
@@ -793,7 +793,7 @@ discard block |
||
793 | 793 | case 'k': |
794 | 794 | return $size * 1024; |
795 | 795 | default: |
796 | - return (int) $size; |
|
796 | + return (int)$size; |
|
797 | 797 | } |
798 | 798 | } |
799 | 799 | |
@@ -804,7 +804,7 @@ discard block |
||
804 | 804 | */ |
805 | 805 | protected function getPhpRequiredVersion() |
806 | 806 | { |
807 | - if (!file_exists($path = __DIR__.'/../composer.lock')) { |
|
807 | + if (!file_exists($path = __DIR__ . '/../composer.lock')) { |
|
808 | 808 | return false; |
809 | 809 | } |
810 | 810 | |
@@ -815,7 +815,7 @@ discard block |
||
815 | 815 | continue; |
816 | 816 | } |
817 | 817 | |
818 | - return (int) $package['version'][1] > 2 ? self::REQUIRED_PHP_VERSION : self::LEGACY_REQUIRED_PHP_VERSION; |
|
818 | + return (int)$package['version'][1] > 2 ? self::REQUIRED_PHP_VERSION : self::LEGACY_REQUIRED_PHP_VERSION; |
|
819 | 819 | } |
820 | 820 | |
821 | 821 | return false; |
@@ -5,8 +5,8 @@ |
||
5 | 5 | /** |
6 | 6 | * @var Composer\Autoload\ClassLoader |
7 | 7 | */ |
8 | -$loader = require __DIR__.'/../app/autoload.php'; |
|
9 | -include_once __DIR__.'/../var/bootstrap.php.cache'; |
|
8 | +$loader = require __DIR__ . '/../app/autoload.php'; |
|
9 | +include_once __DIR__ . '/../var/bootstrap.php.cache'; |
|
10 | 10 | |
11 | 11 | // Enable APC for autoloading to improve performance. |
12 | 12 | // You should change the ApcClassLoader first argument to a unique prefix |
@@ -15,13 +15,13 @@ |
||
15 | 15 | || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', 'fe80::1', '::1']) || php_sapi_name() === 'cli-server') |
16 | 16 | ) { |
17 | 17 | header('HTTP/1.0 403 Forbidden'); |
18 | - exit('You are not allowed to access this file. Check '.basename(__FILE__).' for more information.'); |
|
18 | + exit('You are not allowed to access this file. Check ' . basename(__FILE__) . ' for more information.'); |
|
19 | 19 | } |
20 | 20 | |
21 | 21 | /** |
22 | 22 | * @var Composer\Autoload\ClassLoader $loader |
23 | 23 | */ |
24 | -$loader = require __DIR__.'/../app/autoload.php'; |
|
24 | +$loader = require __DIR__ . '/../app/autoload.php'; |
|
25 | 25 | Debug::enable(); |
26 | 26 | |
27 | 27 | $kernel = new AppKernel('dev', true); |
@@ -109,7 +109,7 @@ discard block |
||
109 | 109 | $settingsForm->handleRequest($request); |
110 | 110 | |
111 | 111 | /** |
112 | - * @noinspection PhpUndefinedMethodInspection |
|
112 | + * @noinspection PhpUndefinedMethodInspection |
|
113 | 113 | */ // isClicked on Submit |
114 | 114 | if ($settingsForm->isSubmitted() |
115 | 115 | && $settingsForm->isValid() |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | $resetForm->handleRequest($request); |
139 | 139 | |
140 | 140 | /** |
141 | - * @noinspection PhpUndefinedMethodInspection |
|
141 | + * @noinspection PhpUndefinedMethodInspection |
|
142 | 142 | */ // isClicked on Submit |
143 | 143 | if ($resetForm->isSubmitted() |
144 | 144 | && $resetForm->isValid() |
@@ -169,7 +169,7 @@ discard block |
||
169 | 169 | $songListForm->handleRequest($request); |
170 | 170 | |
171 | 171 | /** |
172 | - * @noinspection PhpUndefinedMethodInspection |
|
172 | + * @noinspection PhpUndefinedMethodInspection |
|
173 | 173 | */ // isClicked on Submit |
174 | 174 | if ($songListForm->isSubmitted() |
175 | 175 | && $songListForm->isValid() |
@@ -179,7 +179,7 @@ discard block |
||
179 | 179 | |
180 | 180 | $file = $data['songListFile']; |
181 | 181 | /** |
182 | - * @var UploadedFile $file |
|
182 | + * @var UploadedFile $file |
|
183 | 183 | */ |
184 | 184 | |
185 | 185 | $loader = new SongLoader(); |