Esempio n. 1
0
 public function testCopiesToStringStopsWhenReadFails()
 {
     $s1 = Stream::factory('foobaz');
     $s1 = FnStream::decorate($s1, ['read' => function () {
         return false;
     }]);
     $result = Utils::copyToString($s1);
     $this->assertEquals('', $result);
 }
Esempio n. 2
0
 public function getContents()
 {
     return Utils::copyToString($this);
 }
Esempio n. 3
0
 public function __toString()
 {
     return Utils::copyToString($this);
 }
Esempio n. 4
0
 public function getContents($maxLength = -1)
 {
     return Utils::copyToString($this, $maxLength);
 }