illuminate icon indicating copy to clipboard operation
illuminate copied to clipboard

Components throw error with wrong return type (cache & logger)

Open 3dgroup opened this issue 1 year ago • 0 comments

What steps will reproduce the problem?

Added the following to backend/config/main.php

'cache' => Yii2tech\Illuminate\Yii\Caching\Cache::class,

Added the following to config/yii.php

'middleware' => [
        'container' => [
            '__class' => Yii2tech\Illuminate\Yii\Di\Container::class,
        ],
        'logger' => [
            '__class' => Yii2tech\Illuminate\Yii\Log\Logger::class,
        ],
],

What is the expected result?

App to run without PHP errors.

What do you get instead?

Yii2tech\Illuminate\Yii\Log\Logger::defaultIlluminateLogger(): Return value must be of type yii\log\Logger, Illuminate\Log\LogManager returned

ii2tech\Illuminate\Yii\Caching\Cache::defaultIlluminateCache(): Return value must be of type Illuminate\Contracts\Cache\Repository, Illuminate\Cache\CacheManager returned

Additional info

App runs fine without these configurations.

Q A
This Package Version 1.2.1
Laravel Framework Version 9.33.0
Yii Framework Version 2.0.46
PHP version 8.1
Operating system Mac Monterey 12.2.1

3dgroup avatar Oct 03 '22 11:10 3dgroup