Skip to content

Commit

Permalink
Merge pull request #15 from luyadev/php81-fix
Browse files Browse the repository at this point in the history
Ensure value is not null
  • Loading branch information
nadar authored Jan 18, 2023
2 parents 01ef741 + 38cc2a2 commit c709157
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,10 @@

All notable changes to this project will be documented in this file. This project adheres to [Semantic Versioning](http://semver.org/).

## 1.4.1 (18. January 2022)

+ [#15](https://github.com/luyadev/yii-helpers/pull/15) Fix PHP 8.1 compatibility bug in `ArrayHelper::searchColumns()`

## 1.4.0 (20. October 2022)

+ [#13](https://github.com/luyadev/yii-helpers/pull/13) Added `Json::decodeSilent()` method which wont throw an exception and returns defined default value instead.
Expand Down Expand Up @@ -37,4 +41,4 @@ All notable changes to this project will be documented in this file. This projec

## 1.0.0 (2. February 2021)

+ First stable release
+ First stable release
2 changes: 1 addition & 1 deletion src/helpers/ArrayHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,7 @@ public static function searchColumn(array $array, $column, $search)
public static function searchColumns(array $array, $column, $search)
{
$keys = array_filter($array, function ($var) use ($column, $search) {
return strcasecmp($search, $var[$column]) == 0 ? true : false;
return strcasecmp($search, (string) $var[$column]) == 0 ? true : false;
});

return $keys;
Expand Down

0 comments on commit c709157

Please sign in to comment.