Skip to content

Commit 2d869c7

Browse files
ConfigurableModel::hasConfiguration() returns false on empty arrays
1 parent 86b42ac commit 2d869c7

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

Diff for: Changelog.md

+5
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,11 @@
22

33
## 4.x Series
44

5+
## Unreleased
6+
##### 2024-XX-YY
7+
8+
- Changed the `ConfigurableModel::hasConfiguration()` trait to return false on empty arrays as well (until now, only `null` was considered as no config)
9+
510
## 4.1.0
611
##### 2024-07-11
712

Diff for: Traits/ConfigurableModel.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public function configuration(): ?array
4242

4343
public function hasConfiguration(): bool
4444
{
45-
return null !== $this->{static::$configurationFieldName};
45+
return !empty($this->{static::$configurationFieldName});
4646
}
4747

4848
public function doesntHaveConfiguration(): bool

0 commit comments

Comments
 (0)