class TraversableString

An object that can be used as either a string or array.

@author Kris Wallsmith <kris.wallsmith@gmail.com>

Hierarchy

  • class \Assetic\Util\TraversableString implements \Assetic\Util\IteratorAggregate, \Assetic\Util\Countable

Expanded class hierarchy of TraversableString

1 file declares its use of TraversableString
functions.php in drupal/core/vendor/kriswallsmith/assetic/src/functions.php

File

drupal/core/vendor/kriswallsmith/assetic/src/Assetic/Util/TraversableString.php, line 19

Namespace

Assetic\Util
View source
class TraversableString implements \IteratorAggregate, \Countable {
  private $one;
  private $many;
  public function __construct($one, array $many) {
    $this->one = $one;
    $this->many = $many;
  }
  public function getIterator() {
    return new \ArrayIterator($this->many);
  }
  public function count() {
    return count($this->many);
  }
  public function __toString() {
    return (string) $this->one;
  }

}

Members