Skip to content

Commit

Permalink
Apply fixes from StyleCI
Browse files Browse the repository at this point in the history
  • Loading branch information
rubenvdlinde authored and StyleCIBot committed Jan 14, 2020
1 parent 7cf9552 commit 2f75993
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 16 deletions.
8 changes: 4 additions & 4 deletions api/src/Entity/Assent.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
use Symfony\Component\Validator\Constraints as Assert;

/**
* An assent registers if assents are given for mutations that require one
* An assent registers if assents are given for mutations that require one.
*
* @author Ruben van der Linde <[email protected]>
* @license EUPL <https://github.com/ConductionNL/contactcatalogus/blob/master/LICENSE.md>
Expand Down Expand Up @@ -146,9 +146,9 @@ class Assent
* @example requested
*
* @Assert\Choice({"requested", "granted", "submitted", "declined"})
* @Assert\Length(
* max = 255
* )
* @Assert\Length(
* max = 255
* )
* @Groups({"read","write"})
* @ORM\Column(type="string", length=255, nullable=true)
*/
Expand Down
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 2f75993

Please sign in to comment.