@@ -15,10 +15,10 @@ |
||
| 15 | 15 | || !(in_array(@$_SERVER['REMOTE_ADDR'], ['127.0.0.1', '::1'], true) || PHP_SAPI === '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 | -require __DIR__.'/../vendor/autoload.php'; |
|
| 21 | +require __DIR__ . '/../vendor/autoload.php'; |
|
| 22 | 22 | Debug::enable(); |
| 23 | 23 | |
| 24 | 24 | $kernel = new AppKernel('dev', true); |
@@ -2,9 +2,9 @@ |
||
| 2 | 2 | |
| 3 | 3 | use Symfony\Component\HttpFoundation\Request; |
| 4 | 4 | |
| 5 | -require __DIR__.'/../vendor/autoload.php'; |
|
| 5 | +require __DIR__ . '/../vendor/autoload.php'; |
|
| 6 | 6 | if (PHP_VERSION_ID < 70000) { |
| 7 | - include_once __DIR__.'/../var/bootstrap.php.cache'; |
|
| 7 | + include_once __DIR__ . '/../var/bootstrap.php.cache'; |
|
| 8 | 8 | } |
| 9 | 9 | |
| 10 | 10 | $kernel = new AppKernel('prod', false); |
@@ -22,7 +22,7 @@ |
||
| 22 | 22 | exit('This script is only accessible from localhost.'); |
| 23 | 23 | } |
| 24 | 24 | |
| 25 | -require_once dirname(__FILE__).'/../var/SymfonyRequirements.php'; |
|
| 25 | +require_once dirname(__FILE__) . '/../var/SymfonyRequirements.php'; |
|
| 26 | 26 | |
| 27 | 27 | $symfonyRequirements = new SymfonyRequirements(); |
| 28 | 28 | |
@@ -382,7 +382,10 @@ discard block |
||
| 382 | 382 | <?php if ($hasMinorProblems): ?> |
| 383 | 383 | <h2>Recommendations</h2> |
| 384 | 384 | <p> |
| 385 | - <?php if ($hasMajorProblems): ?>Additionally, to<?php else: ?>To<?php endif; ?> enhance your Symfony experience, |
|
| 385 | + <?php if ($hasMajorProblems): ?>Additionally, to<?php else { |
|
| 386 | + : ?>To<?php endif; |
|
| 387 | +} |
|
| 388 | +?> enhance your Symfony experience, |
|
| 386 | 389 | it’s recommended that you fix the following: |
| 387 | 390 | </p> |
| 388 | 391 | <ol> |
@@ -398,9 +401,12 @@ discard block |
||
| 398 | 401 | <p id="phpini">* |
| 399 | 402 | <?php if ($symfonyRequirements->getPhpIniConfigPath()): ?> |
| 400 | 403 | Changes to the <strong>php.ini</strong> file must be done in "<strong><?php echo $symfonyRequirements->getPhpIniConfigPath() ?></strong>". |
| 401 | - <?php else: ?> |
|
| 404 | + <?php else { |
|
| 405 | + : ?> |
|
| 402 | 406 | To change settings, create a "<strong>php.ini</strong>". |
| 403 | - <?php endif; ?> |
|
| 407 | + <?php endif; |
|
| 408 | +} |
|
| 409 | +?> |
|
| 404 | 410 | </p> |
| 405 | 411 | <?php endif; ?> |
| 406 | 412 | |
@@ -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), |
@@ -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 | } |
@@ -798,7 +798,7 @@ discard block |
||
| 798 | 798 | */ |
| 799 | 799 | protected function getPhpRequiredVersion() |
| 800 | 800 | { |
| 801 | - if (!file_exists($path = __DIR__.'/../composer.lock')) { |
|
| 801 | + if (!file_exists($path = __DIR__ . '/../composer.lock')) { |
|
| 802 | 802 | return false; |
| 803 | 803 | } |
| 804 | 804 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | private function getDepositById(DepositId $depositId): Deposit |
| 90 | 90 | { |
| 91 | 91 | $deposit = $this->deposits->filter( |
| 92 | - function (Deposit $deposit) use ($depositId) { |
|
| 92 | + function(Deposit $deposit) use ($depositId) { |
|
| 93 | 93 | return $deposit->getId()->equalTo($depositId); |
| 94 | 94 | } |
| 95 | 95 | )->first(); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | |
| 190 | 190 | public function getFund(): Money |
| 191 | 191 | { |
| 192 | - return array_reduce($this->deposits->toArray(), function (Money $fund, Deposit $deposit) { |
|
| 192 | + return array_reduce($this->deposits->toArray(), function(Money $fund, Deposit $deposit) { |
|
| 193 | 193 | return $fund->add($deposit->getMoney()); |
| 194 | 194 | }, $this->expense->getInitialFund()); |
| 195 | 195 | } |
@@ -24,7 +24,7 @@ discard block |
||
| 24 | 24 | { |
| 25 | 25 | $cacheOptions = new CacheOptions('wishlist.wish.' . $wishId->getId(), 5 * 60); |
| 26 | 26 | |
| 27 | - return $this->fetch(function () use ($wishId) { |
|
| 27 | + return $this->fetch(function() use ($wishId) { |
|
| 28 | 28 | return $this->repository->get($wishId); |
| 29 | 29 | }, $cacheOptions); |
| 30 | 30 | } |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | ['wishlist.slice'] |
| 62 | 62 | ); |
| 63 | 63 | |
| 64 | - return $this->fetch(function () use ($offset, $limit) { |
|
| 64 | + return $this->fetch(function() use ($offset, $limit) { |
|
| 65 | 65 | return $this->repository->slice($offset, $limit); |
| 66 | 66 | }, $cacheOptions); |
| 67 | 67 | } |
@@ -73,7 +73,7 @@ discard block |
||
| 73 | 73 | 5 * 60 |
| 74 | 74 | ); |
| 75 | 75 | |
| 76 | - return $this->fetch(function () use ($wish) { |
|
| 76 | + return $this->fetch(function() use ($wish) { |
|
| 77 | 77 | return $this->repository->contains($wish); |
| 78 | 78 | }, $cacheOptions); |
| 79 | 79 | } |
@@ -85,7 +85,7 @@ discard block |
||
| 85 | 85 | 5 * 60 |
| 86 | 86 | ); |
| 87 | 87 | |
| 88 | - return $this->fetch(function () use ($wishId) { |
|
| 88 | + return $this->fetch(function() use ($wishId) { |
|
| 89 | 89 | return $this->repository->containsId($wishId); |
| 90 | 90 | }, $cacheOptions); |
| 91 | 91 | } |
@@ -97,7 +97,7 @@ discard block |
||
| 97 | 97 | 5 * 60 |
| 98 | 98 | ); |
| 99 | 99 | |
| 100 | - return $this->fetch(function () { |
|
| 100 | + return $this->fetch(function() { |
|
| 101 | 101 | return $this->repository->count(); |
| 102 | 102 | }, $cacheOptions); |
| 103 | 103 | } |
@@ -16,7 +16,7 @@ discard block |
||
| 16 | 16 | */ |
| 17 | 17 | public function toArrayOfDto(array $wishes): array |
| 18 | 18 | { |
| 19 | - return array_map(function (Wish $wish) { |
|
| 19 | + return array_map(function(Wish $wish) { |
|
| 20 | 20 | $dto = new ListWishDto(); |
| 21 | 21 | $dto->id = $wish->getId()->getId(); |
| 22 | 22 | $dto->name = $wish->getName(); |
@@ -33,7 +33,7 @@ discard block |
||
| 33 | 33 | |
| 34 | 34 | private function assembleDeposits(array $deposits) |
| 35 | 35 | { |
| 36 | - return array_map(function (Deposit $deposit) { |
|
| 36 | + return array_map(function(Deposit $deposit) { |
|
| 37 | 37 | $dto = new DepositDto(); |
| 38 | 38 | $dto->id = $deposit->getId()->getId(); |
| 39 | 39 | $dto->amount = $deposit->getMoney()->getAmount(); |