From dc2eaeae5c5699975c8836a32e6e043d083fb531 Mon Sep 17 00:00:00 2001 From: Bart Jaskulski <bjaskulski@protonmail.com> Date: Mon, 23 Aug 2021 10:33:32 +0200 Subject: [PATCH] fix: fixed get_attribute checks isset instead of returning value --- changelog.txt | 4 ++++ src/Field/Traits/HtmlAttributes.php | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/changelog.txt b/changelog.txt index 79731c8..ee2493b 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,9 @@ # Changelog +## [2.4.6] - 2021-08-23 +### Fixed +- Get attribute now returns attribute instead of bool value + ## [2.4.5] - 2021-06-02 ### Fixed - Added text multiple field diff --git a/src/Field/Traits/HtmlAttributes.php b/src/Field/Traits/HtmlAttributes.php index df4f760..8116ee9 100644 --- a/src/Field/Traits/HtmlAttributes.php +++ b/src/Field/Traits/HtmlAttributes.php @@ -61,9 +61,9 @@ trait HtmlAttributes { * @param string $name * @param mixed $default * - * @return mixed + * @return string */ public function get_attribute( $name, $default = null ) { - return isset( $this->attributes[ $name ] ) ?: $default; + return $this->attributes[ $name ] ?? $default; } -} \ No newline at end of file +} -- GitLab