mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-03 05:55:16 +01:00
Fixed PHPstan issues
This commit is contained in:
@@ -98,6 +98,8 @@ class AddDocumentedAPIPropertiesJSONSchemaFactory implements SchemaFactoryInterf
|
||||
$version = $schema->getVersion();
|
||||
$swagger = Schema::VERSION_SWAGGER === $version;
|
||||
|
||||
$propertySchema = [];
|
||||
|
||||
if (false === $propertyMetadata->writeable) {
|
||||
$propertySchema['readOnly'] = true;
|
||||
}
|
||||
@@ -115,14 +117,14 @@ class AddDocumentedAPIPropertiesJSONSchemaFactory implements SchemaFactoryInterf
|
||||
$propertySchema['deprecated'] = true;
|
||||
}
|
||||
|
||||
if (!isset($propertySchema['default']) && !empty($default = $propertyMetadata->default)) {
|
||||
if (!empty($default = $propertyMetadata->default)) {
|
||||
if ($default instanceof \BackedEnum) {
|
||||
$default = $default->value;
|
||||
}
|
||||
$propertySchema['default'] = $default;
|
||||
}
|
||||
|
||||
if (!isset($propertySchema['example']) && !empty($example = $propertyMetadata->example)) {
|
||||
if (!empty($example = $propertyMetadata->example)) {
|
||||
$propertySchema['example'] = $example;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user