protected function createClassExtensions($classChain, $baseClass)
    {
        //security: just preventing string termination
        $lastClass = str_replace(chr(0), '', $baseClass);
        $parentClass = $lastClass;

        foreach ($classChain as $extensionPath) {
            $extensionPath = str_replace(chr(0), '', $extensionPath);

            if ($this->createClassExtension($parentClass, $extensionPath)) {
                if (\OxidEsales\Eshop\Core\NamespaceInformationProvider::isNamespacedClass($extensionPath)) {
                    $parentClass = $extensionPath;
                    $lastClass = $extensionPath;
                } else {
                    $parentClass = basename($extensionPath);
                    $lastClass = basename($extensionPath);
                }
            }
        }

        //returning the last module from the chain
        return $lastClass;
    }