Completed
Push — master ( 866e51...05d0de )
by
unknown
02:58 queued 10s
created
src/Api/CheckResultsRenderer.php 1 patch
Spacing   +14 added lines, -14 removed lines patch added patch discarded remove patch
@@ -59,11 +59,11 @@  discard block
 block discarded – undo
59 59
 	 * @param CachedCheckResults $checkResults
60 60
 	 * @return CachedCheckConstraintsResponse
61 61
 	 */
62
-	public function render( CachedCheckResults $checkResults ) {
62
+	public function render(CachedCheckResults $checkResults) {
63 63
 		$response = [];
64
-		foreach ( $checkResults->getArray() as $checkResult ) {
65
-			$resultArray = $this->checkResultToArray( $checkResult );
66
-			$checkResult->getContextCursor()->storeCheckResultInArray( $resultArray, $response );
64
+		foreach ($checkResults->getArray() as $checkResult) {
65
+			$resultArray = $this->checkResultToArray($checkResult);
66
+			$checkResult->getContextCursor()->storeCheckResultInArray($resultArray, $response);
67 67
 		}
68 68
 		return new CachedCheckConstraintsResponse(
69 69
 			$response,
@@ -71,19 +71,19 @@  discard block
 block discarded – undo
71 71
 		);
72 72
 	}
73 73
 
74
-	public function checkResultToArray( CheckResult $checkResult ) {
75
-		if ( $checkResult instanceof NullResult ) {
74
+	public function checkResultToArray(CheckResult $checkResult) {
75
+		if ($checkResult instanceof NullResult) {
76 76
 			return null;
77 77
 		}
78 78
 
79 79
 		$constraintId = $checkResult->getConstraint()->getConstraintId();
80 80
 		$typeItemId = $checkResult->getConstraint()->getConstraintTypeItemId();
81
-		$constraintPropertyId = new PropertyId( $checkResult->getContextCursor()->getSnakPropertyId() );
81
+		$constraintPropertyId = new PropertyId($checkResult->getContextCursor()->getSnakPropertyId());
82 82
 
83
-		$title = $this->entityTitleLookup->getTitleForId( $constraintPropertyId );
84
-		$typeLabel = $this->entityIdLabelFormatter->formatEntityId( new ItemId( $typeItemId ) );
83
+		$title = $this->entityTitleLookup->getTitleForId($constraintPropertyId);
84
+		$typeLabel = $this->entityIdLabelFormatter->formatEntityId(new ItemId($typeItemId));
85 85
 		// TODO link to the statement when possible (T169224)
86
-		$link = $title->getFullURL() . '#' . $this->config->get( 'WBQualityConstraintsPropertyConstraintId' );
86
+		$link = $title->getFullURL().'#'.$this->config->get('WBQualityConstraintsPropertyConstraintId');
87 87
 
88 88
 		$constraint = [
89 89
 			'id' => $constraintId,
@@ -99,14 +99,14 @@  discard block
 block discarded – undo
99 99
 			'constraint' => $constraint
100 100
 		];
101 101
 		$message = $checkResult->getMessage();
102
-		if ( $message ) {
103
-			$result['message-html'] = $this->violationMessageRenderer->render( $message );
102
+		if ($message) {
103
+			$result['message-html'] = $this->violationMessageRenderer->render($message);
104 104
 		}
105
-		if ( $checkResult->getContextCursor()->getType() === Context::TYPE_STATEMENT ) {
105
+		if ($checkResult->getContextCursor()->getType() === Context::TYPE_STATEMENT) {
106 106
 			$result['claim'] = $checkResult->getContextCursor()->getStatementGuid();
107 107
 		}
108 108
 		$cachingMetadataArray = $checkResult->getMetadata()->getCachingMetadata()->toArray();
109
-		if ( $cachingMetadataArray !== null ) {
109
+		if ($cachingMetadataArray !== null) {
110 110
 			$result['cached'] = $cachingMetadataArray;
111 111
 		}
112 112
 
Please login to merge, or discard this patch.