Skip to content

Commit

Permalink
Refactor EloquentVersionManager
Browse files Browse the repository at this point in the history
  • Loading branch information
marvin255 committed Sep 9, 2024
1 parent 8f40a8f commit 3c7ba44
Show file tree
Hide file tree
Showing 19 changed files with 14 additions and 443 deletions.
1 change: 1 addition & 0 deletions generator/SerializerGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ protected function decorateClass(ClassType $class): void
$getSupportedTypes = $class->addMethod('getSupportedTypes')
->addComment("{@inheritDoc}\n")
->setVisibility('public')
->setReturnType('array')
->setBody("return [\n{$supportedTypes}\n];");
$getSupportedTypes->addParameter('format')->setType('string')->setNullable(true);

Expand Down
2 changes: 1 addition & 1 deletion src/LiquetsoftFiasBundleServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ private function getOptionBool(string $name): bool
/**
* Возвращает значение опции по ее названию.
*/
private function getOptionByName(string $name)
private function getOptionByName(string $name): mixed
{
return config($this->prefixString($name));
}
Expand Down
2 changes: 1 addition & 1 deletion src/Serializer/CompiledEntitesDenormalizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ public function denormalize($data, string $type, ?string $format = null, array $
/**
* {@inheritDoc}
*/
public function getSupportedTypes(?string $format)
public function getSupportedTypes(?string $format): array
{
return [
Apartments::class => true,
Expand Down
146 changes: 0 additions & 146 deletions src/Serializer/EloquentDenormalizer.php

This file was deleted.

5 changes: 3 additions & 2 deletions src/Serializer/FiasSerializer.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ public function __construct(?array $normalizers = null, ?array $encoders = null)
if ($normalizers === null) {
$normalizers = [
new CompiledEntitesDenormalizer(),
new EloquentDenormalizer(),
new ObjectNormalizer(
null,
new FiasNameConverter(),
null,
new ReflectionExtractor(),
null,
null,
[ObjectNormalizer::DISABLE_TYPE_ENFORCEMENT => true]
[
ObjectNormalizer::DISABLE_TYPE_ENFORCEMENT => true,
]
),
];
}
Expand Down
27 changes: 0 additions & 27 deletions src/Serializer/TypeCaster/BoolCaster.php

This file was deleted.

58 changes: 0 additions & 58 deletions src/Serializer/TypeCaster/CompositeTypeCaster.php

This file was deleted.

29 changes: 0 additions & 29 deletions src/Serializer/TypeCaster/DateCaster.php

This file was deleted.

30 changes: 0 additions & 30 deletions src/Serializer/TypeCaster/EloquentTypeCaster.php

This file was deleted.

27 changes: 0 additions & 27 deletions src/Serializer/TypeCaster/FloatCaster.php

This file was deleted.

27 changes: 0 additions & 27 deletions src/Serializer/TypeCaster/IntCaster.php

This file was deleted.

Loading

0 comments on commit 3c7ba44

Please sign in to comment.