@@ -60,7 +60,7 @@ |
||
| 60 | 60 | $router = app('router'); |
| 61 | 61 | $router->group( |
| 62 | 62 | ['parameters' => ['context' => $context], 'prefix' => $prefix, 'middleware' => $middleware], |
| 63 | - function () use ($closure) { |
|
| 63 | + function() use ($closure) { |
|
| 64 | 64 | $closure(); |
| 65 | 65 | } |
| 66 | 66 | ); |
@@ -38,20 +38,20 @@ |
||
| 38 | 38 | $resolver = new OptionsResolver(); |
| 39 | 39 | |
| 40 | 40 | $resolver->setDefaults($defaults) |
| 41 | - ->setAllowedTypes('resources', ['string[]', ApiResourcesInterface::class]) |
|
| 42 | - ->setAllowedTypes('resources-service', ['null', 'string']) |
|
| 43 | - ->setAllowedTypes('mock', ['null', 'bool']) |
|
| 44 | - ->setAllowedTypes('mock-skipped-resources', ['string[]']) |
|
| 45 | - ->setAllowedTypes('base-url', 'string') |
|
| 46 | - ->setAllowedTypes('api-url', 'string') |
|
| 47 | - ->setAllowedTypes('disable-routes', ['null', 'bool']) |
|
| 48 | - ->setAllowedTypes('swagger-ui-test-page', ['null', 'string']) |
|
| 49 | - ->setAllowedTypes('apie-middleware', 'string[]') |
|
| 50 | - ->setAllowedTypes('swagger-ui-test-page-middleware', 'string[]') |
|
| 51 | - ->setAllowedTypes('bind-api-resource-facade-response', 'bool') |
|
| 52 | - ->setAllowedTypes('metadata', 'string[]') |
|
| 53 | - ->setAllowedTypes('resource-config', [ApiResource::class . '[]', 'array[]']) |
|
| 54 | - ->setAllowedTypes('exception-mapping', 'int[]'); |
|
| 41 | + ->setAllowedTypes('resources', ['string[]', ApiResourcesInterface::class]) |
|
| 42 | + ->setAllowedTypes('resources-service', ['null', 'string']) |
|
| 43 | + ->setAllowedTypes('mock', ['null', 'bool']) |
|
| 44 | + ->setAllowedTypes('mock-skipped-resources', ['string[]']) |
|
| 45 | + ->setAllowedTypes('base-url', 'string') |
|
| 46 | + ->setAllowedTypes('api-url', 'string') |
|
| 47 | + ->setAllowedTypes('disable-routes', ['null', 'bool']) |
|
| 48 | + ->setAllowedTypes('swagger-ui-test-page', ['null', 'string']) |
|
| 49 | + ->setAllowedTypes('apie-middleware', 'string[]') |
|
| 50 | + ->setAllowedTypes('swagger-ui-test-page-middleware', 'string[]') |
|
| 51 | + ->setAllowedTypes('bind-api-resource-facade-response', 'bool') |
|
| 52 | + ->setAllowedTypes('metadata', 'string[]') |
|
| 53 | + ->setAllowedTypes('resource-config', [ApiResource::class . '[]', 'array[]']) |
|
| 54 | + ->setAllowedTypes('exception-mapping', 'int[]'); |
|
| 55 | 55 | $resolver->setDefault('metadata', function (OptionsResolver $metadataResolver) use (&$defaults) { |
| 56 | 56 | $metadataResolver->setDefaults($defaults['metadata']); |
| 57 | 57 | |
@@ -52,10 +52,10 @@ discard block |
||
| 52 | 52 | ->setAllowedTypes('metadata', 'string[]') |
| 53 | 53 | ->setAllowedTypes('resource-config', [ApiResource::class . '[]', 'array[]']) |
| 54 | 54 | ->setAllowedTypes('exception-mapping', 'int[]'); |
| 55 | - $resolver->setDefault('metadata', function (OptionsResolver $metadataResolver) use (&$defaults) { |
|
| 55 | + $resolver->setDefault('metadata', function(OptionsResolver $metadataResolver) use (&$defaults) { |
|
| 56 | 56 | $metadataResolver->setDefaults($defaults['metadata']); |
| 57 | 57 | |
| 58 | - $urlNormalizer = function (Options $options, $value) { |
|
| 58 | + $urlNormalizer = function(Options $options, $value) { |
|
| 59 | 59 | if (empty($value)) { |
| 60 | 60 | return ''; |
| 61 | 61 | } |
@@ -65,17 +65,17 @@ discard block |
||
| 65 | 65 | $metadataResolver->setNormalizer('license-url', $urlNormalizer); |
| 66 | 66 | $metadataResolver->setNormalizer('contact-url', $urlNormalizer); |
| 67 | 67 | }); |
| 68 | - $resolver->setNormalizer('resource-config', function (Options $options, $value) { |
|
| 69 | - return array_map(function ($field) { |
|
| 68 | + $resolver->setNormalizer('resource-config', function(Options $options, $value) { |
|
| 69 | + return array_map(function($field) { |
|
| 70 | 70 | return $field instanceof ApiResource ? $field : ApiResource::createFromArray($field); |
| 71 | 71 | }, $value); |
| 72 | 72 | }); |
| 73 | - $resolver->setNormalizer('contexts', function (Options $options, $value) use (&$defaults) { |
|
| 74 | - return array_map(function ($field) use ($defaults) { |
|
| 73 | + $resolver->setNormalizer('contexts', function(Options $options, $value) use (&$defaults) { |
|
| 74 | + return array_map(function($field) use ($defaults) { |
|
| 75 | 75 | return self::createResolver($defaults)->resolve($field); |
| 76 | 76 | }, $value); |
| 77 | 77 | }); |
| 78 | - $resolver->setNormalizer('exception-mapping', function (Options $options, $value) { |
|
| 78 | + $resolver->setNormalizer('exception-mapping', function(Options $options, $value) { |
|
| 79 | 79 | ApieConfigResolver::addExceptionsForExceptionMapping($value); |
| 80 | 80 | return $value; |
| 81 | 81 | }); |