HEX
Server: Apache
System: Linux info 3.0 #1337 SMP Tue Jan 01 00:00:00 CEST 2000 all GNU/Linux
User: u112718762 (3890930)
PHP: 8.1.34
Disabled: NONE
Upload Files
File: //homepages/oneclick/WordPress/6.9/601/scripts/factory/factory.php
<?php
namespace Factory;

use \Core\Environment;
use \Core\Database;

use \Exception;

class Factory
{
    public function factory($appName, Environment $env, Database $db)
    {
        // Class name is the same as app name
        $wrapperName = $appName;

        if (!file_exists('wrappers/' . $wrapperName . '.php')) {
            throw new Exception("wrapper $wrapperName not implemented.");
        }

        $className = "\\Wrappers\\" . $wrapperName;
        return new $className($appName, $env, $db);
    }
}