Completed
Push — master ( 4959df...1e847f )
by
unknown
01:53
created
src/Api/CheckResultsRenderer.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -51,11 +51,11 @@  discard block
 block discarded – undo
51 51
 	 * @param CachedCheckResults $checkResults
52 52
 	 * @return CachedCheckConstraintsResponse
53 53
 	 */
54
-	public function render( CachedCheckResults $checkResults ) {
54
+	public function render(CachedCheckResults $checkResults) {
55 55
 		$response = [];
56
-		foreach ( $checkResults->getArray() as $checkResult ) {
57
-			$resultArray = $this->checkResultToArray( $checkResult );
58
-			$checkResult->getContextCursor()->storeCheckResultInArray( $resultArray, $response );
56
+		foreach ($checkResults->getArray() as $checkResult) {
57
+			$resultArray = $this->checkResultToArray($checkResult);
58
+			$checkResult->getContextCursor()->storeCheckResultInArray($resultArray, $response);
59 59
 		}
60 60
 		return new CachedCheckConstraintsResponse(
61 61
 			$response,
@@ -63,19 +63,19 @@  discard block
 block discarded – undo
63 63
 		);
64 64
 	}
65 65
 
66
-	public function checkResultToArray( CheckResult $checkResult ) {
67
-		if ( $checkResult instanceof NullResult ) {
66
+	public function checkResultToArray(CheckResult $checkResult) {
67
+		if ($checkResult instanceof NullResult) {
68 68
 			return null;
69 69
 		}
70 70
 
71 71
 		$constraintId = $checkResult->getConstraint()->getConstraintId();
72 72
 		$typeItemId = $checkResult->getConstraint()->getConstraintTypeItemId();
73
-		$constraintPropertyId = new PropertyId( $checkResult->getContextCursor()->getSnakPropertyId() );
73
+		$constraintPropertyId = new PropertyId($checkResult->getContextCursor()->getSnakPropertyId());
74 74
 
75
-		$title = $this->entityTitleLookup->getTitleForId( $constraintPropertyId );
75
+		$title = $this->entityTitleLookup->getTitleForId($constraintPropertyId);
76 76
 		$talkTitle = $title->getTalkPageIfDefined();
77
-		$typeLabel = $this->entityIdLabelFormatter->formatEntityId( new ItemId( $typeItemId ) );
78
-		$link = $title->getFullURL() . '#' . $constraintId;
77
+		$typeLabel = $this->entityIdLabelFormatter->formatEntityId(new ItemId($typeItemId));
78
+		$link = $title->getFullURL().'#'.$constraintId;
79 79
 
80 80
 		$constraint = [
81 81
 			'id' => $constraintId,
@@ -91,14 +91,14 @@  discard block
 block discarded – undo
91 91
 			'constraint' => $constraint
92 92
 		];
93 93
 		$message = $checkResult->getMessage();
94
-		if ( $message ) {
95
-			$result['message-html'] = $this->violationMessageRenderer->render( $message );
94
+		if ($message) {
95
+			$result['message-html'] = $this->violationMessageRenderer->render($message);
96 96
 		}
97
-		if ( $checkResult->getContextCursor()->getType() === Context::TYPE_STATEMENT ) {
97
+		if ($checkResult->getContextCursor()->getType() === Context::TYPE_STATEMENT) {
98 98
 			$result['claim'] = $checkResult->getContextCursor()->getStatementGuid();
99 99
 		}
100 100
 		$cachingMetadataArray = $checkResult->getMetadata()->getCachingMetadata()->toArray();
101
-		if ( $cachingMetadataArray !== null ) {
101
+		if ($cachingMetadataArray !== null) {
102 102
 			$result['cached'] = $cachingMetadataArray;
103 103
 		}
104 104
 
Please login to merge, or discard this patch.