AbstractFixture.php
protected function createNewInstance(array $data): object
    {
        $instance = self::getInstantiator()->instantiate($this->getEntityClass());

        $refl = $this->getReflection();

        foreach ($data as $key => $value) {
            $prop = $refl->getProperty($key);
            $prop->setAccessible(true);

            if ($value instanceof Closure) {
                $value = $value($instance, $this, $this->manager);
            }

            $prop->setValue($instance, $value);
        }

        return $instance;
    }
protected function createNewInstance(array $data): object
    {
        $instance = self::getInstantiator()->instantiate($this->getEntityClass());

        $refl = $this->getReflection();

        foreach ($data as $key => $value) {
            $prop = $refl->getProperty($key);
            $prop->setAccessible(true);

            if ($value instanceof Closure) {
                $value = $value($instance, $this, $this->manager);
            }

            $prop->setValue($instance, $value);
        }

        return $instance;
    }
protected function createNewInstance ( array $ data ) : object { $ instance = self :: getInstantiator ( ) -> instantiate ( $ this -> getEntityClass ( ) ) ; $ refl = $ this -> getReflection ( ) ; foreach ( $ data as $ key => $ value ) { $ prop = $ refl -> getProperty ( $ key ) ; $ prop -> setAccessible ( true ) ; if ( $ value instanceof Closure ) { $ value = $ value ( $ instance , $ this , $ this -> manager ) ; } $ prop -> setValue ( $ instance , $ value ) ; } return $ instance ; }
Creates a new instance of the class associated with the fixture.
Override this method if you have constructor arguments to manage yourself depending on input data.

@param array $data

@return object
Creates a new instance of the class associated with the fixture . Override this method if you have constructor arguments to manage yourself depending on input data .