src/Container.php
public function singleton($className) {
        $closure = function(ContainerInterface $container) use($className) {
            static $instance;
            
            if (is_null($instance)) {
                $instance = $container->make($className);
            }

            return $instance;
        };

        $this->bind($className, $closure);
    }
public function singleton($className) {
        $closure = function(ContainerInterface $container) use($className) {
            static $instance;
            
            if (is_null($instance)) {
                $instance = $container->make($className);
            }

            return $instance;
        };

        $this->bind($className, $closure);
    }
public function singleton ( $ className ) { $ closure = function ( ContainerInterface $ container ) use ( $ className ) { static $ instance ; if ( is_null ( $ instance ) ) { $ instance = $ container -> make ( $ className ) ; } return $ instance ; } ; $ this -> bind ( $ className , $ closure ) ; }
Register a shared binding

@param string $className
Register a shared binding