Namespace all 174 Public controllers into XcVm\Public\Controllers\<Admin|Api|
Player|Reseller>, completing the per-file namespace migration. View templates and
entry points (index.php, admin/*.php, stream/*.php, progress/, routes/*.php,
Views/*) stay procedural/global and only gain use imports.
- Split the 3 multi-class Api files per PSR-4: AdminApiController→+AdminAPIWrapper,
Enigma2ApiController→+SimpleXMLExtended (extends \SimpleXMLElement),
ResellerRestApiController→+ResellerAPIWrapper (use-block copied to each new file).
- Add use to referrers — the procedural route files (routes/admin|player|reseller.php)
and index.php now import each routed controller; sibling controllers extend their
base class in the same namespace.
- Qualify built-ins/ioncube/global in the namespaced controllers (\Exception,
\DateTime, \PDO, \SimpleXMLElement, \ZipArchive, \ReflectionClass,
\XC_Bootstrap, \XC_VM, ...). Verified zero unresolved classes by temporarily
analysing src/Public/Controllers under PHPStan, then reverting to scanDirectories
(the ~346 pre-existing legacy findings there are out of scope for this migration).
Verified: php -l clean; PHPStan no errors; PHPUnit 295/295; no global controller
class-files remain; leading-backslash re-sweep clean.