isInstantiable()) { throw new \Error(\sprintf("'%s' is not instatiable class", $className)); } if (!$reflection->implementsInterface(Environment::class)) { throw new \Error(\sprintf("The class '%s' does not implement '%s'", $className, Environment::class)); } $environment = $reflection->newInstance(); if (!\defined("AMP_WORKER")) { \define("AMP_WORKER", "amp-worker"); } $runner = new TaskRunner($this, $environment); return $runner->run(); }, $envClassName)); } }