isValidSource() public static method

Valid sources are either an array or a Traversable.
public static isValidSource ( mixed $source ) : boolean
$source mixed
return boolean True if it is.
Example #1
0
 /**
  * Test whether the source checker actually works.
  */
 public function testIsValidSource()
 {
     $this->assertTrue(Stream::isValidSource([]), 'Arrays should be valid sources.');
     $this->assertTrue(Stream::isValidSource(new DirectoryIterator(__DIR__)), 'Iterators should be valid sources.');
     $this->assertFalse(Stream::isValidSource("Not a stream"), "Strings should be invalid sources.");
 }