Completed
Push — master ( f4362b...61d821 )
by
unknown
01:43
created
includes/CrossCheck/CrossCheckInteractor.php 1 patch
Spacing   +62 added lines, -62 removed lines patch added patch discarded remove patch
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
 	 */
38 38
 	private $crossChecker;
39 39
 
40
-	public function __construct( EntityLookup $entityLookup, StatementGuidParser $statementGuidParser, CrossChecker $crossChecker ) {
40
+	public function __construct(EntityLookup $entityLookup, StatementGuidParser $statementGuidParser, CrossChecker $crossChecker) {
41 41
 		$this->entityLookup = $entityLookup;
42 42
 		$this->statementGuidParser = $statementGuidParser;
43 43
 		$this->crossChecker = $crossChecker;
@@ -50,11 +50,11 @@  discard block
 block discarded – undo
50 50
 	 *
51 51
 	 * @return CrossCheckResultList|null
52 52
 	 */
53
-	public function crossCheckEntityById( EntityId $entityId ) {
54
-		$entity = $this->entityLookup->getEntity( $entityId );
53
+	public function crossCheckEntityById(EntityId $entityId) {
54
+		$entity = $this->entityLookup->getEntity($entityId);
55 55
 
56
-		if ( $entity instanceof StatementListProvider ) {
57
-			return $this->crossCheckStatements( $entity->getStatements() );
56
+		if ($entity instanceof StatementListProvider) {
57
+			return $this->crossCheckStatements($entity->getStatements());
58 58
 		}
59 59
 
60 60
 		return null;
@@ -67,12 +67,12 @@  discard block
 block discarded – undo
67 67
 	 *
68 68
 	 * @return CrossCheckResultList[]
69 69
 	 */
70
-	public function crossCheckEntitiesByIds( array $entityIds ) {
71
-		Assert::parameterElementType( EntityId::class,  $entityIds, '$entityIds' );
70
+	public function crossCheckEntitiesByIds(array $entityIds) {
71
+		Assert::parameterElementType(EntityId::class, $entityIds, '$entityIds');
72 72
 
73 73
 		$results = [];
74
-		foreach ( $entityIds as $entityId ) {
75
-			$results[$entityId->getSerialization()] = $this->crossCheckEntityById( $entityId );
74
+		foreach ($entityIds as $entityId) {
75
+			$results[$entityId->getSerialization()] = $this->crossCheckEntityById($entityId);
76 76
 		}
77 77
 
78 78
 		return $results;
@@ -85,8 +85,8 @@  discard block
 block discarded – undo
85 85
 	 *
86 86
 	 * @return CrossCheckResultList
87 87
 	 */
88
-	public function crossCheckStatements( StatementList $statements ) {
89
-		return $this->crossChecker->crossCheckStatements( $statements, $statements );
88
+	public function crossCheckStatements(StatementList $statements) {
89
+		return $this->crossChecker->crossCheckStatements($statements, $statements);
90 90
 	}
91 91
 
92 92
 	/**
@@ -97,14 +97,14 @@  discard block
 block discarded – undo
97 97
 	 * @return CrossCheckResultList[]
98 98
 	 * @throws InvalidArgumentException
99 99
 	 */
100
-	public function crossCheckEntities( array $entities ) {
101
-		Assert::parameterElementType( EntityDocument::class,  $entities, '$entities' );
100
+	public function crossCheckEntities(array $entities) {
101
+		Assert::parameterElementType(EntityDocument::class, $entities, '$entities');
102 102
 
103 103
 		$results = [];
104
-		foreach ( $entities as $entity ) {
104
+		foreach ($entities as $entity) {
105 105
 			$entityId = $entity->getId()->getSerialization();
106
-			if ( $entity instanceof StatementListProvider ) {
107
-				$results[$entityId] = $this->crossCheckStatements( $entity->getStatements() );
106
+			if ($entity instanceof StatementListProvider) {
107
+				$results[$entityId] = $this->crossCheckStatements($entity->getStatements());
108 108
 			}
109 109
 		}
110 110
 
@@ -120,13 +120,13 @@  discard block
 block discarded – undo
120 120
 	 * @return CrossCheckResultList|null
121 121
 	 * @throws InvalidArgumentException
122 122
 	 */
123
-	public function crossCheckEntityByIdWithProperties( EntityId $entityId, array $propertyIds ) {
124
-		Assert::parameterElementType( PropertyId::class,  $propertyIds, '$propertyIds' );
123
+	public function crossCheckEntityByIdWithProperties(EntityId $entityId, array $propertyIds) {
124
+		Assert::parameterElementType(PropertyId::class, $propertyIds, '$propertyIds');
125 125
 
126
-		$entity = $this->entityLookup->getEntity( $entityId );
126
+		$entity = $this->entityLookup->getEntity($entityId);
127 127
 
128
-		if ( $entity instanceof StatementListProvider ) {
129
-			return $this->crossCheckStatementsWithProperties( $entity->getStatements(), $propertyIds );
128
+		if ($entity instanceof StatementListProvider) {
129
+			return $this->crossCheckStatementsWithProperties($entity->getStatements(), $propertyIds);
130 130
 		}
131 131
 
132 132
 		return null;
@@ -141,13 +141,13 @@  discard block
 block discarded – undo
141 141
 	 * @return CrossCheckResultList[]
142 142
 	 * @throws InvalidArgumentException
143 143
 	 */
144
-	public function crossCheckEntitiesByIdWithProperties( array $entityIds, array $propertyIds ) {
145
-		Assert::parameterElementType( EntityId::class,  $entityIds, '$entityIds' );
146
-		Assert::parameterElementType( PropertyId::class,  $propertyIds, '$propertyIds' );
144
+	public function crossCheckEntitiesByIdWithProperties(array $entityIds, array $propertyIds) {
145
+		Assert::parameterElementType(EntityId::class, $entityIds, '$entityIds');
146
+		Assert::parameterElementType(PropertyId::class, $propertyIds, '$propertyIds');
147 147
 
148 148
 		$results = [];
149
-		foreach ( $entityIds as $entityId ) {
150
-			$results[$entityId->getSerialization()] = $this->crossCheckEntityByIdWithProperties( $entityId, $propertyIds );
149
+		foreach ($entityIds as $entityId) {
150
+			$results[$entityId->getSerialization()] = $this->crossCheckEntityByIdWithProperties($entityId, $propertyIds);
151 151
 		}
152 152
 
153 153
 		return $results;
@@ -162,17 +162,17 @@  discard block
 block discarded – undo
162 162
 	 * @return CrossCheckResultList
163 163
 	 * @throws InvalidArgumentException
164 164
 	 */
165
-	public function crossCheckStatementsWithProperties( StatementList $entityStatements, array $propertyIds ) {
166
-		Assert::parameterElementType( PropertyId::class,  $propertyIds, '$propertyIds' );
165
+	public function crossCheckStatementsWithProperties(StatementList $entityStatements, array $propertyIds) {
166
+		Assert::parameterElementType(PropertyId::class, $propertyIds, '$propertyIds');
167 167
 
168 168
 		$statements = new StatementList();
169
-		foreach ( $entityStatements->toArray() as $statement ) {
170
-			if ( in_array( $statement->getPropertyId(), $propertyIds ) ) {
171
-				$statements->addStatement( $statement );
169
+		foreach ($entityStatements->toArray() as $statement) {
170
+			if (in_array($statement->getPropertyId(), $propertyIds)) {
171
+				$statements->addStatement($statement);
172 172
 			}
173 173
 		}
174 174
 
175
-		return $this->crossChecker->crossCheckStatements( $entityStatements, $statements );
175
+		return $this->crossChecker->crossCheckStatements($entityStatements, $statements);
176 176
 	}
177 177
 
178 178
 	/**
@@ -184,14 +184,14 @@  discard block
 block discarded – undo
184 184
 	 * @return CrossCheckResultList[]
185 185
 	 * @throws InvalidArgumentException
186 186
 	 */
187
-	public function crossCheckEntitiesWithProperties( array $entities, array $propertyIds ) {
188
-		Assert::parameterElementType( EntityDocument::class,  $entities, '$entities' );
189
-		Assert::parameterElementType( PropertyId::class,  $propertyIds, '$propertyIds' );
187
+	public function crossCheckEntitiesWithProperties(array $entities, array $propertyIds) {
188
+		Assert::parameterElementType(EntityDocument::class, $entities, '$entities');
189
+		Assert::parameterElementType(PropertyId::class, $propertyIds, '$propertyIds');
190 190
 
191 191
 		$results = [];
192
-		foreach ( $entities as $entity ) {
192
+		foreach ($entities as $entity) {
193 193
 			$entityId = $entity->getId()->getSerialization();
194
-			if ( $entity instanceof StatementListProvider ) {
194
+			if ($entity instanceof StatementListProvider) {
195 195
 				$results[$entityId] = $this->crossCheckStatementsWithProperties(
196 196
 					$entity->getStatements(),
197 197
 					$propertyIds
@@ -210,12 +210,12 @@  discard block
 block discarded – undo
210 210
 	 * @return CrossCheckResultList
211 211
 	 * @throws InvalidArgumentException
212 212
 	 */
213
-	public function crossCheckStatementByGuid( $guid ) {
214
-		$this->assertIsString( $guid, '$guid' );
213
+	public function crossCheckStatementByGuid($guid) {
214
+		$this->assertIsString($guid, '$guid');
215 215
 
216
-		$resultList = $this->crossCheckStatementsByGuids( [ $guid ] );
216
+		$resultList = $this->crossCheckStatementsByGuids([$guid]);
217 217
 
218
-		return reset( $resultList );
218
+		return reset($resultList);
219 219
 	}
220 220
 
221 221
 	/**
@@ -226,21 +226,21 @@  discard block
 block discarded – undo
226 226
 	 * @return CrossCheckResultList[]
227 227
 	 * @throws InvalidArgumentException
228 228
 	 */
229
-	public function crossCheckStatementsByGuids( array $guids ) {
230
-		$this->assertIsArrayOfStrings( $guids, '$guids' );
229
+	public function crossCheckStatementsByGuids(array $guids) {
230
+		$this->assertIsArrayOfStrings($guids, '$guids');
231 231
 
232 232
 		$entityIds = [];
233 233
 		$groupedStatementGuids = [];
234
-		foreach ( $guids as $guid ) {
235
-			$serializedEntityId = $this->statementGuidParser->parse( $guid )->getEntityId();
234
+		foreach ($guids as $guid) {
235
+			$serializedEntityId = $this->statementGuidParser->parse($guid)->getEntityId();
236 236
 			$entityIds[$serializedEntityId->getSerialization()] = $serializedEntityId;
237 237
 			$groupedStatementGuids[$serializedEntityId->getSerialization()][] = $guid;
238 238
 		}
239 239
 
240 240
 		$resultLists = [];
241
-		foreach ( $groupedStatementGuids as $serializedEntityId => $guidsOfEntity ) {
242
-			$entityId = $entityIds[ $serializedEntityId ];
243
-			$resultLists[ $serializedEntityId ] = $this->crossCheckClaimsOfEntity( $entityId, $guidsOfEntity );
241
+		foreach ($groupedStatementGuids as $serializedEntityId => $guidsOfEntity) {
242
+			$entityId = $entityIds[$serializedEntityId];
243
+			$resultLists[$serializedEntityId] = $this->crossCheckClaimsOfEntity($entityId, $guidsOfEntity);
244 244
 		}
245 245
 
246 246
 		return $resultLists;
@@ -252,18 +252,18 @@  discard block
 block discarded – undo
252 252
 	 *
253 253
 	 * @return CrossCheckResultList|null
254 254
 	 */
255
-	private function crossCheckClaimsOfEntity( EntityId $entityId, array $guids ) {
256
-		$entity = $this->entityLookup->getEntity( $entityId );
255
+	private function crossCheckClaimsOfEntity(EntityId $entityId, array $guids) {
256
+		$entity = $this->entityLookup->getEntity($entityId);
257 257
 
258
-		if ( $entity instanceof StatementListProvider ) {
258
+		if ($entity instanceof StatementListProvider) {
259 259
 			$statements = new StatementList();
260
-			foreach ( $entity->getStatements()->toArray() as $statement ) {
261
-				if ( in_array( $statement->getGuid(), $guids ) ) {
262
-					$statements->addStatement( $statement );
260
+			foreach ($entity->getStatements()->toArray() as $statement) {
261
+				if (in_array($statement->getGuid(), $guids)) {
262
+					$statements->addStatement($statement);
263 263
 				}
264 264
 			}
265 265
 
266
-			return $this->crossChecker->crossCheckStatements( $entity->getStatements(), $statements );
266
+			return $this->crossChecker->crossCheckStatements($entity->getStatements(), $statements);
267 267
 		}
268 268
 
269 269
 		return null;
@@ -275,9 +275,9 @@  discard block
 block discarded – undo
275 275
 	 *
276 276
 	 * @throws InvalidArgumentException
277 277
 	 */
278
-	private function assertIsString( $string, $parameterName ) {
279
-		if ( !is_string( $string ) ) {
280
-			throw new InvalidArgumentException( "$parameterName must be string." );
278
+	private function assertIsString($string, $parameterName) {
279
+		if (!is_string($string)) {
280
+			throw new InvalidArgumentException("$parameterName must be string.");
281 281
 		}
282 282
 	}
283 283
 
@@ -287,10 +287,10 @@  discard block
 block discarded – undo
287 287
 	 *
288 288
 	 * @throws InvalidArgumentException
289 289
 	 */
290
-	private function assertIsArrayOfStrings( array $strings, $parameterName ) {
291
-		foreach ( $strings as $string ) {
292
-			if ( !is_string( $string ) ) {
293
-				throw new InvalidArgumentException( "Each element of $parameterName must be string." );
290
+	private function assertIsArrayOfStrings(array $strings, $parameterName) {
291
+		foreach ($strings as $string) {
292
+			if (!is_string($string)) {
293
+				throw new InvalidArgumentException("Each element of $parameterName must be string.");
294 294
 			}
295 295
 		}
296 296
 	}
Please login to merge, or discard this patch.
includes/CrossCheck/Comparer/StringValueComparer.php 1 patch
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	 */
18 18
 	private $stringComparer;
19 19
 
20
-	public function __construct( StringComparer $stringComparer ) {
20
+	public function __construct(StringComparer $stringComparer) {
21 21
 		$this->stringComparer = $stringComparer;
22 22
 	}
23 23
 
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
 	 * @throws InvalidArgumentException
31 31
 	 * @return string One of the ComparisonResult::STATUS_... constants.
32 32
 	 */
33
-	public function compare( DataValue $value, DataValue $comparativeValue ) {
34
-		if ( !$this->canCompare( $value, $comparativeValue ) ) {
35
-			throw new InvalidArgumentException( 'Given values can not be compared using this comparer.' );
33
+	public function compare(DataValue $value, DataValue $comparativeValue) {
34
+		if (!$this->canCompare($value, $comparativeValue)) {
35
+			throw new InvalidArgumentException('Given values can not be compared using this comparer.');
36 36
 		}
37 37
 
38
-		return $this->stringComparer->compare( $value->getValue(), $comparativeValue->getValue() );
38
+		return $this->stringComparer->compare($value->getValue(), $comparativeValue->getValue());
39 39
 	}
40 40
 
41 41
 	/**
@@ -45,7 +45,7 @@  discard block
 block discarded – undo
45 45
 	 * @param DataValue $comparativeValue
46 46
 	 * @return bool
47 47
 	 */
48
-	public function canCompare( DataValue $value, DataValue $comparativeValue ) {
48
+	public function canCompare(DataValue $value, DataValue $comparativeValue) {
49 49
 		return $value instanceof StringValue && $comparativeValue instanceof StringValue;
50 50
 	}
51 51
 
Please login to merge, or discard this patch.
includes/CrossCheck/Comparer/MonolingualTextValueComparer.php 1 patch
Spacing   +7 added lines, -7 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	 */
18 18
 	private $stringComparer;
19 19
 
20
-	public function __construct( StringComparer $stringComparer ) {
20
+	public function __construct(StringComparer $stringComparer) {
21 21
 		$this->stringComparer = $stringComparer;
22 22
 	}
23 23
 
@@ -30,9 +30,9 @@  discard block
 block discarded – undo
30 30
 	 * @throws InvalidArgumentException
31 31
 	 * @return string|null One of the ComparisonResult::STATUS_... constants.
32 32
 	 */
33
-	public function compare( DataValue $value, DataValue $comparativeValue ) {
34
-		if ( !$this->canCompare( $value, $comparativeValue ) ) {
35
-			throw new InvalidArgumentException( 'Given values can not be compared using this comparer.' );
33
+	public function compare(DataValue $value, DataValue $comparativeValue) {
34
+		if (!$this->canCompare($value, $comparativeValue)) {
35
+			throw new InvalidArgumentException('Given values can not be compared using this comparer.');
36 36
 		}
37 37
 
38 38
 		/**
@@ -40,8 +40,8 @@  discard block
 block discarded – undo
40 40
 		 * @var MonolingualTextValue $comparativeValue
41 41
 		 */
42 42
 
43
-		if ( $value->getLanguageCode() === $comparativeValue->getLanguageCode() ) {
44
-			return $this->stringComparer->compare( $value->getText(), $comparativeValue->getText() );
43
+		if ($value->getLanguageCode() === $comparativeValue->getLanguageCode()) {
44
+			return $this->stringComparer->compare($value->getText(), $comparativeValue->getText());
45 45
 		}
46 46
 
47 47
 		return null;
@@ -54,7 +54,7 @@  discard block
 block discarded – undo
54 54
 	 * @param DataValue $comparativeValue
55 55
 	 * @return bool
56 56
 	 */
57
-	public function canCompare( DataValue $value, DataValue $comparativeValue ) {
57
+	public function canCompare(DataValue $value, DataValue $comparativeValue) {
58 58
 		return $value instanceof MonolingualTextValue && $comparativeValue instanceof MonolingualTextValue;
59 59
 	}
60 60
 
Please login to merge, or discard this patch.
includes/CrossCheck/Comparer/MultilingualTextValueComparer.php 1 patch
Spacing   +11 added lines, -11 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	private $stringComparer;
20 20
 
21
-	public function __construct( StringComparer $stringComparer ) {
21
+	public function __construct(StringComparer $stringComparer) {
22 22
 		$this->stringComparer = $stringComparer;
23 23
 	}
24 24
 
@@ -31,9 +31,9 @@  discard block
 block discarded – undo
31 31
 	 * @throws InvalidArgumentException
32 32
 	 * @return string|null One of the ComparisonResult::STATUS_... constants.
33 33
 	 */
34
-	public function compare( DataValue $value, DataValue $comparativeValue ) {
35
-		if ( !$this->canCompare( $value, $comparativeValue ) ) {
36
-			throw new InvalidArgumentException( 'Given values can not be compared using this comparer.' );
34
+	public function compare(DataValue $value, DataValue $comparativeValue) {
35
+		if (!$this->canCompare($value, $comparativeValue)) {
36
+			throw new InvalidArgumentException('Given values can not be compared using this comparer.');
37 37
 		}
38 38
 
39 39
 		/**
@@ -43,21 +43,21 @@  discard block
 block discarded – undo
43 43
 
44 44
 		$texts = $value->getTexts();
45 45
 		$comparativeTexts = $comparativeValue->getTexts();
46
-		$commonLanguages = array_intersect( array_keys( $texts ), array_keys( $comparativeTexts ) );
46
+		$commonLanguages = array_intersect(array_keys($texts), array_keys($comparativeTexts));
47 47
 
48
-		if ( $commonLanguages ) {
48
+		if ($commonLanguages) {
49 49
 			$totalResult = ComparisonResult::STATUS_MISMATCH;
50 50
 
51
-			foreach ( $commonLanguages as $language ) {
51
+			foreach ($commonLanguages as $language) {
52 52
 				$monolingualText = $texts[$language];
53 53
 				$comparativeMonolingualText = $comparativeTexts[$language];
54 54
 
55
-				$result = $this->stringComparer->compare( $monolingualText->getText(), $comparativeMonolingualText->getText() );
56
-				if ( $result !== ComparisonResult::STATUS_MISMATCH ) {
55
+				$result = $this->stringComparer->compare($monolingualText->getText(), $comparativeMonolingualText->getText());
56
+				if ($result !== ComparisonResult::STATUS_MISMATCH) {
57 57
 					$totalResult = $result;
58 58
 
59 59
 					// FIXME: This reports a partial match in a single language as a full match!
60
-					if ( $result === ComparisonResult::STATUS_MATCH ) {
60
+					if ($result === ComparisonResult::STATUS_MATCH) {
61 61
 						break;
62 62
 					}
63 63
 				}
@@ -76,7 +76,7 @@  discard block
 block discarded – undo
76 76
 	 * @param DataValue $comparativeValue
77 77
 	 * @return bool
78 78
 	 */
79
-	public function canCompare( DataValue $value, DataValue $comparativeValue ) {
79
+	public function canCompare(DataValue $value, DataValue $comparativeValue) {
80 80
 		return $value instanceof MultilingualTextValue && $comparativeValue instanceof MultilingualTextValue;
81 81
 	}
82 82
 
Please login to merge, or discard this patch.
includes/CrossCheck/Comparer/DataValueComparerFactory.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -21,7 +21,7 @@  discard block
 block discarded – undo
21 21
 	 */
22 22
 	private $stringNormalizer;
23 23
 
24
-	public function __construct( TermIndex $termIndex, StringNormalizer $stringNormalizer ) {
24
+	public function __construct(TermIndex $termIndex, StringNormalizer $stringNormalizer) {
25 25
 		$this->termIndex = $termIndex;
26 26
 		$this->stringNormalizer = $stringNormalizer;
27 27
 	}
@@ -63,7 +63,7 @@  discard block
 block discarded – undo
63 63
 	 * @return StringComparer
64 64
 	 */
65 65
 	private function newStringComparer() {
66
-		return new StringComparer( $this->stringNormalizer );
66
+		return new StringComparer($this->stringNormalizer);
67 67
 	}
68 68
 
69 69
 	/**
Please login to merge, or discard this patch.
includes/CrossCheck/ValueParser/StringValueParser.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	private $stringNormalizer;
20 20
 
21
-	public function __construct( StringNormalizer $stringNormalizer ) {
21
+	public function __construct(StringNormalizer $stringNormalizer) {
22 22
 		$this->stringNormalizer = $stringNormalizer;
23 23
 	}
24 24
 
@@ -29,10 +29,10 @@  discard block
 block discarded – undo
29 29
 	 *
30 30
 	 * @return StringValue
31 31
 	 */
32
-	public function parse( $value ) {
33
-		Assert::parameterType( 'string', $value, '$value' );
32
+	public function parse($value) {
33
+		Assert::parameterType('string', $value, '$value');
34 34
 
35
-		return new StringValue( $this->stringNormalizer->trimToNFC( $value ) );
35
+		return new StringValue($this->stringNormalizer->trimToNFC($value));
36 36
 	}
37 37
 
38 38
 }
Please login to merge, or discard this patch.
includes/CrossCheck/ValueParser/MultilingualTextValueParser.php 1 patch
Spacing   +4 added lines, -4 removed lines patch added patch discarded remove patch
@@ -17,7 +17,7 @@  discard block
 block discarded – undo
17 17
 	 */
18 18
 	private $monolingualTextValueParser;
19 19
 
20
-	public function __construct( ValueParser $monolingualTextValueParser ) {
20
+	public function __construct(ValueParser $monolingualTextValueParser) {
21 21
 		$this->monolingualTextValueParser = $monolingualTextValueParser;
22 22
 	}
23 23
 
@@ -28,11 +28,11 @@  discard block
 block discarded – undo
28 28
 	 *
29 29
 	 * @return MultilingualTextValue
30 30
 	 */
31
-	public function parse( $value ) {
32
-		Assert::parameterType( 'string', $value, '$value' );
31
+	public function parse($value) {
32
+		Assert::parameterType('string', $value, '$value');
33 33
 
34 34
 		return new MultilingualTextValue(
35
-			[ $this->monolingualTextValueParser->parse( $value ) ]
35
+			[$this->monolingualTextValueParser->parse($value)]
36 36
 		);
37 37
 	}
38 38
 
Please login to merge, or discard this patch.
includes/Serializer/SerializerFactory.php 1 patch
Spacing   +3 added lines, -3 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 	 */
21 21
 	private $referenceSerializer;
22 22
 
23
-	public function __construct( Serializer $dataValueSerializer, Serializer $referenceSerializer ) {
23
+	public function __construct(Serializer $dataValueSerializer, Serializer $referenceSerializer) {
24 24
 		$this->dataValueSerializer = $dataValueSerializer;
25 25
 		$this->referenceSerializer = $referenceSerializer;
26 26
 	}
@@ -42,7 +42,7 @@  discard block
 block discarded – undo
42 42
 	 * @return Serializer
43 43
 	 */
44 44
 	public function newComparisonResultSerializer() {
45
-		return new ComparisonResultSerializer( $this->dataValueSerializer );
45
+		return new ComparisonResultSerializer($this->dataValueSerializer);
46 46
 	}
47 47
 
48 48
 	/**
@@ -73,7 +73,7 @@  discard block
 block discarded – undo
73 73
 	 * @return Serializer
74 74
 	 */
75 75
 	public function newReferenceResultSerializer() {
76
-		return new ReferenceResultSerializer( $this->referenceSerializer );
76
+		return new ReferenceResultSerializer($this->referenceSerializer);
77 77
 	}
78 78
 
79 79
 }
Please login to merge, or discard this patch.
includes/Serializer/ComparisonResultSerializer.php 1 patch
Spacing   +10 added lines, -10 removed lines patch added patch discarded remove patch
@@ -18,7 +18,7 @@  discard block
 block discarded – undo
18 18
 	 */
19 19
 	private $dataValueSerializer;
20 20
 
21
-	public function __construct( Serializer $dataValueSerializer ) {
21
+	public function __construct(Serializer $dataValueSerializer) {
22 22
 		$this->dataValueSerializer = $dataValueSerializer;
23 23
 	}
24 24
 
@@ -29,7 +29,7 @@  discard block
 block discarded – undo
29 29
 	 *
30 30
 	 * @return bool
31 31
 	 */
32
-	public function isSerializerFor( $object ) {
32
+	public function isSerializerFor($object) {
33 33
 		return $object instanceof ComparisonResult;
34 34
 	}
35 35
 
@@ -41,29 +41,29 @@  discard block
 block discarded – undo
41 41
 	 * @return array
42 42
 	 * @throws UnsupportedObjectException
43 43
 	 */
44
-	public function serialize( $object ) {
45
-		if ( !$this->isSerializerFor( $object ) ) {
44
+	public function serialize($object) {
45
+		if (!$this->isSerializerFor($object)) {
46 46
 			throw new UnsupportedObjectException(
47 47
 				$object,
48 48
 				'ComparisonResultSerializer can only serialize ComparisonResult objects.'
49 49
 			);
50 50
 		}
51 51
 
52
-		return $this->getSerialized( $object );
52
+		return $this->getSerialized($object);
53 53
 	}
54 54
 
55
-	private function getSerialized( ComparisonResult $comparisonResult ) {
55
+	private function getSerialized(ComparisonResult $comparisonResult) {
56 56
 		$dataValueSerializer = $this->dataValueSerializer;
57 57
 		$externalValues = array_map(
58
-			function ( $dataValue ) use ( $dataValueSerializer ) {
59
-				return $dataValueSerializer->serialize( $dataValue );
58
+			function($dataValue) use ($dataValueSerializer) {
59
+				return $dataValueSerializer->serialize($dataValue);
60 60
 			},
61 61
 			$comparisonResult->getExternalValues()
62 62
 		);
63
-		$this->setIndexedTagName( $externalValues, 'dataValue' );
63
+		$this->setIndexedTagName($externalValues, 'dataValue');
64 64
 
65 65
 		return [
66
-			'localValue' => $this->dataValueSerializer->serialize( $comparisonResult->getLocalValue() ),
66
+			'localValue' => $this->dataValueSerializer->serialize($comparisonResult->getLocalValue()),
67 67
 			'externalValues' => $externalValues,
68 68
 			'result' => $comparisonResult->getStatus()
69 69
 		];
Please login to merge, or discard this patch.