public static function createInstance($className, $projectPath)
    {
        Runtime::reset();
        self::$projectPath = $projectPath;
        $binder = new Binder();
        foreach (static::getBindingsForApp($className) as $bindingModule) {
            if (is_string($bindingModule)) {
                $bindingModule = new $bindingModule();
            }

            if ($bindingModule instanceof BindingModule) {
                $bindingModule->configure($binder, $projectPath);
            } elseif ($bindingModule instanceof \Closure) {
                $bindingModule($binder, $projectPath);
            } else {
                throw new \InvalidArgumentException(
                        'Given module class ' . get_class($bindingModule)
                        . ' is not an instance of stubbles\ioc\module\BindingModule'
                );
            }
        }

        return $binder->getInjector()->getInstance($className);
    }