@@ -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] |
@@ -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); |
@@ -32,7 +32,7 @@ |
||
| 32 | 32 | //$protocol = $_SERVER['HTTPS'] ? 'https' : 'http'; |
| 33 | 33 | $protocol = 'http'; // $_SERVER['HTTPS'] ? 'https' : 'http'; |
| 34 | 34 | /** |
| 35 | - * @noinspection RealpathInSteamContextInspection |
|
| 35 | + * @noinspection RealpathInSteamContextInspection |
|
| 36 | 36 | */ |
| 37 | 37 | $viewParams = [ |
| 38 | 38 | //'serverInfo' => $protocol . '://' . $_SERVER['SERVER_ADDR'] . ':' . $_SERVER['SERVER_PORT'] . '/', |
@@ -36,8 +36,8 @@ discard block |
||
| 36 | 36 | */ |
| 37 | 37 | $viewParams = [ |
| 38 | 38 | //'serverInfo' => $protocol . '://' . $_SERVER['SERVER_ADDR'] . ':' . $_SERVER['SERVER_PORT'] . '/', |
| 39 | - 'serverInfo' => $protocol.'://127.0.0.1:8000/', //FIXME get server name (from config if not in request?) |
|
| 40 | - 'base_dir' => realpath($this->getParameter('kernel.root_dir').'/..'), |
|
| 39 | + 'serverInfo' => $protocol . '://127.0.0.1:8000/', //FIXME get server name (from config if not in request?) |
|
| 40 | + 'base_dir' => realpath($this->getParameter('kernel.root_dir') . '/..'), |
|
| 41 | 41 | ]; |
| 42 | 42 | $viewParams['displayOptions'] = $this->getDisplayOptions(); |
| 43 | 43 | |
@@ -46,14 +46,14 @@ discard block |
||
| 46 | 46 | |
| 47 | 47 | public function announceAction($section) |
| 48 | 48 | { |
| 49 | - $rootDir = realpath(__DIR__.'/../../../../'); |
|
| 50 | - $announceDir = $rootDir.'/docs/announcements'; |
|
| 49 | + $rootDir = realpath(__DIR__ . '/../../../../'); |
|
| 50 | + $announceDir = $rootDir . '/docs/announcements'; |
|
| 51 | 51 | |
| 52 | 52 | if (!preg_match('/^\w+$/', $section)) { |
| 53 | 53 | throw new NotFoundHttpException(); // don't give access to anything but plain names |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - $candidateFile = $announceDir.'/'.$section.'.md'; |
|
| 56 | + $candidateFile = $announceDir . '/' . $section . '.md'; |
|
| 57 | 57 | |
| 58 | 58 | if (!file_exists($candidateFile)) { |
| 59 | 59 | throw new NotFoundHttpException(); |
@@ -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 | /** |
@@ -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 fetchPerformerIdByName($performerName, $createMissing = false) |
| 54 | 54 | { |
@@ -6,7 +6,7 @@ |
||
| 6 | 6 | /** |
| 7 | 7 | * @var ClassLoader $loader |
| 8 | 8 | */ |
| 9 | -$loader = require __DIR__.'/../vendor/autoload.php'; |
|
| 9 | +$loader = require __DIR__ . '/../vendor/autoload.php'; |
|
| 10 | 10 | |
| 11 | 11 | AnnotationRegistry::registerLoader([$loader, 'loadClass']); |
| 12 | 12 | |
@@ -36,16 +36,16 @@ |
||
| 36 | 36 | |
| 37 | 37 | public function getCacheDir() |
| 38 | 38 | { |
| 39 | - return dirname(__DIR__).'/var/cache/'.$this->getEnvironment(); |
|
| 39 | + return dirname(__DIR__) . '/var/cache/' . $this->getEnvironment(); |
|
| 40 | 40 | } |
| 41 | 41 | |
| 42 | 42 | public function getLogDir() |
| 43 | 43 | { |
| 44 | - return dirname(__DIR__).'/var/logs'; |
|
| 44 | + return dirname(__DIR__) . '/var/logs'; |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | public function registerContainerConfiguration(LoaderInterface $loader) |
| 48 | 48 | { |
| 49 | - $loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml'); |
|
| 49 | + $loader->load($this->getRootDir() . '/config/config_' . $this->getEnvironment() . '.yml'); |
|
| 50 | 50 | } |
| 51 | 51 | } |
@@ -262,6 +262,9 @@ discard block |
||
| 262 | 262 | } |
| 263 | 263 | } |
| 264 | 264 | |
| 265 | + /** |
|
| 266 | + * @param string $performerName |
|
| 267 | + */ |
|
| 265 | 268 | public function fetchPerformerIdByName($performerName, $createMissing = false) |
| 266 | 269 | { |
| 267 | 270 | $conn = $this->getDbConn(); |
@@ -638,7 +641,7 @@ discard block |
||
| 638 | 641 | /** |
| 639 | 642 | * Return SQL in appropriate dialect to concatenate the listed values |
| 640 | 643 | * |
| 641 | - * @param array $fields |
|
| 644 | + * @param string[] $fields |
|
| 642 | 645 | * |
| 643 | 646 | * @return string |
| 644 | 647 | */ |
@@ -814,6 +817,9 @@ discard block |
||
| 814 | 817 | return $source; |
| 815 | 818 | } |
| 816 | 819 | |
| 820 | + /** |
|
| 821 | + * @param string $platformName |
|
| 822 | + */ |
|
| 817 | 823 | public function fetchPlatformByName($platformName) |
| 818 | 824 | { |
| 819 | 825 | $platform = null; |
@@ -833,7 +839,7 @@ discard block |
||
| 833 | 839 | } |
| 834 | 840 | |
| 835 | 841 | /** |
| 836 | - * @param $songId |
|
| 842 | + * @param integer $songId |
|
| 837 | 843 | * @param array $platformIds |
| 838 | 844 | */ |
| 839 | 845 | public function storeSongPlatformLinks($songId, array $platformIds) |
@@ -887,7 +893,7 @@ discard block |
||
| 887 | 893 | |
| 888 | 894 | |
| 889 | 895 | /** |
| 890 | - * @param $songId |
|
| 896 | + * @param integer $songId |
|
| 891 | 897 | * @param array $instrumentIds |
| 892 | 898 | * @throws \Doctrine\DBAL\Exception\InvalidArgumentException |
| 893 | 899 | */ |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | $dataStore = $this; |
| 171 | 171 | $instruments = $dataStore->fetchInstrumentsForSongId($song['id']); |
| 172 | 172 | $instruments = array_map( |
| 173 | - function (Instrument $instrument) { |
|
| 173 | + function(Instrument $instrument) { |
|
| 174 | 174 | return $instrument->getName(); |
| 175 | 175 | }, |
| 176 | 176 | $instruments |
@@ -184,7 +184,7 @@ discard block |
||
| 184 | 184 | |
| 185 | 185 | $platforms = $dataStore->fetchPlatformsForSongId($song['id']); |
| 186 | 186 | $platforms = array_map( |
| 187 | - function (Platform $platform) { |
|
| 187 | + function(Platform $platform) { |
|
| 188 | 188 | return $platform->getName(); |
| 189 | 189 | }, |
| 190 | 190 | $platforms |
@@ -914,7 +914,7 @@ discard block |
||
| 914 | 914 | |
| 915 | 915 | $dbConn = $this; |
| 916 | 916 | $instruments = array_map( |
| 917 | - function ($row) use ($dbConn) { |
|
| 917 | + function($row) use ($dbConn) { |
|
| 918 | 918 | return $dbConn->buildInstrumentFromDbRow($row); |
| 919 | 919 | }, |
| 920 | 920 | $instrumentRows |
@@ -937,7 +937,7 @@ discard block |
||
| 937 | 937 | |
| 938 | 938 | $dbConn = $this; |
| 939 | 939 | $platforms = array_map( |
| 940 | - function ($row) use ($dbConn) { |
|
| 940 | + function($row) use ($dbConn) { |
|
| 941 | 941 | return $dbConn->buildPlatformFromDbRow($row); |
| 942 | 942 | }, |
| 943 | 943 | $platformRows |