Skip to content

Commit bfe7b01

Browse files
committed
fix
1 parent 4aeacbf commit bfe7b01

File tree

6 files changed

+15
-12
lines changed

6 files changed

+15
-12
lines changed

src/Types/ArraySchema.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ public function toArray(bool $includeSchemaRef = true, bool $includeTitle = true
109109
/**
110110
* Get array-specific features used by this schema.
111111
*
112-
* @return SchemaFeature[]
112+
* @return array<\Cortex\JsonSchema\Enums\SchemaFeature>
113113
*/
114114
protected function getArrayFeatures(): array
115115
{
@@ -129,7 +129,7 @@ protected function getArrayFeatures(): array
129129
/**
130130
* Override to include array-specific features.
131131
*
132-
* @return SchemaFeature[]
132+
* @return array<\Cortex\JsonSchema\Enums\SchemaFeature>
133133
*/
134134
#[Override]
135135
protected function getUsedFeatures(): array

src/Types/Concerns/HasDefinitions.php

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,10 @@ protected function addDefinitionsToSchema(array $schema): array
6161
$schema[$keyword] = [];
6262

6363
foreach ($this->definitions as $name => $definition) {
64-
$schema[$keyword][$name] = $definition->toArray(includeSchemaRef: false);
64+
/** @var array<string, mixed> $definitions */
65+
$definitions = $schema[$keyword];
66+
$definitions[$name] = $definition->toArray(includeSchemaRef: false);
67+
$schema[$keyword] = $definitions;
6568
}
6669
}
6770

@@ -71,7 +74,7 @@ protected function addDefinitionsToSchema(array $schema): array
7174
/**
7275
* Get definition features used by this schema.
7376
*
74-
* @return SchemaFeature[]
77+
* @return array<\Cortex\JsonSchema\Enums\SchemaFeature>
7578
*/
7679
protected function getDefinitionFeatures(): array
7780
{

src/Types/Concerns/HasFormat.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ protected function validateFormatSupport(SchemaFormat $schemaFormat): void
6565
/**
6666
* Get format features used by this schema.
6767
*
68-
* @return SchemaFeature[]
68+
* @return array<\Cortex\JsonSchema\Enums\SchemaFeature>
6969
*/
7070
protected function getFormatFeatures(): array
7171
{

src/Types/Concerns/HasMetadata.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ protected function addMetadataToSchema(array $schema): array
100100
/**
101101
* Get metadata features used by this schema.
102102
*
103-
* @return SchemaFeature[]
103+
* @return array<\Cortex\JsonSchema\Enums\SchemaFeature>
104104
*/
105105
protected function getMetadataFeatures(): array
106106
{

src/Types/Concerns/HasReadWrite.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ protected function addReadWriteToSchema(array $schema): array
5656
/**
5757
* Get read/write features used by this schema.
5858
*
59-
* @return SchemaFeature[]
59+
* @return array<\Cortex\JsonSchema\Enums\SchemaFeature>
6060
*/
6161
protected function getReadWriteFeatures(): array
6262
{

src/Types/Concerns/ValidatesVersionFeatures.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ trait ValidatesVersionFeatures
1414
/**
1515
* Validate that a feature is supported by the current schema version.
1616
*
17-
* @throws SchemaException
17+
* @throws \Cortex\JsonSchema\Exceptions\SchemaException
1818
*/
1919
protected function validateFeatureSupport(SchemaFeature $schemaFeature): void
2020
{
@@ -33,9 +33,9 @@ protected function validateFeatureSupport(SchemaFeature $schemaFeature): void
3333
/**
3434
* Validate that multiple features are supported by the current schema version.
3535
*
36-
* @param SchemaFeature[] $features
36+
* @param array<\Cortex\JsonSchema\Enums\SchemaFeature> $features
3737
*
38-
* @throws SchemaException
38+
* @throws \Cortex\JsonSchema\Exceptions\SchemaException
3939
*/
4040
protected function validateFeaturesSupport(array $features): void
4141
{
@@ -89,7 +89,7 @@ protected function addFeatureIfSupported(
8989
* Get features that should be validated when building the schema output.
9090
* Override in specific schema types to define which features they use.
9191
*
92-
* @return SchemaFeature[]
92+
* @return array<\Cortex\JsonSchema\Enums\SchemaFeature>
9393
*/
9494
protected function getUsedFeatures(): array
9595
{
@@ -99,7 +99,7 @@ protected function getUsedFeatures(): array
9999
/**
100100
* Validate all features used by this schema type.
101101
*
102-
* @throws SchemaException
102+
* @throws \Cortex\JsonSchema\Exceptions\SchemaException
103103
*/
104104
protected function validateAllUsedFeatures(): void
105105
{

0 commit comments

Comments
 (0)