Skip to content

Commit

Permalink
Merge pull request #7 from GeneraleCauchemar/master
Browse files Browse the repository at this point in the history
fix: redundant assertion
  • Loading branch information
Nedeas authored Apr 13, 2023
2 parents bffa27b + cef8448 commit 7f0f6e0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

### Removed

- Removes DateTime assertion from `PublishableTrait` as strong typecasting made it redundant

## [1.0.1] - 2023-02-02

### Removed
Expand Down
2 changes: 0 additions & 2 deletions Doctrine/Model/PublishableTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,13 @@ trait PublishableTrait
* @var \DateTime|null
* @ORM\Column(type="datetime", name="publish_date", nullable=true)
* @Assert\NotBlank()
* @Assert\DateTime()
*/
#[ORM\Column(name: 'publish_date', type: 'datetime', nullable: true)]
protected ?\DateTimeInterface $publishDate;

/**
* @var \DateTime|null
* @ORM\Column(type="datetime", name="unpublish_date", nullable=true)
* @Assert\DateTime()
* @Assert\Expression(
* expression="this.getUnpublishDate() == null or this.getUnpublishDate() > this.getPublishDate()",
* message="The unpublish date must be greater than the publish date"
Expand Down

0 comments on commit 7f0f6e0

Please sign in to comment.