Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/ChildProcess/Adapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,9 @@
use React\Filesystem\FilesystemInterface;
use React\Filesystem\MappedTypeDetector;
use React\Filesystem\ModeTypeDetector;
use React\Filesystem\Node\NodeInterface;
use React\Filesystem\ObjectStream;
use React\Filesystem\OpenFileLimiter;
use React\Filesystem\PermissionFlagResolver;
use React\Filesystem\Stream\StreamFactory;
use React\Filesystem\TypeDetectorInterface;
use React\Promise\FulfilledPromise;
use React\Promise\PromiseInterface;
use WyriHaximus\React\ChildProcess\Messenger\Messages\Factory;
use WyriHaximus\React\ChildProcess\Messenger\Messages\Payload;
Expand Down
1 change: 0 additions & 1 deletion src/InstantInvoker.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace React\Filesystem;

use React\EventLoop\LoopInterface;
use React\Promise\Deferred;

class InstantInvoker implements CallInvokerInterface
{
Expand Down
1 change: 0 additions & 1 deletion src/Node/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
use React\Filesystem\ObjectStream;
use React\Filesystem\ObjectStreamSink;
use React\Filesystem\Stream\GenericStreamInterface;
use React\Promise\Deferred;
use React\Promise\FulfilledPromise;
use React\Promise\RejectedPromise;
use React\Promise\Stream;
Expand Down
1 change: 0 additions & 1 deletion src/Node/FileInterface.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@

use React\Filesystem\AdapterInterface;
use React\Promise\PromiseInterface;
use React\Stream\WritableStreamInterface;

interface FileInterface extends NodeInterface
{
Expand Down
5 changes: 1 addition & 4 deletions src/Stream/DuplexStream.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
use Evenement\EventEmitter;
use React\Filesystem\AdapterInterface;
use React\Stream\DuplexStreamInterface;
use React\Filesystem\ThrottledQueuedInvoker;
use React\Promise\FulfilledPromise;

class DuplexStream extends EventEmitter implements DuplexStreamInterface, GenericStreamInterface
Expand All @@ -24,8 +23,6 @@ public function __construct($path, $fileDescriptor, AdapterInterface $filesystem
$this->path = $path;
$this->setFilesystem($filesystem);
$this->fileDescriptor = $fileDescriptor;

$this->callInvoker = new ThrottledQueuedInvoker($filesystem);
}

protected function readChunk()
Expand All @@ -45,7 +42,7 @@ protected function resolveSize()
return new FulfilledPromise();
}

return $this->callInvoker->invokeCall('eio_stat', [$this->path])->then(function ($stat) {
return $this->getFilesystem()->stat($this->path)->then(function ($stat) {
$this->size = $stat['size'];
return new FulfilledPromise();
});
Expand Down
4 changes: 0 additions & 4 deletions src/Stream/GenericStreamTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
namespace React\Filesystem\Stream;

use React\Filesystem\AdapterInterface;
use React\Filesystem\InstantInvoker;

trait GenericStreamTrait
{
protected $path;
protected $filesystem;
protected $fileDescriptor;
protected $closed = false;
protected $callInvoker;

/**
* @param string $path
Expand All @@ -23,8 +21,6 @@ public function __construct($path, $fileDescriptor, AdapterInterface $filesystem
$this->path = $path;
$this->filesystem = $filesystem;
$this->fileDescriptor = $fileDescriptor;

$this->callInvoker = new InstantInvoker($filesystem);
}

/**
Expand Down
8 changes: 4 additions & 4 deletions tests/Stream/ReadableStreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -230,7 +230,7 @@ public function testReadChunk($className, $stat)
$filesystem = $this->mockAdapter();

$filesystem
->expects($this->at((int)!$stat + 0))
->expects($this->at(0))
->method('stat')
->with($path)
->will($this->returnValue(\React\Promise\resolve([
Expand All @@ -239,21 +239,21 @@ public function testReadChunk($className, $stat)
;

$filesystem
->expects($this->at((int)!$stat + 1))
->expects($this->at(1))
->method('read')
->with($fileDescriptor, 8192, 0)
->will($this->returnValue($readPromise))
;

$filesystem
->expects($this->at((int)!$stat + 2))
->expects($this->at(2))
->method('read')
->with($fileDescriptor, 8192, 8192)
->will($this->returnValue($readPromise))
;

$filesystem
->expects($this->at((int)!$stat + 3))
->expects($this->at(3))
->method('close')
->with($fileDescriptor)
->will($this->returnValue(new FulfilledPromise()))
Expand Down
2 changes: 1 addition & 1 deletion tests/Stream/WritableStreamTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function classNamesProvider()
],
[
'React\Filesystem\Stream\DuplexStream',
1
0
],
];
}
Expand Down