mattiabasone commented on code in PR #3624:
URL: https://github.com/apache/avro/pull/3624#discussion_r2689722737


##########
lang/php/lib/Schema/AvroField.php:
##########
@@ -82,35 +84,86 @@ class AvroField extends AvroSchema implements 
AvroAliasedSchema
      */
     private ?string $order;
     private ?array $aliases;
+    private ?string $doc;
 
     /**
-     * @throws AvroSchemaParseException
+     * @param array<string> $aliases
      * @todo Check validity of $default value
      */
-    public function __construct(
-        ?string $name,
+    private function __construct(

Review Comment:
   Sure, my main concern is that, with the current version, some validation on 
AvroField are made in the `foreach` inside `AvroRecordSchema::parseFields`, 
other ones in the `AvroField` class.
   With these new changes we are sure that:
   - only validated data can reach the method `__constructor` and you cannot 
initialize an invalid class calling directly the `__construtor`
   - we can strictly type the parameters in the AvroField `__construct`, 
instead having mixed types



-- 
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]

Reply via email to