Skip to content

Commit ebc8a7b

Browse files
committed
Replace JetBrains attributes to meta storm config
1 parent 7695854 commit ebc8a7b

15 files changed

+39
-57
lines changed

.meta-storm.xml renamed to resources/.meta-storm.xml

+21-21
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222
<classConstructor class="\TypeLang\Mapper\Mapping\DiscriminatorMap"
2323
argument="2">
24-
<languageInjection language="PHP" />
24+
<languageInjection language="InjectablePHP" />
2525
</classConstructor>
2626

2727
<!-- ===================================================================
@@ -30,7 +30,7 @@
3030

3131
<classConstructor class="\TypeLang\Mapper\Mapping\MapType"
3232
argument="0">
33-
<languageInjection language="PHP" />
33+
<languageInjection language="InjectablePHP" />
3434
</classConstructor>
3535

3636
<!-- ===================================================================
@@ -49,25 +49,25 @@
4949
<classMethod class="\TypeLang\Mapper\DenormalizerInterface"
5050
method="denormalize"
5151
argument="1">
52-
<languageInjection language="PHP" />
52+
<languageInjection language="InjectablePHP" />
5353
</classMethod>
5454

5555
<classMethod class="\TypeLang\Mapper\Mapper"
5656
method="denormalize"
5757
argument="1">
58-
<languageInjection language="PHP" />
58+
<languageInjection language="InjectablePHP" />
5959
</classMethod>
6060

6161
<classMethod class="\TypeLang\Mapper\DenormalizerInterface"
6262
method="isDenormalizable"
6363
argument="1">
64-
<languageInjection language="PHP" />
64+
<languageInjection language="InjectablePHP" />
6565
</classMethod>
6666

6767
<classMethod class="\TypeLang\Mapper\Mapper"
6868
method="isDenormalizable"
6969
argument="1">
70-
<languageInjection language="PHP" />
70+
<languageInjection language="InjectablePHP" />
7171
</classMethod>
7272

7373
<!-- ===================================================================
@@ -77,25 +77,25 @@
7777
<classMethod class="\TypeLang\Mapper\NormalizerInterface"
7878
method="normalize"
7979
argument="1">
80-
<languageInjection language="PHP" />
80+
<languageInjection language="InjectablePHP" />
8181
</classMethod>
8282

8383
<classMethod class="\TypeLang\Mapper\Mapper"
8484
method="normalize"
8585
argument="1">
86-
<languageInjection language="PHP" />
86+
<languageInjection language="InjectablePHP" />
8787
</classMethod>
8888

8989
<classMethod class="\TypeLang\Mapper\NormalizerInterface"
9090
method="isNormalizable"
9191
argument="1">
92-
<languageInjection language="PHP" />
92+
<languageInjection language="InjectablePHP" />
9393
</classMethod>
9494

9595
<classMethod class="\TypeLang\Mapper\Mapper"
9696
method="isNormalizable"
9797
argument="1">
98-
<languageInjection language="PHP" />
98+
<languageInjection language="InjectablePHP" />
9999
</classMethod>
100100

101101
<!-- ===================================================================
@@ -105,7 +105,7 @@
105105
<classMethod class="\TypeLang\Mapper\Mapper"
106106
method="getType"
107107
argument="0">
108-
<languageInjection language="PHP" />
108+
<languageInjection language="InjectablePHP" />
109109
</classMethod>
110110

111111
<!-- ===================================================================
@@ -115,19 +115,19 @@
115115
<classMethod class="\TypeLang\Mapper\Runtime\Context"
116116
method="getTypeByDefinition"
117117
argument="0">
118-
<languageInjection language="PHP" />
118+
<languageInjection language="InjectablePHP" />
119119
</classMethod>
120120

121121
<classMethod class="\TypeLang\Mapper\Runtime\Repository\TypeRepositoryFacadeInterface"
122122
method="getTypeByDefinition"
123123
argument="0">
124-
<languageInjection language="PHP" />
124+
<languageInjection language="InjectablePHP" />
125125
</classMethod>
126126

127127
<classMethod class="\TypeLang\Mapper\Runtime\Repository\TypeRepositoryFacade"
128128
method="getTypeByDefinition"
129129
argument="0">
130-
<languageInjection language="PHP" />
130+
<languageInjection language="InjectablePHP" />
131131
</classMethod>
132132

133133
<!-- ===================================================================
@@ -137,43 +137,43 @@
137137
<classMethod class="\TypeLang\Mapper\Runtime\Context"
138138
method="getStatementByDefinition"
139139
argument="0">
140-
<languageInjection language="PHP" />
140+
<languageInjection language="InjectablePHP" />
141141
</classMethod>
142142

143143
<classMethod class="\TypeLang\Mapper\Runtime\Parser\TypeParserInterface"
144144
method="getStatementByDefinition"
145145
argument="0">
146-
<languageInjection language="PHP" />
146+
<languageInjection language="InjectablePHP" />
147147
</classMethod>
148148

149149
<classMethod class="\TypeLang\Mapper\Runtime\Parser\InMemoryTypeParser"
150150
method="getStatementByDefinition"
151151
argument="0">
152-
<languageInjection language="PHP" />
152+
<languageInjection language="InjectablePHP" />
153153
</classMethod>
154154

155155
<classMethod class="\TypeLang\Mapper\Runtime\Parser\LoggableTypeParser"
156156
method="getStatementByDefinition"
157157
argument="0">
158-
<languageInjection language="PHP" />
158+
<languageInjection language="InjectablePHP" />
159159
</classMethod>
160160

161161
<classMethod class="\TypeLang\Mapper\Runtime\Parser\TraceableTypeParser"
162162
method="getStatementByDefinition"
163163
argument="0">
164-
<languageInjection language="PHP" />
164+
<languageInjection language="InjectablePHP" />
165165
</classMethod>
166166

167167
<classMethod class="\TypeLang\Mapper\Runtime\Parser\TypeParser"
168168
method="getStatementByDefinition"
169169
argument="0">
170-
<languageInjection language="PHP" />
170+
<languageInjection language="InjectablePHP" />
171171
</classMethod>
172172

173173
<classMethod class="\TypeLang\Mapper\Runtime\Parser\TypeParserFacade"
174174
method="getStatementByDefinition"
175175
argument="0">
176-
<languageInjection language="PHP" />
176+
<languageInjection language="InjectablePHP" />
177177
</classMethod>
178178
</definitions>
179179
</meta-storm>

src/DenormalizerInterface.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace TypeLang\Mapper;
66

7-
use JetBrains\PhpStorm\Language;
87
use TypeLang\Mapper\Exception\Definition\DefinitionException;
98
use TypeLang\Mapper\Exception\Mapping\RuntimeException;
109

@@ -29,7 +28,7 @@ interface DenormalizerInterface
2928
* @throws DefinitionException in case of type building exception occurs
3029
* @throws \Throwable in case of any internal error occurs
3130
*/
32-
public function denormalize(mixed $value, #[Language('PHP')] string $type): mixed;
31+
public function denormalize(mixed $value, string $type): mixed;
3332

3433
/**
3534
* Returns {@see true} if the value can be denormalized for the given type.
@@ -39,5 +38,5 @@ public function denormalize(mixed $value, #[Language('PHP')] string $type): mixe
3938
* @throws DefinitionException in case of type building exception occurs
4039
* @throws \Throwable in case of any internal error occurs
4140
*/
42-
public function isDenormalizable(mixed $value, #[Language('PHP')] string $type): bool;
41+
public function isDenormalizable(mixed $value, string $type): bool;
4342
}

src/Mapper.php

+5-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace TypeLang\Mapper;
66

7-
use JetBrains\PhpStorm\Language;
87
use TypeLang\Mapper\Exception\Definition\TypeNotFoundException;
98
use TypeLang\Mapper\Platform\PlatformInterface;
109
use TypeLang\Mapper\Platform\StandardPlatform;
@@ -108,7 +107,7 @@ public function getParser(): TypeParserFacadeInterface
108107
return $this->parser;
109108
}
110109

111-
public function normalize(mixed $value, #[Language('PHP')] ?string $type = null): mixed
110+
public function normalize(mixed $value, ?string $type = null): mixed
112111
{
113112
$instance = $type === null
114113
? $this->types->getTypeByValue($value)
@@ -122,7 +121,7 @@ public function normalize(mixed $value, #[Language('PHP')] ?string $type = null)
122121
));
123122
}
124123

125-
public function isNormalizable(mixed $value, #[Language('PHP')] ?string $type = null): bool
124+
public function isNormalizable(mixed $value, ?string $type = null): bool
126125
{
127126
$instance = $type === null
128127
? $this->types->getTypeByValue($value)
@@ -136,7 +135,7 @@ public function isNormalizable(mixed $value, #[Language('PHP')] ?string $type =
136135
));
137136
}
138137

139-
public function denormalize(mixed $value, #[Language('PHP')] string $type): mixed
138+
public function denormalize(mixed $value, string $type): mixed
140139
{
141140
$instance = $this->types->getTypeByDefinition($type);
142141

@@ -148,7 +147,7 @@ public function denormalize(mixed $value, #[Language('PHP')] string $type): mixe
148147
));
149148
}
150149

151-
public function isDenormalizable(mixed $value, #[Language('PHP')] string $type): bool
150+
public function isDenormalizable(mixed $value, string $type): bool
152151
{
153152
$instance = $this->types->getTypeByDefinition($type);
154153

@@ -170,7 +169,7 @@ public function isDenormalizable(mixed $value, #[Language('PHP')] string $type):
170169
* @throws TypeNotFoundException in case of type not found
171170
* @throws \Throwable in case of internal error occurs
172171
*/
173-
public function getType(#[Language('PHP')] string $type): TypeInterface
172+
public function getType(string $type): TypeInterface
174173
{
175174
return $this->types->getTypeByDefinition($type);
176175
}

src/Mapping/DiscriminatorMap.php

-3
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,6 @@
44

55
namespace TypeLang\Mapper\Mapping;
66

7-
use JetBrains\PhpStorm\Language;
8-
97
/**
108
* ```
119
* #[DiscriminatorMap(field: 'type', map: [
@@ -49,7 +47,6 @@ public function __construct(
4947
*
5048
* @var non-empty-string|null
5149
*/
52-
#[Language('PHP')]
5350
public readonly ?string $otherwise = null,
5451
) {}
5552
}

src/Mapping/SkipWhen.php

-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace TypeLang\Mapper\Mapping;
66

7-
use JetBrains\PhpStorm\Language;
87
use TypeLang\Mapper\Mapping\Metadata\ExpressionConditionMetadata;
98

109
#[\Attribute(\Attribute::TARGET_PROPERTY | \Attribute::IS_REPEATABLE)]
@@ -21,7 +20,6 @@ public function __construct(
2120
*
2221
* @var non-empty-string
2322
*/
24-
#[Language('JavaScript')]
2523
public readonly string $expr,
2624
/**
2725
* Contains the name of the variable that will hold the reference

src/NormalizerInterface.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace TypeLang\Mapper;
66

7-
use JetBrains\PhpStorm\Language;
87
use TypeLang\Mapper\Exception\Definition\DefinitionException;
98
use TypeLang\Mapper\Exception\Mapping\RuntimeException;
109

@@ -32,7 +31,7 @@ interface NormalizerInterface
3231
* @throws DefinitionException in case of type building exception occurs
3332
* @throws \Throwable in case of any internal error occurs
3433
*/
35-
public function normalize(mixed $value, #[Language('PHP')] ?string $type = null): mixed;
34+
public function normalize(mixed $value, ?string $type = null): mixed;
3635

3736
/**
3837
* Returns {@see true} if the value can be normalized for the given type.
@@ -45,5 +44,5 @@ public function normalize(mixed $value, #[Language('PHP')] ?string $type = null)
4544
* @throws DefinitionException in case of type building exception occurs
4645
* @throws \Throwable in case of any internal error occurs
4746
*/
48-
public function isNormalizable(mixed $value, #[Language('PHP')] ?string $type = null): bool;
47+
public function isNormalizable(mixed $value, ?string $type = null): bool;
4948
}

src/Runtime/Context.php

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace TypeLang\Mapper\Runtime;
66

7-
use JetBrains\PhpStorm\Language;
87
use Psr\Log\LoggerInterface;
98
use TypeLang\Mapper\Runtime\Context\ChildContext;
109
use TypeLang\Mapper\Runtime\Context\DirectionInterface;
@@ -94,7 +93,7 @@ public function getPath(): PathInterface
9493
return new Path();
9594
}
9695

97-
public function getTypeByDefinition(#[Language('PHP')] string $definition, ?\ReflectionClass $context = null): TypeInterface
96+
public function getTypeByDefinition(string $definition, ?\ReflectionClass $context = null): TypeInterface
9897
{
9998
return $this->types->getTypeByDefinition($definition, $context);
10099
}
@@ -109,7 +108,7 @@ public function getTypeByStatement(TypeStatement $statement, ?\ReflectionClass $
109108
return $this->types->getTypeByStatement($statement, $context);
110109
}
111110

112-
public function getStatementByDefinition(#[Language('PHP')] string $definition): TypeStatement
111+
public function getStatementByDefinition(string $definition): TypeStatement
113112
{
114113
return $this->parser->getStatementByDefinition($definition);
115114
}

src/Runtime/Parser/InMemoryTypeParser.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace TypeLang\Mapper\Runtime\Parser;
66

7-
use JetBrains\PhpStorm\Language;
87
use TypeLang\Parser\Node\Stmt\TypeStatement;
98

109
final class InMemoryTypeParser implements TypeParserInterface
@@ -31,7 +30,7 @@ public function __construct(
3130
private readonly int $typesCleanupCount = 30,
3231
) {}
3332

34-
public function getStatementByDefinition(#[Language('PHP')] string $definition): TypeStatement
33+
public function getStatementByDefinition(string $definition): TypeStatement
3534
{
3635
$this->cleanup();
3736

src/Runtime/Parser/LoggableTypeParser.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace TypeLang\Mapper\Runtime\Parser;
66

7-
use JetBrains\PhpStorm\Language;
87
use Psr\Log\LoggerInterface;
98
use TypeLang\Parser\Node\Stmt\TypeStatement;
109

@@ -15,7 +14,7 @@ public function __construct(
1514
private readonly TypeParserInterface $delegate,
1615
) {}
1716

18-
public function getStatementByDefinition(#[Language('PHP')] string $definition): TypeStatement
17+
public function getStatementByDefinition(string $definition): TypeStatement
1918
{
2019
$this->logger->debug('Fetching an AST by "{definition}"', [
2120
'definition' => $definition,

src/Runtime/Parser/TraceableTypeParser.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace TypeLang\Mapper\Runtime\Parser;
66

7-
use JetBrains\PhpStorm\Language;
87
use TypeLang\Mapper\Runtime\Tracing\TracerInterface;
98
use TypeLang\Parser\Node\Stmt\TypeStatement;
109

@@ -15,7 +14,7 @@ public function __construct(
1514
private readonly TypeParserInterface $delegate,
1615
) {}
1716

18-
public function getStatementByDefinition(#[Language('PHP')] string $definition): TypeStatement
17+
public function getStatementByDefinition(string $definition): TypeStatement
1918
{
2019
$span = $this->tracer->start(\sprintf('Parse "%s"', $definition));
2120

src/Runtime/Parser/TypeParser.php

+1-2
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
namespace TypeLang\Mapper\Runtime\Parser;
66

7-
use JetBrains\PhpStorm\Language;
87
use Phplrt\Source\Source;
98
use TypeLang\Mapper\Platform\GrammarFeature;
109
use TypeLang\Mapper\Platform\PlatformInterface;
@@ -39,7 +38,7 @@ public static function createFromPlatform(PlatformInterface $platform): self
3938
));
4039
}
4140

42-
public function getStatementByDefinition(#[Language('PHP')] string $definition): TypeStatement
41+
public function getStatementByDefinition(string $definition): TypeStatement
4342
{
4443
// Fast-built optimization: if the definition is "null", return a null literal.
4544
if ($definition === 'null') {

0 commit comments

Comments
 (0)