@@ -28,7 +28,7 @@ |
||
| 28 | 28 | */ |
| 29 | 29 | public function load(array $configs, ContainerBuilder $container): void |
| 30 | 30 | { |
| 31 | - $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../../config')); |
|
| 31 | + $loader=new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../../config')); |
|
| 32 | 32 | |
| 33 | 33 | $loader->load(__DIR__ . '/../../config/doctrine.yml'); |
| 34 | 34 | } |
@@ -23,7 +23,7 @@ |
||
| 23 | 23 | */ |
| 24 | 24 | public function getContainerExtension(): ?ExtensionInterface |
| 25 | 25 | { |
| 26 | - $this->extension = $this->extension ?? new CarbonExtension(); |
|
| 26 | + $this->extension=$this->extension ?? new CarbonExtension(); |
|
| 27 | 27 | return $this->extension; |
| 28 | 28 | } |
| 29 | 29 | } |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | return $value->format($platform->getDateTimeFormatString()); |
| 58 | 58 | } |
| 59 | 59 | |
| 60 | - throw ConversionException::conversionFailedInvalidType($value, $this->getName(), ['null', 'Carbon']); |
|
| 60 | + throw ConversionException::conversionFailedInvalidType($value, $this->getName(), [ 'null', 'Carbon' ]); |
|
| 61 | 61 | } |
| 62 | 62 | |
| 63 | 63 | /** |
@@ -75,7 +75,7 @@ discard block |
||
| 75 | 75 | } |
| 76 | 76 | |
| 77 | 77 | try { |
| 78 | - $carbon = Carbon::createFromFormat($platform->getDateTimeFormatString(), $value); |
|
| 78 | + $carbon=Carbon::createFromFormat($platform->getDateTimeFormatString(), $value); |
|
| 79 | 79 | } catch (InvalidArgumentException $e) { |
| 80 | 80 | throw ConversionException::conversionFailedFormat( |
| 81 | 81 | $value, |
@@ -35,11 +35,11 @@ discard block |
||
| 35 | 35 | return false; |
| 36 | 36 | } |
| 37 | 37 | |
| 38 | - $param = $configuration->getName(); |
|
| 39 | - $options = $configuration->getOptions(); |
|
| 40 | - $value = $request->attributes->get($param); |
|
| 41 | - $format = $this->loadFormat($options, $value); |
|
| 42 | - $carbon = $this->getCarbon($format, $value, $param); |
|
| 38 | + $param=$configuration->getName(); |
|
| 39 | + $options=$configuration->getOptions(); |
|
| 40 | + $value=$request->attributes->get($param); |
|
| 41 | + $format=$this->loadFormat($options, $value); |
|
| 42 | + $carbon=$this->getCarbon($format, $value, $param); |
|
| 43 | 43 | |
| 44 | 44 | $request->attributes->set($param, $carbon); |
| 45 | 45 | |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | */ |
| 71 | 71 | private function isValidInput(Request $request, ParamConverter $configuration): bool |
| 72 | 72 | { |
| 73 | - $param = $configuration->getName(); |
|
| 73 | + $param=$configuration->getName(); |
|
| 74 | 74 | |
| 75 | 75 | return !( |
| 76 | 76 | (!$request->attributes->has($param)) || |
@@ -87,10 +87,10 @@ discard block |
||
| 87 | 87 | */ |
| 88 | 88 | private function loadFormat(array $options, string $value): ?string |
| 89 | 89 | { |
| 90 | - $format = $options['format'] ?? null; |
|
| 90 | + $format=$options[ 'format' ] ?? null; |
|
| 91 | 91 | |
| 92 | 92 | if (!$format && \filter_var($value, \FILTER_VALIDATE_INT) !== false) { |
| 93 | - $format = 'U'; |
|
| 93 | + $format='U'; |
|
| 94 | 94 | } |
| 95 | 95 | |
| 96 | 96 | return $format; |
@@ -105,7 +105,7 @@ discard block |
||
| 105 | 105 | * |
| 106 | 106 | * @throws NotFoundHttpException |
| 107 | 107 | */ |
| 108 | - private function getCarbon(?string $format, string $value, string $param): Carbon |
|
| 108 | + private function getCarbon(?string $format, string $value, string $param) : Carbon |
|
| 109 | 109 | { |
| 110 | 110 | try { |
| 111 | 111 | if ($format) { |