Skip to content

Commit

Permalink
Merge pull request #17 from ConductionNL/analysis-x0gMVy
Browse files Browse the repository at this point in the history
Apply fixes from StyleCI
  • Loading branch information
rubenvdlinde authored Jan 14, 2020
2 parents e2e3c9b + 92c3a80 commit bc2c429
Showing 1 changed file with 11 additions and 12 deletions.
23 changes: 11 additions & 12 deletions api/src/Swagger/SwaggerDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ public function normalize($object, $format = null, array $context = [])
//$additionalEntityDocs = $this->getAdditionalEntityDocs($entity);
$entityDocs = $this->getAdditionalEntityDocs($entity);
// Only run if we have aditional docs
if(array_key_exists('properties',$entityDocs)){
if (array_key_exists('properties', $entityDocs)) {
$additionalDocs = array_merge($additionalDocs, $entityDocs['properties']);
}

Expand Down Expand Up @@ -418,7 +418,6 @@ private function getAdditionalEntityDocs($entity)
$atributes = [];
$groups = [];


foreach ($tags as $tag) {
$name = $tag->getName();
$description = $tag->getDescription();
Expand All @@ -445,47 +444,47 @@ private function getAdditionalEntityDocs($entity)

// Constrainds (Validation)
case "Assert\Date":
$atributes['type'] = "string";
$atributes['type'] = 'string';
$atributes['format'] = 'date';
$atributes['example'] = \date('Y-m-d');
break;
case "Assert\DateTime":
$atributes['type'] = "string";
$atributes['type'] = 'string';
$atributes['format'] = 'date-time';
$atributes['example'] = \date('Y-m-d H:i:s');
break;
case "Assert\Time":
$atributes['type'] = "string";
$atributes['type'] = 'string';
$atributes['format'] = 'time';
$atributes['example'] = \date('H:i:s');
break;
case "Assert\Timezone":
$atributes['type'] = "string";
$atributes['type'] = 'string';
$atributes['format'] = 'timezone';
$atributes['example'] = 'America/New_York';
break;
case "Assert\Uuid":
$atributes['type'] = "string";
$atributes['type'] = 'string';
$atributes['format'] = 'uuid';
break;
case "Assert\Email":
$atributes['type'] = "string";
$atributes['type'] = 'string';
$atributes['format'] = 'email';
break;
case "Assert\Url":
$atributes['type'] = "string";
$atributes['type'] = 'string';
$atributes['format'] = 'url';
break;
case "Assert\Regex":
$atributes['type'] = "string";
$atributes['type'] = 'string';
$atributes['format'] = 'regex';
break;
case "Assert\Ip":
$atributes['type'] = "string";
$atributes['type'] = 'string';
$atributes['format'] = 'ip';
break;
case "Assert\Json":
$atributes['type'] = "string";
$atributes['type'] = 'string';
$atributes['format'] = 'json';
break;
case "Assert\Choice":
Expand Down

0 comments on commit bc2c429

Please sign in to comment.