Code Duplication    Length = 12-12 lines in 2 locations

src/ConstraintCheck/Checker/AllowedUnitsChecker.php 1 location

@@ 161-172 (lines=12) @@
158
	 * @param UnboundedQuantityValue $value
159
	 * @return UnboundedQuantityValue
160
	 */
161
	private function standardize( UnboundedQuantityValue $value ) {
162
		if ( $this->unitConverter === null ) {
163
			return $value;
164
		}
165
166
		$standard = $this->unitConverter->toStandardUnits( $value );
167
		if ( $standard !== null ) {
168
			return $standard;
169
		} else {
170
			return $value;
171
		}
172
	}
173
174
	public function checkConstraintParameters( Constraint $constraint ) {
175
		$constraintParameters = $constraint->getConstraintParameters();

src/ConstraintCheck/Helper/RangeCheckerHelper.php 1 location

@@ 64-75 (lines=12) @@
61
	 * @param UnboundedQuantityValue $value
62
	 * @return UnboundedQuantityValue $value converted to standard units if possible, otherwise unchanged $value.
63
	 */
64
	private function standardize( UnboundedQuantityValue $value ) {
65
		if ( $this->unitConverter !== null ) {
66
			$standard = $this->unitConverter->toStandardUnits( $value );
67
			if ( $standard !== null ) {
68
				return $standard;
69
			} else {
70
				return $value;
71
			}
72
		} else {
73
			return $value;
74
		}
75
	}
76
77
	/**
78
	 * Compare two values.