Override User class in 8.1

Permalink
Hi,

In 5.7 I used a application specific User class by setting aliases in config/app.php:
'aliases' => array(
'User' => '\Application\Src\User\User',
)

I have now upgraded to 8.1 and this is not working anymore.
I tried either 'enable_legacy_src_namespace' => true, and moving it to a Concrete directory: User' => '\Application\Concrete\User\User', but neither works

It looks like the class is loaded, but I am now getting

Argument 1 passed to Concrete\Core\Page\Event::setUser() must be an instance of Application\Src\User\User, instance of Concrete\Core\User\User given

Any idea on how to solve this?

 
Gondwana replied on at Permalink Reply
Gondwana
rklomp replied on at Permalink Reply
Thanks for your reply. As said in my initial post, I already tried that and it seems the class is loaded succesfully. I am getting a different error message
Gondwana replied on at Permalink Reply
Gondwana
Sorry; I didn't read the question properly (as you know).

I can't help but wonder if the use of an alias is outsmarting symfony's devious machinations.
rklomp replied on at Permalink Reply
My guess is that not all code is using the alias, and thus when changing the alias you will get a type conflict.