src/ConstraintCheck/Checker/TypeChecker.php 1 location
|
@@ 139-153 (lines=15) @@
|
136 |
|
->withMetadata( $result->getMetadata() ); |
137 |
|
} |
138 |
|
|
139 |
|
public function checkConstraintParameters( Constraint $constraint ) { |
140 |
|
$constraintParameters = $constraint->getConstraintParameters(); |
141 |
|
$exceptions = []; |
142 |
|
try { |
143 |
|
$this->constraintParameterParser->parseClassParameter( $constraintParameters, $constraint->getConstraintTypeItemId() ); |
144 |
|
} catch ( ConstraintParameterException $e ) { |
145 |
|
$exceptions[] = $e; |
146 |
|
} |
147 |
|
try { |
148 |
|
$this->constraintParameterParser->parseRelationParameter( $constraintParameters, $constraint->getConstraintTypeItemId() ); |
149 |
|
} catch ( ConstraintParameterException $e ) { |
150 |
|
$exceptions[] = $e; |
151 |
|
} |
152 |
|
return $exceptions; |
153 |
|
} |
154 |
|
|
155 |
|
} |
156 |
|
|
src/ConstraintCheck/Checker/ConflictsWithChecker.php 1 location
|
@@ 145-159 (lines=15) @@
|
142 |
|
return new CheckResult( $context, $constraint, $parameters, $status, $message ); |
143 |
|
} |
144 |
|
|
145 |
|
public function checkConstraintParameters( Constraint $constraint ) { |
146 |
|
$constraintParameters = $constraint->getConstraintParameters(); |
147 |
|
$exceptions = []; |
148 |
|
try { |
149 |
|
$this->constraintParameterParser->parsePropertyParameter( $constraintParameters, $constraint->getConstraintTypeItemId() ); |
150 |
|
} catch ( ConstraintParameterException $e ) { |
151 |
|
$exceptions[] = $e; |
152 |
|
} |
153 |
|
try { |
154 |
|
$this->constraintParameterParser->parseItemsParameter( $constraintParameters, $constraint->getConstraintTypeItemId(), false ); |
155 |
|
} catch ( ConstraintParameterException $e ) { |
156 |
|
$exceptions[] = $e; |
157 |
|
} |
158 |
|
return $exceptions; |
159 |
|
} |
160 |
|
|
161 |
|
} |
162 |
|
|
src/ConstraintCheck/Checker/ItemChecker.php 1 location
|
@@ 135-149 (lines=15) @@
|
132 |
|
return new CheckResult( $context, $constraint, $parameters, $status, $message ); |
133 |
|
} |
134 |
|
|
135 |
|
public function checkConstraintParameters( Constraint $constraint ) { |
136 |
|
$constraintParameters = $constraint->getConstraintParameters(); |
137 |
|
$exceptions = []; |
138 |
|
try { |
139 |
|
$this->constraintParameterParser->parsePropertyParameter( $constraintParameters, $constraint->getConstraintTypeItemId() ); |
140 |
|
} catch ( ConstraintParameterException $e ) { |
141 |
|
$exceptions[] = $e; |
142 |
|
} |
143 |
|
try { |
144 |
|
$this->constraintParameterParser->parseItemsParameter( $constraintParameters, $constraint->getConstraintTypeItemId(), false ); |
145 |
|
} catch ( ConstraintParameterException $e ) { |
146 |
|
$exceptions[] = $e; |
147 |
|
} |
148 |
|
return $exceptions; |
149 |
|
} |
150 |
|
|
151 |
|
} |
152 |
|
|
src/ConstraintCheck/Checker/DiffWithinRangeChecker.php 1 location
|
@@ 210-228 (lines=19) @@
|
207 |
|
return new CheckResult( $context, $constraint, $parameters, $status, $message ); |
208 |
|
} |
209 |
|
|
210 |
|
public function checkConstraintParameters( Constraint $constraint ) { |
211 |
|
$constraintParameters = $constraint->getConstraintParameters(); |
212 |
|
$exceptions = []; |
213 |
|
try { |
214 |
|
$this->constraintParameterParser->parseRangeParameter( |
215 |
|
$constraintParameters, |
216 |
|
$constraint->getConstraintTypeItemId(), |
217 |
|
'quantity' |
218 |
|
); |
219 |
|
} catch ( ConstraintParameterException $e ) { |
220 |
|
$exceptions[] = $e; |
221 |
|
} |
222 |
|
try { |
223 |
|
$this->constraintParameterParser->parsePropertyParameter( $constraintParameters, $constraint->getConstraintTypeItemId() ); |
224 |
|
} catch ( ConstraintParameterException $e ) { |
225 |
|
$exceptions[] = $e; |
226 |
|
} |
227 |
|
return $exceptions; |
228 |
|
} |
229 |
|
|
230 |
|
} |
231 |
|
|
src/ConstraintCheck/Checker/TargetRequiredClaimChecker.php 1 location
|
@@ 168-182 (lines=15) @@
|
165 |
|
DependencyMetadata::ofEntityId( $targetEntityId ) ) ); |
166 |
|
} |
167 |
|
|
168 |
|
public function checkConstraintParameters( Constraint $constraint ) { |
169 |
|
$constraintParameters = $constraint->getConstraintParameters(); |
170 |
|
$exceptions = []; |
171 |
|
try { |
172 |
|
$this->constraintParameterParser->parsePropertyParameter( $constraintParameters, $constraint->getConstraintTypeItemId() ); |
173 |
|
} catch ( ConstraintParameterException $e ) { |
174 |
|
$exceptions[] = $e; |
175 |
|
} |
176 |
|
try { |
177 |
|
$this->constraintParameterParser->parseItemsParameter( $constraintParameters, $constraint->getConstraintTypeItemId(), false ); |
178 |
|
} catch ( ConstraintParameterException $e ) { |
179 |
|
$exceptions[] = $e; |
180 |
|
} |
181 |
|
return $exceptions; |
182 |
|
} |
183 |
|
|
184 |
|
} |
185 |
|
|
src/ConstraintCheck/Checker/ValueTypeChecker.php 1 location
|
@@ 181-195 (lines=15) @@
|
178 |
|
->withMetadata( $result->getMetadata() ); |
179 |
|
} |
180 |
|
|
181 |
|
public function checkConstraintParameters( Constraint $constraint ) { |
182 |
|
$constraintParameters = $constraint->getConstraintParameters(); |
183 |
|
$exceptions = []; |
184 |
|
try { |
185 |
|
$this->constraintParameterParser->parseClassParameter( $constraintParameters, $constraint->getConstraintTypeItemId() ); |
186 |
|
} catch ( ConstraintParameterException $e ) { |
187 |
|
$exceptions[] = $e; |
188 |
|
} |
189 |
|
try { |
190 |
|
$this->constraintParameterParser->parseRelationParameter( $constraintParameters, $constraint->getConstraintTypeItemId() ); |
191 |
|
} catch ( ConstraintParameterException $e ) { |
192 |
|
$exceptions[] = $e; |
193 |
|
} |
194 |
|
return $exceptions; |
195 |
|
} |
196 |
|
|
197 |
|
} |
198 |
|
|
src/ConstraintCheck/Checker/RangeChecker.php 1 location
|
@@ 180-196 (lines=17) @@
|
177 |
|
return $message; |
178 |
|
} |
179 |
|
|
180 |
|
public function checkConstraintParameters( Constraint $constraint ) { |
181 |
|
$constraintParameters = $constraint->getConstraintParameters(); |
182 |
|
$exceptions = []; |
183 |
|
try { |
184 |
|
// we don’t have a data value here, so get the type from the property instead |
185 |
|
// (the distinction between data type and data value type is irrelevant for 'quantity' and 'time') |
186 |
|
$type = $this->propertyDataTypeLookup->getDataTypeIdForProperty( $constraint->getPropertyId() ); |
187 |
|
$this->constraintParameterParser->parseRangeParameter( |
188 |
|
$constraintParameters, |
189 |
|
$constraint->getConstraintTypeItemId(), |
190 |
|
$type |
191 |
|
); |
192 |
|
} catch ( ConstraintParameterException $e ) { |
193 |
|
$exceptions[] = $e; |
194 |
|
} |
195 |
|
return $exceptions; |
196 |
|
} |
197 |
|
|
198 |
|
} |
199 |
|
|