public function getNewInstance(\ReflectionClass $class) : NewInstance
    {
        $setterMethods = new SetterMethods([]);
        $methods = $class->getMethods();
        foreach ($methods as $method) {
            if ($method->name === '__construct') {
                continue;
            }
            $setterMethods->add($this->injectionMethod->getSetterMethod($method));
        }
        $name = $this->injectionMethod->getConstructorName($class);

        return new NewInstance($class, $setterMethods, $name);
    }
public function getNewInstance(\ReflectionClass $class) : NewInstance
    {
        $setterMethods = new SetterMethods([]);
        $methods = $class->getMethods();
        foreach ($methods as $method) {
            if ($method->name === '__construct') {
                continue;
            }
            $setterMethods->add($this->injectionMethod->getSetterMethod($method));
        }
        $name = $this->injectionMethod->getConstructorName($class);

        return new NewInstance($class, $setterMethods, $name);
    }
public function getNewInstance ( \ ReflectionClass $ class ) : NewInstance { $ setterMethods = new SetterMethods ( [ ] ) ; $ methods = $ class -> getMethods ( ) ; foreach ( $ methods as $ method ) { if ( $ method -> name === '__construct' ) { continue ; } $ setterMethods -> add ( $ this -> injectionMethod -> getSetterMethod ( $ method ) ) ; } $ name = $ this -> injectionMethod -> getConstructorName ( $ class ) ; return new NewInstance ( $ class , $ setterMethods , $ name ) ; }
Return factory instance

@param \ReflectionClass $class Target class reflection
Return factory instance