Skip to content

Commit

Permalink
style: Format code with php-cs-fixer
Browse files Browse the repository at this point in the history
  • Loading branch information
deepsource-autofix[bot] authored Apr 17, 2023
1 parent 30a7710 commit da20b81
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ public function __construct(string $version)
{
parent::__construct("Unrecognized Swagger version: {$version}. Expected 2.0.");
}
}
}
18 changes: 9 additions & 9 deletions src/Validators/SwaggerSpecValidator.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,14 @@

class SwaggerSpecValidator
{
const SCHEMA_TYPES = [
public const SCHEMA_TYPES = [
'array', 'boolean', 'integer', 'number', 'string', 'object', 'null', 'undefined'
];
const PRIMITIVE_TYPES = [
public const PRIMITIVE_TYPES = [
'array', 'boolean', 'integer', 'number', 'string'
];

const REQUIRED_FIELDS = [
public const REQUIRED_FIELDS = [
'definition' => ['type'],
'doc' => ['swagger', 'info', 'paths'],
'info' => ['title', 'version'],
Expand All @@ -37,7 +37,7 @@ class SwaggerSpecValidator
'tag' => ['name']
];

const AVAILABLE_VALUES = [
public const AVAILABLE_VALUES = [
'parameter_collection_format' => ['csv', 'ssv', 'tsv', 'pipes', 'multi'],
'items_collection_format' => ['csv', 'ssv', 'tsv', 'pipes'],
'header_collection_format' => ['csv', 'ssv', 'tsv', 'pipes'],
Expand All @@ -49,11 +49,11 @@ class SwaggerSpecValidator
'security_definition_type' => ['basic', 'apiKey', 'oauth2']
];

const PATH_PARAM_REGEXP = '#(?<={)[^/}]+(?=})#';
const DEFINITION_REF_REGEXP = '/^#\/definitions\/.+/';
public const PATH_PARAM_REGEXP = '#(?<={)[^/}]+(?=})#';
public const DEFINITION_REF_REGEXP = '/^#\/definitions\/.+/';

const MIME_TYPE_MULTIPART_FORM_DATA = 'multipart/form-data';
const MIME_TYPE_APPLICATION_URLENCODED = 'application/x-www-form-urlencoded';
public const MIME_TYPE_MULTIPART_FORM_DATA = 'multipart/form-data';
public const MIME_TYPE_APPLICATION_URLENCODED = 'application/x-www-form-urlencoded';

/**
* @var array
Expand Down Expand Up @@ -411,4 +411,4 @@ protected function validateTagsUnique(): void
throw new DuplicateFieldException('tags.*.name', $duplicateTags);
}
}
}
}

0 comments on commit da20b81

Please sign in to comment.