@@ -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); |
@@ -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 | /** |
@@ -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 |
@@ -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; |
@@ -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 | } |