public static function singleton($class = null)
    {
        if (!$class) {
            $class = get_called_class();
        }

        if (!isset(self::$singletons[$class])) {
            self::$singletons[$class] = self::create($class);
        }

        return self::$singletons[$class];
    }