Skip to content

Commit

Permalink
Fix setters for DTO Collection
Browse files Browse the repository at this point in the history
  • Loading branch information
Stephane MEAUDRE committed Nov 9, 2023
1 parent e080960 commit e833ec3
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Response/DTO/Item/Collection.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,13 @@ final class Collection extends AbstractResponse implements AstrobinResponse

public function setDateCreated(?string $dateCreated): self
{
$this->date_created = \DateTime::createFromFormat(QueryFilters::DATE_FORMAT->value, $dateCreated) ?: null;
$this->date_created = ((is_null($dateCreated)) ? null : \DateTime::createFromFormat(QueryFilters::DATE_FORMAT->value, $dateCreated)) ?: null;
return $this;
}

public function setDateUpdated(?string $dateUpdated): self
{
$this->date_updated = \DateTime::createFromFormat(QueryFilters::DATE_FORMAT->value, $dateUpdated) ?: null;
$this->date_updated = ((is_null($dateUpdated)) ? null : \DateTime::createFromFormat(QueryFilters::DATE_FORMAT->value, $dateUpdated)) ?: null;
return $this;
}
}

0 comments on commit e833ec3

Please sign in to comment.