Skip to content

Commit

Permalink
Merge branch 'release/6.0.1'
Browse files Browse the repository at this point in the history
  • Loading branch information
sebastiaanluca committed Mar 17, 2022
2 parents e830fa6 + 27a569e commit 4fcc5dc
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ All Notable changes to `sebastiaanluca/laravel-boolean-dates` will be documented

Updates should follow the [Keep a CHANGELOG](http://keepachangelog.com/) principles.

## 6.0.1 (2022-03-17)

### Fixed

- Fixed attribute getter value type hint

## 6.0.0 (2022-03-13)

⚠️ This release is a complete rewrite and changes the way it has to be used. Please consult the [README](README.md) for instructions.
Expand Down
4 changes: 2 additions & 2 deletions src/BooleanDateAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ class BooleanDateAttribute extends Attribute
public static function for(string $column): static
{
return parent::make(
get: static fn (?string $value, array $attributes): bool => static::getBooleanDate($value, $attributes, $column),
get: static fn (mixed $value, array $attributes): bool => static::getBooleanDate($attributes, $column),
set: static fn (mixed $value, array $attributes): array => static::setBooleanDate($value, $attributes, $column),
);
}

private static function getBooleanDate(mixed $value, array $attributes, string $column): bool
private static function getBooleanDate(array $attributes, string $column): bool
{
return array_key_exists($column, $attributes) && $attributes[$column] !== null;
}
Expand Down

0 comments on commit 4fcc5dc

Please sign in to comment.