Skip to content

Commit bcb3dbf

Browse files
author
Kirill Nesmeyanov
committed
Simplify platform
1 parent fb89135 commit bcb3dbf

23 files changed

+363
-638
lines changed

behat.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ default:
1919
- TypeLang\Mapper\Tests\Context\Provider\TypeRepositoryContext
2020
# Utils
2121
- TypeLang\Mapper\Tests\Context\Support\VarDumperContext
22+
- TypeLang\Mapper\Tests\Context\Support\MarkersContext
2223

2324
extensions:
2425
TypeLang\Mapper\Tests\Extension\ContextArgumentTransformerExtension:

example/03.types/03.custom-type-template-arguments.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77
use TypeLang\Mapper\Platform\DelegatePlatform;
88
use TypeLang\Mapper\Platform\StandardPlatform;
99
use TypeLang\Mapper\Runtime\Context;
10-
use TypeLang\Mapper\Runtime\Parser\TypeParserFacadeInterface;
11-
use TypeLang\Mapper\Runtime\Repository\TypeRepositoryFacadeInterface;
10+
use TypeLang\Mapper\Runtime\Parser\TypeParserInterface;
11+
use TypeLang\Mapper\Runtime\Repository\TypeRepositoryInterface;
1212
use TypeLang\Mapper\Type\Builder\Builder;
1313
use TypeLang\Mapper\Type\TypeInterface;
1414
use TypeLang\Parser\Node\Stmt\NamedTypeNode;
@@ -28,8 +28,8 @@ public function isSupported(TypeStatement $statement): bool
2828

2929
public function build(
3030
TypeStatement $statement,
31-
TypeRepositoryFacadeInterface $types,
32-
TypeParserFacadeInterface $parser,
31+
TypeRepositoryInterface $types,
32+
TypeParserInterface $parser,
3333
): TypeInterface {
3434
// Shape fields not allowed (like: "non-empty{...}")
3535
$this->expectNoShapeFields($statement);

src/Mapping/Driver/AttributeDriver.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -173,6 +173,7 @@ private function findPropertyAttribute(\ReflectionProperty $property, string $at
173173
/**
174174
* @template TAttribute of object
175175
*
176+
* @param \ReflectionClass<object> $class
176177
* @param class-string<TAttribute> $attr
177178
*
178179
* @return TAttribute|null

src/Platform/StandardPlatform.php

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -38,36 +38,12 @@ public function getTypes(): iterable
3838
// Adds support for the "string" type
3939
yield new Builder\SimpleTypeBuilder('string', Type\StringType::class);
4040

41-
// Adds support for the "non-empty-string" type
42-
yield new Builder\SimpleTypeBuilder('non-empty-string', Type\NonEmptyStringType::class);
43-
44-
// Adds support for the "numeric-string" type
45-
yield new Builder\SimpleTypeBuilder('numeric-string', Type\NumericStringType::class);
46-
47-
// Adds support for the "class-string" type
48-
yield new Builder\ClassStringTypeBuilder('class-string');
49-
5041
// Adds support for the "int" type
5142
yield new Builder\IntTypeBuilder('int');
5243

53-
// Additional int ranges
54-
yield new Builder\IntRangeTypeBuilder('positive-int', 1, Type\IntType::DEFAULT_INT_MAX);
55-
yield new Builder\IntRangeTypeBuilder('non-negative-int', 0, Type\IntType::DEFAULT_INT_MAX);
56-
yield new Builder\IntRangeTypeBuilder('negative-int', Type\IntType::DEFAULT_INT_MIN, -1);
57-
yield new Builder\IntRangeTypeBuilder('non-positive-int', Type\IntType::DEFAULT_INT_MIN, 0);
58-
5944
// Adds support for the "float" type
6045
yield new Builder\SimpleTypeBuilder('float', Type\FloatType::class);
6146

62-
// Adds support for the "list<T>" type
63-
yield new Builder\ListTypeBuilder('list');
64-
65-
// Adds support for the "non-empty<T>" type
66-
yield new Builder\NonEmptyTypeBuilder('non-empty');
67-
68-
// Adds support for the "array-key" type
69-
yield new Builder\SimpleTypeBuilder('array-key', Type\ArrayKeyType::class);
70-
7147
// Adds support for the "array" type
7248
yield new Builder\ArrayTypeBuilder('array');
7349

src/Type/Builder/ClassStringTypeBuilder.php

Lines changed: 0 additions & 66 deletions
This file was deleted.

src/Type/Builder/ListTypeBuilder.php

Lines changed: 0 additions & 55 deletions
This file was deleted.

src/Type/Builder/NonEmptyTypeBuilder.php

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/Type/ClassStringType.php

Lines changed: 0 additions & 53 deletions
This file was deleted.

src/Type/ListType.php

Lines changed: 0 additions & 50 deletions
This file was deleted.

src/Type/NonEmpty.php

Lines changed: 0 additions & 44 deletions
This file was deleted.

0 commit comments

Comments
 (0)