@@ -1,7 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | return [ |
| 4 | - 'settings' => [ |
|
| 4 | + 'settings' => [ |
|
| 5 | 5 | 'displayErrorDetails' => true, |
| 6 | 6 | 'routerCacheFile' => false, |
| 7 | 7 | ], |
@@ -88,7 +88,7 @@ |
||
| 88 | 88 | new Error( |
| 89 | 89 | $path.'[_all]', |
| 90 | 90 | 'constraint.uniquemodel.notunique', |
| 91 | - ['uniqueProperties' => 'name'] |
|
| 91 | + ['uniqueProperties' => 'name'] |
|
| 92 | 92 | ), |
| 93 | 93 | ]; |
| 94 | 94 | } |
@@ -75,7 +75,7 @@ |
||
| 75 | 75 | new PropertyMapping('active', [new NotNullConstraint(), new NotBlankConstraint()]), |
| 76 | 76 | new PropertyMapping('documents', [ |
| 77 | 77 | new ModelCollectionConstraint(), |
| 78 | - new CallbackConstraint(function (string $path, $collection) { |
|
| 78 | + new CallbackConstraint(function(string $path, $collection) { |
|
| 79 | 79 | if (!$collection instanceof ModelCollectionInterface) { |
| 80 | 80 | return []; |
| 81 | 81 | } |
@@ -12,6 +12,6 @@ |
||
| 12 | 12 | $env = 'test'; |
| 13 | 13 | |
| 14 | 14 | /** @var \Slim\App $app */ |
| 15 | -$app = require_once __DIR__ . '/../app/app.php'; |
|
| 15 | +$app = require_once __DIR__.'/../app/app.php'; |
|
| 16 | 16 | |
| 17 | 17 | $app->run(); |
@@ -7,6 +7,6 @@ |
||
| 7 | 7 | $env = 'prod'; |
| 8 | 8 | |
| 9 | 9 | /** @var \Slim\App $app */ |
| 10 | -$app = require_once __DIR__ . '/../app/app.php'; |
|
| 10 | +$app = require_once __DIR__.'/../app/app.php'; |
|
| 11 | 11 | |
| 12 | 12 | $app->run(); |
@@ -4,26 +4,26 @@ discard block |
||
| 4 | 4 | |
| 5 | 5 | function checkAllowedIp($remoteAddress) |
| 6 | 6 | { |
| 7 | - if(in_array($remoteAddress, array('127.0.0.1', 'fe80::1', '::1'), true)) { |
|
| 7 | + if (in_array($remoteAddress, array('127.0.0.1', 'fe80::1', '::1'), true)) { |
|
| 8 | 8 | return true; |
| 9 | 9 | } |
| 10 | 10 | $matches = array(); |
| 11 | 11 | // http://en.wikipedia.org/wiki/Private_network |
| 12 | - if(preg_match('/([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/', $remoteAddress, $matches) === 1) { |
|
| 13 | - for($i=1;$i<5;$i++) { |
|
| 12 | + if (preg_match('/([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})\.([0-9]{1,3})/', $remoteAddress, $matches) === 1) { |
|
| 13 | + for ($i = 1; $i < 5; $i++) { |
|
| 14 | 14 | $matches[$i] = (int) $matches[$i]; |
| 15 | 15 | } |
| 16 | 16 | // localhost |
| 17 | - if($matches[1] === 127) { |
|
| 17 | + if ($matches[1] === 127) { |
|
| 18 | 18 | return true; |
| 19 | 19 | } |
| 20 | - if($matches[1] === 10) { |
|
| 20 | + if ($matches[1] === 10) { |
|
| 21 | 21 | return true; |
| 22 | 22 | } |
| 23 | - if($matches[1] === 172 && $matches[2] >= 16 && $matches[2] <= 31) { |
|
| 23 | + if ($matches[1] === 172 && $matches[2] >= 16 && $matches[2] <= 31) { |
|
| 24 | 24 | return true; |
| 25 | 25 | } |
| 26 | - if($matches[1] === 192 && $matches[2] === 168) { |
|
| 26 | + if ($matches[1] === 192 && $matches[2] === 168) { |
|
| 27 | 27 | return true; |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -42,6 +42,6 @@ discard block |
||
| 42 | 42 | $env = 'dev'; |
| 43 | 43 | |
| 44 | 44 | /** @var \Slim\App $app */ |
| 45 | -$app = require_once __DIR__ . '/../app/app.php'; |
|
| 45 | +$app = require_once __DIR__.'/../app/app.php'; |
|
| 46 | 46 | |
| 47 | 47 | $app->run(); |
@@ -16,9 +16,9 @@ |
||
| 16 | 16 | /* @var App $app */ |
| 17 | 17 | /* @var Container $container */ |
| 18 | 18 | |
| 19 | -$app->group('/api', function () use ($app, $container) { |
|
| 19 | +$app->group('/api', function() use ($app, $container) { |
|
| 20 | 20 | $app->get('', IndexController::class)->setName('index'); |
| 21 | - $app->group('/courses', function () use ($app, $container) { |
|
| 21 | + $app->group('/courses', function() use ($app, $container) { |
|
| 22 | 22 | $app->get('', CourseSearchController::class)->setName('course_search'); |
| 23 | 23 | $app->post('', CourseCreateController::class)->setName('course_create'); |
| 24 | 24 | $app->get('/{id}', CourseReadController::class)->setName('course_read'); |
@@ -16,20 +16,20 @@ |
||
| 16 | 16 | /* @var Container $container */ |
| 17 | 17 | $container->register(new ConsoleProvider()); |
| 18 | 18 | |
| 19 | -$container[CreateDatabaseCommand::class] = function () use ($container) { |
|
| 19 | +$container[CreateDatabaseCommand::class] = function() use ($container) { |
|
| 20 | 20 | return new CreateDatabaseCommand($container['db']); |
| 21 | 21 | }; |
| 22 | 22 | |
| 23 | -$container[RunSqlCommand::class] = function () use ($container) { |
|
| 23 | +$container[RunSqlCommand::class] = function() use ($container) { |
|
| 24 | 24 | return new RunSqlCommand($container['db']); |
| 25 | 25 | }; |
| 26 | 26 | |
| 27 | -$container[SchemaUpdateCommand::class] = function () use ($container) { |
|
| 27 | +$container[SchemaUpdateCommand::class] = function() use ($container) { |
|
| 28 | 28 | return new SchemaUpdateCommand($container['db'], __DIR__.'/schema.php'); |
| 29 | 29 | }; |
| 30 | 30 | |
| 31 | 31 | /* @var Container $container */ |
| 32 | -$container->extend('console.commands', function (array $commands) use ($container) { |
|
| 32 | +$container->extend('console.commands', function(array $commands) use ($container) { |
|
| 33 | 33 | $commands[] = new LazyCommand( |
| 34 | 34 | $container, |
| 35 | 35 | CreateDatabaseCommand::class, |
@@ -19,11 +19,11 @@ |
||
| 19 | 19 | $container->register(new SwiftmailerServiceProvider()); |
| 20 | 20 | |
| 21 | 21 | // extend providers |
| 22 | -$container['api-http.response.factory'] = function () { |
|
| 22 | +$container['api-http.response.factory'] = function() { |
|
| 23 | 23 | return new ResponseFactory(); |
| 24 | 24 | }; |
| 25 | 25 | |
| 26 | -$container->extend('translator.providers', function (array $providers) use ($container) { |
|
| 26 | +$container->extend('translator.providers', function(array $providers) use ($container) { |
|
| 27 | 27 | $providers[] = new LocaleTranslationProvider( |
| 28 | 28 | 'de', |
| 29 | 29 | array_replace( |
@@ -17,11 +17,11 @@ |
||
| 17 | 17 | $container['console.name'] = 'chubbyphp-api-slim-skeleton'; |
| 18 | 18 | $container['console.version'] = '1.0'; |
| 19 | 19 | |
| 20 | - $container['console.helpers'] = function () { |
|
| 20 | + $container['console.helpers'] = function() { |
|
| 21 | 21 | return []; |
| 22 | 22 | }; |
| 23 | 23 | |
| 24 | - $container['console.commands'] = function () { |
|
| 24 | + $container['console.commands'] = function() { |
|
| 25 | 25 | return []; |
| 26 | 26 | }; |
| 27 | 27 | } |