mirror of
https://codeberg.org/icewind/streams.git
synced 2026-06-03 16:44:07 +02:00
cleanup context handling for wrappers
This commit is contained in:
parent
3171a535de
commit
2c8ae56d02
16 changed files with 182 additions and 258 deletions
|
|
@ -9,21 +9,13 @@ namespace Icewind\Streams\Tests;
|
|||
|
||||
class DirectoryWrapperNull extends \Icewind\Streams\DirectoryWrapper {
|
||||
public static function wrap($source) {
|
||||
$options = array(
|
||||
'dir' => array(
|
||||
'source' => $source)
|
||||
);
|
||||
return self::wrapWithOptions($options);
|
||||
return self::wrapSource($source);
|
||||
}
|
||||
}
|
||||
|
||||
class DirectoryWrapperDummy extends \Icewind\Streams\DirectoryWrapper {
|
||||
public static function wrap($source) {
|
||||
$options = array(
|
||||
'dir' => array(
|
||||
'source' => $source)
|
||||
);
|
||||
return self::wrapWithOptions($options);
|
||||
return self::wrapSource($source);
|
||||
}
|
||||
|
||||
public function dir_readdir() {
|
||||
|
|
|
|||
|
|
@ -8,20 +8,8 @@
|
|||
namespace Icewind\Streams\Tests;
|
||||
|
||||
class PartialWrapper extends \Icewind\Streams\NullWrapper {
|
||||
/**
|
||||
* Wraps a stream with the provided callbacks
|
||||
*
|
||||
* @param resource $source
|
||||
* @return resource
|
||||
*
|
||||
* @throws \BadMethodCallException
|
||||
*/
|
||||
public static function wrap($source) {
|
||||
$context = stream_context_create(array(
|
||||
'null' => array(
|
||||
'source' => $source)
|
||||
));
|
||||
return self::wrapSource($source, $context);
|
||||
return self::wrapSource($source);
|
||||
}
|
||||
|
||||
public function stream_read($count) {
|
||||
|
|
@ -36,20 +24,8 @@ class PartialWrapper extends \Icewind\Streams\NullWrapper {
|
|||
}
|
||||
|
||||
class FailWrapper extends \Icewind\Streams\NullWrapper {
|
||||
/**
|
||||
* Wraps a stream with the provided callbacks
|
||||
*
|
||||
* @param resource $source
|
||||
* @return resource
|
||||
*
|
||||
* @throws \BadMethodCallException
|
||||
*/
|
||||
public static function wrap($source) {
|
||||
$context = stream_context_create(array(
|
||||
'null' => array(
|
||||
'source' => $source)
|
||||
));
|
||||
return self::wrapSource($source, $context);
|
||||
return self::wrapSource($source);
|
||||
}
|
||||
|
||||
public function stream_read($count) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue