componere を使います。
<?php
class FrontendUser {}
class BackendUser{}
$userDefinition = new Componere\Definition('User', 'FrontendUser');
$userDefinition->register();
$user = new User;
var_dump($user instanceof FrontendUser);
refs.
https://www.php.net/manual/ja/class.componere-definition.php
Discussion