mattiabasone commented on code in PR #3634:
URL: https://github.com/apache/avro/pull/3634#discussion_r2729484150
##########
lang/php/lib/DataFile/AvroDataIOWriter.php:
##########
@@ -67,52 +67,49 @@ class AvroDataIOWriter
/**
* @var string sync marker
*/
- private string $sync_marker;
+ private string $syncMarker;
public function __construct(
AvroIO $io,
- AvroIODatumWriter $datum_writer,
- string|AvroSchema|null $writers_schema = null,
+ AvroIODatumWriter $datumWriter,
+ string|AvroSchema|null $writersSchema = null,
string $codec = AvroDataIO::NULL_CODEC
) {
$this->io = $io;
- $this->datum_writer = $datum_writer;
+ $this->datumWriter = $datumWriter;
$this->encoder = new AvroIOBinaryEncoder($this->io);
$this->buffer = new AvroStringIO();
- $this->buffer_encoder = new AvroIOBinaryEncoder($this->buffer);
- $this->block_count = 0;
+ $this->bufferEncoder = new AvroIOBinaryEncoder($this->buffer);
+ $this->blockCount = 0;
$this->metadata = [];
- if ($writers_schema) {
+ if ($writersSchema) {
if (!AvroDataIO::isValidCodec($codec)) {
throw new AvroDataIOException(
sprintf('codec %s is not supported', $codec)
);
}
- $this->sync_marker = self::generateSyncMarker();
+ $this->syncMarker = self::generateSyncMarker();
$this->metadata[AvroDataIO::METADATA_CODEC_ATTR] = $this->codec =
$codec;
- $this->metadata[AvroDataIO::METADATA_SCHEMA_ATTR] = (string)
$writers_schema;
+ $this->metadata[AvroDataIO::METADATA_SCHEMA_ATTR] = (string)
$writersSchema;
Review Comment:
It's not due to how it's designed right now. When the AvroDataIOWriter is
initialized, if there is a vaid AvroSchema instance, datumWriter->writersSchema
already contains the same value
https://github.com/mattiabasone/avro/blob/81b06f5a1b9197b7c4409d43980b39b97cb4f6af/lang/php/lib/DataFile/AvroDataIO.php#L188
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]