diff --git a/Examples/processors/schema-query-parameter/SchemaQueryParameter.php b/Examples/processors/schema-query-parameter/SchemaQueryParameter.php index d1fb56ecd..785416f16 100644 --- a/Examples/processors/schema-query-parameter/SchemaQueryParameter.php +++ b/Examples/processors/schema-query-parameter/SchemaQueryParameter.php @@ -46,23 +46,23 @@ public function __invoke(Analysis $analysis): void */ private function expandQueryArgs(Operation $operation, Schema $schema): void { - if ($schema->properties === Generator::UNDEFINED || !$schema->properties) { + if (Generator::isDefault($schema->properties) || !$schema->properties) { return; } - $operation->parameters = $operation->parameters === Generator::UNDEFINED ? [] : $operation->parameters; + $operation->parameters = Generator::isDefault($operation->parameters) ? [] : $operation->parameters; foreach ($schema->properties as $property) { - $isNullable = $property->nullable !== Generator::UNDEFINED ? $property->nullable : false; + $isNullable = Generator::isDefault($property->nullable) ? false : $property->nullable; $schema = new Schema( - type: $property->format !== Generator::UNDEFINED ? $property->format : $property->type, + type: Generator::isDefault($property->format) ? $property->type : $property->format, nullable: $isNullable ); $schema->_context = $operation->_context; // inherit context from operation, required to pretend to be a parameter $parameter = new Parameter( name: $property->property, - description: $property->description !== Generator::UNDEFINED ? $property->description : null, + description: Generator::isDefault($property->description) ? null : $property->description, in: 'query', required: !$isNullable, schema: $schema, diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index 3e34c3bca..bf3cd6107 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -1,24 +1,9 @@ parameters: ignoreErrors: - - - message: "#^Else branch is unreachable because ternary operator condition is always true\\.$#" - count: 1 - path: Examples/processors/schema-query-parameter-attributes/SchemaQueryParameter.php - - message: "#^Property OpenApi\\\\Annotations\\\\AbstractAnnotation\\:\\:\\$x \\(array\\\\) does not accept string\\.$#" count: 1 - path: Examples/processors/schema-query-parameter-attributes/SchemaQueryParameter.php - - - - message: "#^Strict comparison using \\=\\=\\= between array\\ and '@OA\\\\\\\\Generator\\:…' will always evaluate to false\\.$#" - count: 1 - path: Examples/processors/schema-query-parameter-attributes/SchemaQueryParameter.php - - - - message: "#^Strict comparison using \\=\\=\\= between array\\ and '@OA\\\\\\\\Generator\\:…' will always evaluate to false\\.$#" - count: 1 - path: Examples/processors/schema-query-parameter-attributes/SchemaQueryParameter.php + path: Examples/processors/schema-query-parameter/SchemaQueryParameter.php - message: "#^Result of && is always true\\.$#"