public function registerDefaultEncoders(EncoderRegistry $encoders): EncoderRegistry
    {
        $encoders->registerDefaultObjectEncoder(new ObjectEncoder($encoders, $this->propertyNameFormatter));
        $encoders->registerDefaultScalarEncoder(new ScalarEncoder());
        $encoders->registerEncoder('array', new ArrayEncoder($encoders));
        $dateTimeEncoder = new DateTimeEncoder($this->dateTimeFormat);
        $encoders->registerEncoder(DateTime::class, $dateTimeEncoder);
        $encoders->registerEncoder(DateTimeImmutable::class, $dateTimeEncoder);
        $encoders->registerEncoder(DateTimeInterface::class, $dateTimeEncoder);

        return $encoders;
    }
public function registerDefaultEncoders(EncoderRegistry $encoders): EncoderRegistry
    {
        $encoders->registerDefaultObjectEncoder(new ObjectEncoder($encoders, $this->propertyNameFormatter));
        $encoders->registerDefaultScalarEncoder(new ScalarEncoder());
        $encoders->registerEncoder('array', new ArrayEncoder($encoders));
        $dateTimeEncoder = new DateTimeEncoder($this->dateTimeFormat);
        $encoders->registerEncoder(DateTime::class, $dateTimeEncoder);
        $encoders->registerEncoder(DateTimeImmutable::class, $dateTimeEncoder);
        $encoders->registerEncoder(DateTimeInterface::class, $dateTimeEncoder);

        return $encoders;
    }
public function registerDefaultEncoders ( EncoderRegistry $ encoders ) : EncoderRegistry { $ encoders -> registerDefaultObjectEncoder ( new ObjectEncoder ( $ encoders , $ this -> propertyNameFormatter ) ) ; $ encoders -> registerDefaultScalarEncoder ( new ScalarEncoder ( ) ) ; $ encoders -> registerEncoder ( 'array' , new ArrayEncoder ( $ encoders ) ) ; $ dateTimeEncoder = new DateTimeEncoder ( $ this -> dateTimeFormat ) ; $ encoders -> registerEncoder ( DateTime :: class , $ dateTimeEncoder ) ; $ encoders -> registerEncoder ( DateTimeImmutable :: class , $ dateTimeEncoder ) ; $ encoders -> registerEncoder ( DateTimeInterface :: class , $ dateTimeEncoder ) ; return $ encoders ; }
Registers the default encoders

@param EncoderRegistry $encoders The encoders to register to
@return EncoderRegistry The registry with the default encoders registered
Registers the default encoders