private function validateInstallerClass($installerClass) { if (!class_exists($installerClass)) { throw NotInstallableException::installerClassNotFound($installerClass); } $reflClass = new ReflectionClass($installerClass); if ($reflClass->hasMethod('__construct') && $reflClass->getMethod('__construct')->getNumberOfRequiredParameters() > 0) { throw NotInstallableException::installerClassNoDefaultConstructor($installerClass); } if (!$reflClass->implementsInterface('Puli\\Manager\\Api\\Installer\\ResourceInstaller')) { throw NotInstallableException::installerClassInvalid($installerClass); } }