src/Hades/Container/Container.php
public function singleton($contract, $class, $args = [])
    {
        $reflect = new \ReflectionClass($class);
        $instance = $reflect->newInstanceArgs($args);

        $this->bindings[$contract] = [
            'type' => 'singleton',
            'instance' => $instance,
            'class' => $class,
            'args' => $args
        ];

        if (!class_exists($contract, false)) {
            eval("class {$contract} extends \Hades\Container\Facade {} ");
        }
    }
public function singleton($contract, $class, $args = [])
    {
        $reflect = new \ReflectionClass($class);
        $instance = $reflect->newInstanceArgs($args);

        $this->bindings[$contract] = [
            'type' => 'singleton',
            'instance' => $instance,
            'class' => $class,
            'args' => $args
        ];

        if (!class_exists($contract, false)) {
            eval("class {$contract} extends \Hades\Container\Facade {} ");
        }
    }
public function singleton ( $ contract , $ class , $ args = [ ] ) { $ reflect = new \ ReflectionClass ( $ class ) ; $ instance = $ reflect -> newInstanceArgs ( $ args ) ; $ this -> bindings [ $ contract ] = [ 'type' => 'singleton' , 'instance' => $ instance , 'class' => $ class , 'args' => $ args ] ; if ( ! class_exists ( $ contract , false ) ) { eval ( "class {$contract} extends \Hades\Container\Facade {} " ) ; } }
the class will instance one time when use
the class will instance one time when use