Skip to content

Commit 6ea2a72

Browse files
committed
refactor: 💡 remove paths that are never executed
1 parent 3cffa4a commit 6ea2a72

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

src/Hydra/JsonSchema/SchemaFactory.php

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@ final class SchemaFactory implements SchemaFactoryInterface, SchemaFactoryAwareI
3737
use SchemaUriPrefixTrait;
3838

3939
private const ITEM_BASE_SCHEMA_NAME = 'HydraItemBaseSchema';
40-
private const ITEM_BASE_SCHEMA_OUTPUT_NAME = 'HydraOutputBaseSchema';
4140
private const COLLECTION_BASE_SCHEMA_NAME = 'HydraCollectionBaseSchema';
4241
private const BASE_PROP = [
4342
'type' => 'string',
@@ -69,11 +68,8 @@ final class SchemaFactory implements SchemaFactoryInterface, SchemaFactoryAwareI
6968
],
7069
],
7170
] + self::BASE_PROPS,
72-
];
73-
74-
private const ITEM_BASE_SCHEMA_OUTPUT = [
7571
'required' => ['@id', '@type'],
76-
] + self::ITEM_BASE_SCHEMA;
72+
];
7773

7874
/**
7975
* @var array<string, true>
@@ -140,11 +136,11 @@ public function buildSchema(string $className, string $format = 'jsonld', string
140136
return $schema;
141137
}
142138

143-
$baseName = Schema::TYPE_OUTPUT === $type ? self::ITEM_BASE_SCHEMA_NAME : self::ITEM_BASE_SCHEMA_OUTPUT_NAME;
139+
$baseName = self::ITEM_BASE_SCHEMA_NAME;
144140

145141
if ($this->isResourceClass($inputOrOutputClass)) {
146142
if (!isset($definitions[$baseName])) {
147-
$definitions[$baseName] = Schema::TYPE_OUTPUT === $type ? self::ITEM_BASE_SCHEMA_OUTPUT : self::ITEM_BASE_SCHEMA;
143+
$definitions[$baseName] = self::ITEM_BASE_SCHEMA;
148144
}
149145
}
150146

0 commit comments

Comments
 (0)