@@ -33,7 +33,7 @@ abstract class Type
3333 public array $ enum = [];
3434
3535 /** @var scalar|null */
36- public $ constant = null ;
36+ public $ const = null ;
3737
3838 public bool $ nullable = false ;
3939
@@ -94,7 +94,6 @@ public function contentEncoding(string $encoding): self
9494 public function addProperties (Type $ fromType ): self
9595 {
9696 $ this ->attributes = $ fromType ->attributes ;
97-
9897 $ this ->format = $ fromType ->format ;
9998 $ this ->description = $ fromType ->description ;
10099 $ this ->contentMediaType = $ fromType ->contentMediaType ;
@@ -103,6 +102,7 @@ public function addProperties(Type $fromType): self
103102 $ this ->default = $ fromType ->default ;
104103 $ this ->examples = $ fromType ->examples ;
105104 $ this ->enum = $ fromType ->enum ;
105+ $ this ->const = $ fromType ->const ;
106106 $ this ->nullable = $ fromType ->nullable ;
107107 $ this ->deprecated = $ fromType ->deprecated ;
108108 $ this ->pattern = $ fromType ->pattern ;
@@ -122,7 +122,7 @@ public function toArray()
122122 'deprecated ' => $ this ->deprecated ,
123123 'pattern ' => $ this ->pattern ,
124124 'enum ' => count ($ this ->enum ) ? $ this ->enum : null ,
125- 'const ' => ! is_null ($ this ->constant ) ? $ this ->constant : null ,
125+ 'const ' => ! is_null ($ this ->const ) ? $ this ->const : null ,
126126 ]),
127127 $ this ->example instanceof MissingValue ? [] : ['example ' => $ this ->example ],
128128 $ this ->default instanceof MissingValue ? [] : ['default ' => $ this ->default ],
@@ -157,12 +157,12 @@ public function enum(array $enum): self
157157 }
158158
159159 /**
160- * @param scalar $constant
160+ * @param scalar $const
161161 * @return $this
162162 */
163- public function constant ( $ constant ): self
163+ public function const ( $ const ): self
164164 {
165- $ this ->constant = $ constant ;
165+ $ this ->const = $ const ;
166166
167167 return $ this ;
168168 }
0 commit comments