@@ -34,7 +34,7 @@ |
||
| 34 | 34 | * 'contact' |
| 35 | 35 | * ); |
| 36 | 36 | */ |
| 37 | -return function (Application $app, MiddlewareFactory $factory, ContainerInterface $container): void { |
|
| 37 | +return function(Application $app, MiddlewareFactory $factory, ContainerInterface $container): void { |
|
| 38 | 38 | $app->get('/', \Application\Handler\HomePageHandler::class, 'home'); |
| 39 | 39 | $app->get('/api/ping', \Application\Handler\PingHandler::class, 'api.ping'); |
| 40 | 40 | |
@@ -27,7 +27,7 @@ discard block |
||
| 27 | 27 | // Swoole config to overwrite some services (if installed) |
| 28 | 28 | class_exists(\Zend\Expressive\Swoole\ConfigProvider::class) |
| 29 | 29 | ? \Zend\Expressive\Swoole\ConfigProvider::class |
| 30 | - : function () { |
|
| 30 | + : function() { |
|
| 31 | 31 | return []; |
| 32 | 32 | }, |
| 33 | 33 | |
@@ -40,10 +40,10 @@ discard block |
||
| 40 | 40 | // - `*.global.php` |
| 41 | 41 | // - `local.php` |
| 42 | 42 | // - `*.local.php` |
| 43 | - new PhpFileProvider(realpath(__DIR__) . '/autoload/{{,*.}global,{,*.}local}.php'), |
|
| 43 | + new PhpFileProvider(realpath(__DIR__).'/autoload/{{,*.}global,{,*.}local}.php'), |
|
| 44 | 44 | |
| 45 | 45 | // Load development config if it exists |
| 46 | - new PhpFileProvider(realpath(__DIR__) . '/development.config.php'), |
|
| 46 | + new PhpFileProvider(realpath(__DIR__).'/development.config.php'), |
|
| 47 | 47 | ], $cacheConfig['config_cache_path']); |
| 48 | 48 | |
| 49 | 49 | return $aggregator->getMergedConfig(); |
@@ -20,7 +20,7 @@ |
||
| 20 | 20 | /** |
| 21 | 21 | * Setup middleware pipeline: |
| 22 | 22 | */ |
| 23 | -return function (Application $app, MiddlewareFactory $factory, ContainerInterface $container): void { |
|
| 23 | +return function(Application $app, MiddlewareFactory $factory, ContainerInterface $container): void { |
|
| 24 | 24 | // The error handler should be the first (most outer) middleware to catch |
| 25 | 25 | // all Exceptions. |
| 26 | 26 | $app->pipe(ErrorHandler::class); |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | require_once 'server/Debug.php'; |
| 10 | 10 | |
| 11 | 11 | // Load configuration |
| 12 | -$config = require __DIR__ . '/config.php'; |
|
| 12 | +$config = require __DIR__.'/config.php'; |
|
| 13 | 13 | |
| 14 | 14 | $dependencies = $config['dependencies']; |
| 15 | 15 | $dependencies['services']['config'] = $config; |
@@ -12,11 +12,11 @@ discard block |
||
| 12 | 12 | public function getSqlDeclaration(array $fieldDeclaration, AbstractPlatform $platform) |
| 13 | 13 | { |
| 14 | 14 | $possibleValues = $this->getPossibleValues(); |
| 15 | - $quotedPossibleValues = implode(', ', array_map(function ($str) { |
|
| 16 | - return "'" . (string) $str . "'"; |
|
| 15 | + $quotedPossibleValues = implode(', ', array_map(function($str) { |
|
| 16 | + return "'".(string) $str."'"; |
|
| 17 | 17 | }, $possibleValues)); |
| 18 | 18 | |
| 19 | - $sql = 'ENUM(' . $quotedPossibleValues . ')'; |
|
| 19 | + $sql = 'ENUM('.$quotedPossibleValues.')'; |
|
| 20 | 20 | |
| 21 | 21 | return $sql; |
| 22 | 22 | } |
@@ -28,7 +28,7 @@ discard block |
||
| 28 | 28 | } |
| 29 | 29 | |
| 30 | 30 | if (!in_array($value, $this->getPossibleValues(), true)) { |
| 31 | - throw new \InvalidArgumentException("Invalid '" . $value . "' value fetched from database for enum " . get_class($this)); |
|
| 31 | + throw new \InvalidArgumentException("Invalid '".$value."' value fetched from database for enum ".get_class($this)); |
|
| 32 | 32 | } |
| 33 | 33 | |
| 34 | 34 | return (string) $value; |
@@ -41,7 +41,7 @@ discard block |
||
| 41 | 41 | } |
| 42 | 42 | |
| 43 | 43 | if (!in_array($value, $this->getPossibleValues(), true)) { |
| 44 | - throw new \InvalidArgumentException("Invalid '" . $value . "' value to be stored in database for enum " . get_class($this)); |
|
| 44 | + throw new \InvalidArgumentException("Invalid '".$value."' value to be stored in database for enum ".get_class($this)); |
|
| 45 | 45 | } |
| 46 | 46 | |
| 47 | 47 | return (string) $value; |
@@ -16,7 +16,7 @@ |
||
| 16 | 16 | public function __construct() |
| 17 | 17 | { |
| 18 | 18 | if (file_exists(self::LOG_FILE) && !is_writable(self::LOG_FILE)) { |
| 19 | - throw new \Exception(self::LOG_FILE . ' is not writable'); |
|
| 19 | + throw new \Exception(self::LOG_FILE.' is not writable'); |
|
| 20 | 20 | } |
| 21 | 21 | } |
| 22 | 22 | |
@@ -53,10 +53,10 @@ |
||
| 53 | 53 | return; |
| 54 | 54 | } |
| 55 | 55 | |
| 56 | - echo $title . PHP_EOL . PHP_EOL; |
|
| 56 | + echo $title.PHP_EOL.PHP_EOL; |
|
| 57 | 57 | |
| 58 | 58 | foreach ($files as $file) { |
| 59 | - echo ' ' . escapeshellarg($file) . PHP_EOL; |
|
| 59 | + echo ' '.escapeshellarg($file).PHP_EOL; |
|
| 60 | 60 | } |
| 61 | 61 | echo PHP_EOL; |
| 62 | 62 | } |
@@ -45,7 +45,7 @@ discard block |
||
| 45 | 45 | public function parseValue($value) |
| 46 | 46 | { |
| 47 | 47 | if (!is_string($value)) { // quite naive, but after all this is example |
| 48 | - throw new \UnexpectedValueException('Cannot represent value as date: ' . Utils::printSafe($value)); |
|
| 48 | + throw new \UnexpectedValueException('Cannot represent value as date: '.Utils::printSafe($value)); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | if ($value === '') { |
@@ -71,7 +71,7 @@ discard block |
||
| 71 | 71 | // Note: throwing GraphQL\Error\Error vs \UnexpectedValueException to benefit from GraphQL |
| 72 | 72 | // error location in query: |
| 73 | 73 | if (!($ast instanceof StringValueNode)) { |
| 74 | - throw new Error('Query error: Can only parse strings got: ' . $ast->kind, [$ast]); |
|
| 74 | + throw new Error('Query error: Can only parse strings got: '.$ast->kind, [$ast]); |
|
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | return $ast->value; |
@@ -39,7 +39,7 @@ discard block |
||
| 39 | 39 | public function parseValue($value) |
| 40 | 40 | { |
| 41 | 41 | if (!$this->isValid($value)) { |
| 42 | - throw new \UnexpectedValueException('Query error: Not a valid login: ' . $value); |
|
| 42 | + throw new \UnexpectedValueException('Query error: Not a valid login: '.$value); |
|
| 43 | 43 | } |
| 44 | 44 | |
| 45 | 45 | return $value; |
@@ -58,7 +58,7 @@ discard block |
||
| 58 | 58 | // Note: throwing GraphQL\Error\Error vs \UnexpectedValueException to benefit from GraphQL |
| 59 | 59 | // error location in query: |
| 60 | 60 | if (!($ast instanceof StringValueNode)) { |
| 61 | - throw new Error('Query error: Can only parse strings got: ' . $ast->kind, [$ast]); |
|
| 61 | + throw new Error('Query error: Can only parse strings got: '.$ast->kind, [$ast]); |
|
| 62 | 62 | } |
| 63 | 63 | |
| 64 | 64 | if (!$this->isValid($ast->value)) { |