public function share(string $id, Closure $value, array $tags = []): void
    {
        $value = function ($container) use ($value) {
            static $sharedValue;

            if ($sharedValue === null) {
                $sharedValue = $value($container);
            }

            return $sharedValue;
        };
        $this->set($id, $value, $tags);
    }
public function share(string $id, Closure $value, array $tags = []): void
    {
        $value = function ($container) use ($value) {
            static $sharedValue;

            if ($sharedValue === null) {
                $sharedValue = $value($container);
            }

            return $sharedValue;
        };
        $this->set($id, $value, $tags);
    }
public function share ( string $ id , Closure $ value , array $ tags = [ ] ) : void { $ value = function ( $ container ) use ( $ value ) { static $ sharedValue ; if ( $ sharedValue === null ) { $ sharedValue = $ value ( $ container ) ; } return $ sharedValue ; } ; $ this -> set ( $ id , $ value , $ tags ) ; }
Set a shared value in the container
Set a shared value in the container