Cannot use 'Object' as class name as it is reserved on Login

Hello,

I have an application with Yii2 almost finished but when I send the login it fails me

yii\base\ErrorException: Cannot use ‘Object’ as class name as it is reserved in T:\xampp\htdocs\autofactura1\vendor\yiisoft\yii2\base\Object.php:28

Stack trace:

#0 T:\xampp\htdocs\autofactura1\models\User.php(5): ::spl_autoload_call()

#1 T:\xampp\htdocs\autofactura1\vendor\yiisoft\yii2\BaseYii.php(293): yii\BaseYii->unknown()

#2 T:\xampp\htdocs\autofactura1\models\LoginForm.php(76): yii\BaseYii::autoload()

#3 T:\xampp\htdocs\autofactura1\models\LoginForm.php(76): ::spl_autoload_call()

#4 T:\xampp\htdocs\autofactura1\models\LoginForm.php(48): app\models\LoginForm->getUser()

#5 T:\xampp\htdocs\autofactura1\vendor\yiisoft\yii2\validators\InlineValidator.php(72): app\models\LoginForm->validatePassword()

#6 T:\xampp\htdocs\autofactura1\vendor\yiisoft\yii2\validators\InlineValidator.php(72): ::call_user_func:{T:\xampp\htdocs\autofactura1\vendor\yiisoft\yii2\validators\InlineValidator.php:72}()

#7 T:\xampp\htdocs\autofactura1\vendor\yiisoft\yii2\validators\Validator.php(267): yii\validators\InlineValidator->validateAttribute()

#8 T:\xampp\htdocs\autofactura1\vendor\yiisoft\yii2\base\Model.php(367): yii\validators\InlineValidator->validateAttributes()

#9 T:\xampp\htdocs\autofactura1\models\LoginForm.php(62): app\models\LoginForm->validate()

#10 T:\xampp\htdocs\autofactura1\controllers\SiteController.php(79): app\models\LoginForm->login()

#11 T:\xampp\htdocs\autofactura1\vendor\yiisoft\yii2\base\InlineAction.php(57): app\controllers\SiteController->actionLogin()

#12 T:\xampp\htdocs\autofactura1\vendor\yiisoft\yii2\base\InlineAction.php(57): ::call_user_func_array:{T:\xampp\htdocs\autofactura1\vendor\yiisoft\yii2\base\InlineAction.php:57}()

#13 T:\xampp\htdocs\autofactura1\vendor\yiisoft\yii2\base\Controller.php(157): yii\base\InlineAction->runWithParams()

#14 T:\xampp\htdocs\autofactura1\vendor\yiisoft\yii2\base\Module.php(528): app\controllers\SiteController->runAction()

#15 T:\xampp\htdocs\autofactura1\vendor\yiisoft\yii2\web\Application.php(103): yii\web\Application->runAction()

#16 T:\xampp\htdocs\autofactura1\vendor\yiisoft\yii2\base\Application.php(386): yii\web\Application->handleRequest()

#17 T:\xampp\htdocs\autofactura1\web\index.php(12): yii\web\Application->run()

#18 {main}

Copy Stacktrace Search Stackoverflow Search Google Error

In the login part I have not modified anything.

The version of Yii2 is 2.0.15.1 and is updated.

Fail with PHP 7.2.2

Works well with PHP 5.6.36

How do I solve it?

Greetings.

I have already found the solution.

In the file

Replace the sifuinte line




//Replace

//class User extends \yii\base\Object implements \yii\web\IdentityInterface

class User extends \yii\base\BaseObject implements \yii\web\IdentityInterface



Greetings.

en que archivo se reemplaza??

Welcome to the forum. Please post in english here (you can also use the /International/Spanish section of the forum).
Your question: in which file is it replaced?
The answer is everywhere in your app where Object was used.
For the basic template that would be in the User model only.
(Make sure you have an updated/recent version of the framework.)

estoy utilizando la plantilla avanzada pero no encuentro donde cambiar… gracias

Last warning!!

Your question was:
I’m using the advanced template but I can’t find where to change … thanks
Answer:
Search the files in frontend, backend and common dirs for the string Object
.