@@ -65,11 +65,11 @@ class Validator implements IValidator
6565 * @param IFilterContainer|null $filters
6666 * @param IMediaTypeContainer|null $media
6767 */
68- public function __construct (IValidatorHelper $ helper = null ,
69- ISchemaLoader $ loader = null ,
70- IFormatContainer $ formats = null ,
71- IFilterContainer $ filters = null ,
72- IMediaTypeContainer $ media = null )
68+ public function __construct (? IValidatorHelper $ helper = null ,
69+ ? ISchemaLoader $ loader = null ,
70+ ? IFormatContainer $ formats = null ,
71+ ? IFilterContainer $ filters = null ,
72+ ? IMediaTypeContainer $ media = null )
7373 {
7474 $ this ->helper = $ helper ?? new ValidatorHelper ();
7575 $ this ->formats = $ formats ?? new FormatContainer ();
@@ -81,7 +81,7 @@ public function __construct(IValidatorHelper $helper = null,
8181 /**
8282 * @inheritDoc
8383 */
84- public function schemaValidation ($ data , ISchema $ schema , int $ max_errors = 1 , ISchemaLoader $ loader = null ): ValidationResult
84+ public function schemaValidation ($ data , ISchema $ schema , int $ max_errors = 1 , ? ISchemaLoader $ loader = null ): ValidationResult
8585 {
8686 $ bag = new ValidationResult ($ max_errors );
8787
@@ -103,7 +103,7 @@ public function schemaValidation($data, ISchema $schema, int $max_errors = 1, IS
103103 /**
104104 * @inheritDoc
105105 */
106- public function uriValidation ($ data , string $ schema_uri , int $ max_errors = 1 , ISchemaLoader $ loader = null ): ValidationResult
106+ public function uriValidation ($ data , string $ schema_uri , int $ max_errors = 1 , ? ISchemaLoader $ loader = null ): ValidationResult
107107 {
108108 $ schema = new stdClass ();
109109 $ schema ->{'$ref ' } = URI ::normalize ($ schema_uri );
@@ -113,7 +113,7 @@ public function uriValidation($data, string $schema_uri, int $max_errors = 1, IS
113113 /**
114114 * @inheritDoc
115115 */
116- public function dataValidation ($ data , $ schema , int $ max_errors = 1 , ISchemaLoader $ loader = null ): ValidationResult
116+ public function dataValidation ($ data , $ schema , int $ max_errors = 1 , ? ISchemaLoader $ loader = null ): ValidationResult
117117 {
118118 $ schema = is_string ($ schema ) ? Schema::fromJsonString ($ schema ) : new Schema ($ schema );
119119 return $ this ->schemaValidation ($ data , $ schema , $ max_errors , $ loader );
@@ -122,7 +122,7 @@ public function dataValidation($data, $schema, int $max_errors = 1, ISchemaLoade
122122 /**
123123 * @inheritDoc
124124 */
125- public function setFilters (IFilterContainer $ filters = null ): IValidator
125+ public function setFilters (? IFilterContainer $ filters = null ): IValidator
126126 {
127127 $ this ->filters = $ filters ;
128128 return $ this ;
@@ -139,7 +139,7 @@ public function getFilters()
139139 /**
140140 * @inheritDoc
141141 */
142- public function setFormats (IFormatContainer $ formats = null ): IValidator
142+ public function setFormats (? IFormatContainer $ formats = null ): IValidator
143143 {
144144 $ this ->formats = $ formats ;
145145 return $ this ;
@@ -173,7 +173,7 @@ public function getHelper(): IValidatorHelper
173173 /**
174174 * @inheritDoc
175175 */
176- public function setLoader (ISchemaLoader $ loader = null ): IValidator
176+ public function setLoader (? ISchemaLoader $ loader = null ): IValidator
177177 {
178178 $ this ->loader = $ loader ;
179179 return $ this ;
@@ -190,7 +190,7 @@ public function getLoader()
190190 /**
191191 * @inheritDoc
192192 */
193- public function setMediaType (IMediaTypeContainer $ media = null ): IValidator
193+ public function setMediaType (? IMediaTypeContainer $ media = null ): IValidator
194194 {
195195 $ this ->mediaTypes = $ media ;
196196 return $ this ;
@@ -544,7 +544,7 @@ protected function validateKeywords(&$document_data, &$data, array $data_pointer
544544 * @return bool
545545 */
546546 protected function validateCommons (/** @noinspection PhpUnusedParameterInspection */
547- &$ document_data , &$ data , array $ data_pointer , array $ parent_data_pointer , ISchema $ document , $ schema , ValidationResult $ bag , array &$ defaults = null ): bool
547+ &$ document_data , &$ data , array $ data_pointer , array $ parent_data_pointer , ISchema $ document , $ schema , ValidationResult $ bag , ? array &$ defaults = null ): bool
548548 {
549549 $ ok = true ;
550550
@@ -929,7 +929,7 @@ protected function validateConditionals(&$document_data, &$data, array $data_poi
929929 * @param array|null $defaults
930930 * @return bool
931931 */
932- protected function validateProperties (&$ document_data , &$ data , array $ data_pointer , array $ parent_data_pointer , ISchema $ document , $ schema , ValidationResult $ bag , array $ defaults = null ): bool
932+ protected function validateProperties (&$ document_data , &$ data , array $ data_pointer , array $ parent_data_pointer , ISchema $ document , $ schema , ValidationResult $ bag , ? array $ defaults = null ): bool
933933 {
934934 $ type = $ this ->helper ->type ($ data , true );
935935 if ($ type === 'null ' || $ type === 'boolean ' ) {
@@ -1694,7 +1694,7 @@ protected function validateArray(&$document_data, &$data, array $data_pointer, a
16941694 * @param array|null $defaults
16951695 * @return bool
16961696 */
1697- protected function validateObject (&$ document_data , &$ data , array $ data_pointer , array $ parent_data_pointer , ISchema $ document , $ schema , ValidationResult $ bag , array &$ defaults = null ): bool
1697+ protected function validateObject (&$ document_data , &$ data , array $ data_pointer , array $ parent_data_pointer , ISchema $ document , $ schema , ValidationResult $ bag , ? array &$ defaults = null ): bool
16981698 {
16991699 $ ok = true ;
17001700
@@ -2014,7 +2014,7 @@ protected function validateObject(&$document_data, &$data, array $data_pointer,
20142014 * @param $data
20152015 * @param $defaults
20162016 */
2017- protected function setObjectDefaults ($ data , array &$ defaults = null )
2017+ protected function setObjectDefaults ($ data , ? array &$ defaults = null )
20182018 {
20192019 if (is_object ($ data ) && $ defaults ) {
20202020 foreach ($ defaults as $ property => $ value ) {
0 commit comments