TraversableObject.php

Same filename and directory in other branches
  1. 10 core/modules/jsonapi/tests/modules/jsonapi_test_data_type/src/TraversableObject.php
  2. 9 core/modules/jsonapi/tests/modules/jsonapi_test_data_type/src/TraversableObject.php
  3. 8.9.x core/modules/jsonapi/tests/modules/jsonapi_test_data_type/src/TraversableObject.php

Namespace

Drupal\jsonapi_test_data_type

File

core/modules/jsonapi/tests/modules/jsonapi_test_data_type/src/TraversableObject.php

View source
<?php

declare (strict_types=1);
namespace Drupal\jsonapi_test_data_type;


/**
 * An object which implements \IteratorAggregate.
 *
 * @implements \IteratorAggregate<int|string, mixed>
 */
class TraversableObject implements \IteratorAggregate {
  
  /**
   * The test data.
   *
   * @var string
   */
  public $property = "value";
  
  /**
   * Retrieves the iterator for the object.
   *
   * @return \ArrayIterator<int|string, mixed>
   *   The iterator.
   */
  public function getIterator() : \ArrayIterator {
    return new \ArrayIterator();
  }

}

Classes

Title Deprecated Summary
TraversableObject An object which implements \IteratorAggregate.

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.