[x] I have searched for similar issues in both open and closed tickets and cannot find a duplicate.
[x] The issue still exists against the latest master branch of yii2-icons.
[x] This is not an usage question. I confirm having gone through and read the documentation and demos.
[x] This is not a general programming / coding question. (Those should be directed to the webtips Q & A forum).
[x] I have attempted to find the simplest possible steps to reproduce the issue.
[ ] I have included a failing test as a pull request (Optional).
Steps to reproduce the issue
Use yii 2.0.45 with php 8.1
Include Icon::map($this);
Expected behavior and actual behavior
When I follow those steps, I see...
PHP Deprecated Warning – yii\base\ErrorException
strlen(): Passing null to parameter #1 ($string) of type string is deprecated
1. in /Users/Documents/code/htdocs/remv2/vendor/kartik-v/yii2-icons/src/Icon.phpat line 169
* @var string $framework the framework to be used with the application
* @var string $method the method in the Icon class (defaults to `show`)
* @returns string the icon framework key
* @throws InvalidConfigException
* @return string
*/
protected static function getFramework($framework = null, $method = 'show')
{
$len = strlen($framework); <--- error here
if ($len > 0 && !in_array($framework, array_keys(self::$_frameworks))) {
$replace = ['{framework}' => $framework, '{method}' => 'Icon::' . $method];
throw new InvalidConfigException(strtr(self::FRAMEWORK_INVALID, $replace));
}
if ($len > 0) {
return $framework;
}
if ($len === 0 && empty(Yii::$app->params['icon-framework'])) {
throw new InvalidConfigException(self::PARAM_NOT_SET);
I was expecting...
The page to load without errors
Prerequisites
master
branch of yii2-icons.Steps to reproduce the issue
Icon::map($this);
Expected behavior and actual behavior
When I follow those steps, I see...
I was expecting... The page to load without errors
Environment
Browsers
Operating System
Libraries
Isolating the problem