Skip to content

Commit

Permalink
php generator remove format attribute
Browse files Browse the repository at this point in the history
  • Loading branch information
chriskapp committed Oct 9, 2024
1 parent c90334e commit 6ebb8aa
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 11 deletions.
7 changes: 0 additions & 7 deletions src/Generator/Php.php
Original file line number Diff line number Diff line change
Expand Up @@ -339,13 +339,6 @@ private function getAttributesForProperty(PropertyTypeAbstract $type, array &$us
$result[] = $this->newAttribute('Nullable', [$this->newScalar($type->isNullable())], $uses);
}

if ($type instanceof ScalarPropertyType) {
$format = $type->getFormat();
if ($format instanceof Format) {
$result[] = $this->newAttribute('Format', [$this->newScalar($format->value)], $uses);
}
}

return $result;
}

Expand Down
4 changes: 0 additions & 4 deletions tests/Generator/resource/php/php.php
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ class Meta extends \ArrayObject
}

use PSX\Schema\Attribute\Description;
use PSX\Schema\Attribute\Format;
use PSX\Schema\Attribute\Key;

#[Description('An general news entry')]
Expand Down Expand Up @@ -162,17 +161,14 @@ class News implements \JsonSerializable, \PSX\Record\RecordableInterface
protected ?bool $read = null;
protected ?Author $author = null;
protected ?Meta $meta = null;
#[Format('date')]
protected ?\PSX\DateTime\LocalDate $sendDate = null;
#[Format('date-time')]
protected ?\PSX\DateTime\LocalDateTime $readDate = null;
protected ?float $price = null;
protected ?int $rating = null;
#[Description('Contains the main content of the news entry')]
protected ?string $content = null;
protected ?string $question = null;
protected ?string $version = null;
#[Format('time')]
protected ?\PSX\DateTime\LocalTime $coffeeTime = null;
#[Key('g-recaptcha-response')]
protected ?string $captcha = null;
Expand Down

0 comments on commit 6ebb8aa

Please sign in to comment.