inflector fix. (#80)
Some checks failed
PHP Coding Standard / phpcs (7.4) (push) Has been cancelled
Tests / linux-tests (mysql, 8.0) (push) Has been cancelled
Tests / linux-tests (mysql, 8.1) (push) Has been cancelled
Tests / linux-tests (pgsql, 8.0) (push) Has been cancelled
Tests / linux-tests (sqlite, 8.0) (push) Has been cancelled

This commit is contained in:
Kamil Wylegala 2024-11-16 18:07:14 +01:00 committed by GitHub
parent cb3382f6d2
commit 789a752cf6
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 5 additions and 1 deletions

View file

@ -59,6 +59,10 @@ It means that composer will look at `master` branch of repository configured und
## Changelog ## Changelog
### 2024-11-16
- Inflector fix: str_place with null.
### 2024-09-21 ### 2024-09-21
- Added wrapper for PDOException to avoid creating dynamic property `queryString`. - Added wrapper for PDOException to avoid creating dynamic property `queryString`.

View file

@ -500,7 +500,7 @@ class Inflector {
*/ */
public static function humanize($lowerCaseAndUnderscoredWord) { public static function humanize($lowerCaseAndUnderscoredWord) {
if (!($result = static::_cache(__FUNCTION__, $lowerCaseAndUnderscoredWord))) { if (!($result = static::_cache(__FUNCTION__, $lowerCaseAndUnderscoredWord))) {
$result = explode(' ', str_replace('_', ' ', $lowerCaseAndUnderscoredWord)); $result = explode(' ', str_replace('_', ' ', $lowerCaseAndUnderscoredWord ?? ""));
foreach ($result as &$word) { foreach ($result as &$word) {
$word = mb_strtoupper(mb_substr($word, 0, 1)) . mb_substr($word, 1); $word = mb_strtoupper(mb_substr($word, 0, 1)) . mb_substr($word, 1);
} }