Now that #2034947: [Change notice] Change view results to use a classed object is in, we can type hint our methods can get passed this ResultRow object.

Let's start with this.

Comments

Status: Needs review » Needs work

The last submitted patch, vdc-field-render-typehint.patch, failed testing.

damiankloip’s picture

Status: Needs work » Needs review
StatusFileSize
new1.23 KB
new43.18 KB

So we could do this?

dawehner’s picture

@@ -20,9 +21,9 @@
-   * Work out the depth of this comment
+   * {@inheritdoc}

This was actually a helpful comment.

@@ -63,12 +64,12 @@ public function preRender(&$values) {
-   * Render the contextual fields.

Mh another helpful one which got dropped.

@@ -1087,18 +1087,18 @@ public function adminSummary() {
+   * @param array $values
+   *   An array of all \Drupal\views\ResultRow objects returned from the query.

Let's use \Drupal\views\ReusltRow[] instead.

@@ -93,8 +94,13 @@ protected function setUp() {
+      $row = new ResultRow();
+      foreach ($set as $key => $value) {
+        $row->{$key} = $value;
+      }

I a follow up we could provide that code on the constructor for the ResultRow object.

damiankloip’s picture

StatusFileSize
new3.43 KB
new43.82 KB

Thanks for the review.

I have added those comments back in, it does make sense to keep those. Also, I think we might as well move that logic to the ResultRow constructor now, as the code change is not much different because we can remove it from the CounterTest.

dawehner’s picture

Status: Needs review » Reviewed & tested by the community

Thanks for doing that changes!

alexpott’s picture

Status: Reviewed & tested by the community » Fixed

Committed fd76691 and pushed to 8.x. Thanks!

Automatically closed -- issue fixed for 2 weeks with no activity.