Exemplo n.º 1
0
 /**
  * constructor
  *
  * @param  \Traversable|array  $elements
  * @param  string              $sourceType  optional
  */
 private function __construct($elements, string $sourceType = null)
 {
     $this->elements = $elements;
     if ($elements instanceof SelfDescribing) {
         $this->type = $sourceType . ' ' . $elements->description();
     } elseif (is_array($elements)) {
         $this->type = 'of array';
     } else {
         $this->type = 'from ' . get_class($elements);
     }
 }