Skip to content

Commit

Permalink
Fix: Remove unnecessary condition
Browse files Browse the repository at this point in the history
  • Loading branch information
localheinz committed Jan 21, 2022
1 parent 0214800 commit 9250f4d
Showing 1 changed file with 0 additions and 23 deletions.
23 changes: 0 additions & 23 deletions src/SchemaNormalizer.php
Expand Up @@ -131,10 +131,6 @@ private function normalizeArray(
$schema,
);

if (!self::describesType('array', $schema)) {
return $data;
}

if (!\property_exists($schema, 'items')) {
return $data;
}
Expand Down Expand Up @@ -173,10 +169,6 @@ private function normalizeObject(
$schema,
);

if (!self::describesType('object', $schema)) {
return $data;
}

if (!\property_exists($schema, 'properties')) {
return $data;
}
Expand Down Expand Up @@ -286,19 +278,4 @@ private function resolveSchema(

return $schema;
}

private static function describesType(
string $type,
\stdClass $schema
): bool {
if (!\property_exists($schema, 'type')) {
return false;
}

if ($schema->type === $type) {
return true;
}

return \is_array($schema->type) && \in_array($type, $schema->type, true);
}
}

0 comments on commit 9250f4d

Please sign in to comment.