Skip to content

Commit 2d7c50a

Browse files
committed
Remove traces of call invokers
1 parent 1975bc8 commit 2d7c50a

23 files changed

+261
-1332
lines changed

src/AdapterInterface.php

Lines changed: 0 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -32,13 +32,6 @@ public function getLoop();
3232
*/
3333
public function getFilesystem();
3434

35-
/**
36-
* Get the call invoker for this adapter.
37-
*
38-
* @return CallInvokerInterface
39-
*/
40-
public function getInvoker();
41-
4235
/**
4336
* Set the relevant filesystem for this adapter.
4437
*
@@ -48,14 +41,6 @@ public function getInvoker();
4841
*/
4942
public function setFilesystem(FilesystemInterface $filesystem);
5043

51-
/**
52-
* Set the call invoker for this adapter.
53-
*
54-
* @param CallInvokerInterface $invoker
55-
* @return void
56-
*/
57-
public function setInvoker(CallInvokerInterface $invoker);
58-
5944
/**
6045
* Call the underlying filesystem.
6146
*

src/CallInvokerInterface.php

Lines changed: 0 additions & 32 deletions
This file was deleted.

src/ChildProcess/Adapter.php

Lines changed: 14 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
use React\Filesystem\ObjectStream;
1010
use React\Filesystem\ObjectStreamSink;
1111
use React\Filesystem\AdapterInterface;
12-
use React\Filesystem\CallInvokerInterface;
1312
use React\Filesystem\FilesystemInterface;
1413
use React\Filesystem\MappedTypeDetector;
1514
use React\Filesystem\ModeTypeDetector;
@@ -65,11 +64,6 @@ class Adapter implements AdapterInterface
6564
*/
6665
protected $permissionFlagResolver;
6766

68-
/**
69-
* @var CallInvokerInterface
70-
*/
71-
protected $invoker;
72-
7367
/**
7468
* @var array
7569
*/
@@ -86,7 +80,6 @@ public function __construct(LoopInterface $loop, array $options = [])
8680
{
8781
$this->loop = $loop;
8882

89-
$this->invoker = \React\Filesystem\getInvoker($this, $options, 'invoker', 'React\Filesystem\InstantInvoker');
9083
$this->openFileLimiter = new OpenFileLimiter(\React\Filesystem\getOpenFileLimit($options));
9184
$this->permissionFlagResolver = new PermissionFlagResolver();
9285

@@ -154,23 +147,6 @@ public function setFilesystem(FilesystemInterface $filesystem)
154147
];
155148
}
156149

157-
/**
158-
* {@inheritDoc}
159-
*/
160-
public function getInvoker()
161-
{
162-
return $this->invoker;
163-
}
164-
165-
/**
166-
* @param CallInvokerInterface $invoker
167-
* @return void
168-
*/
169-
public function setInvoker(CallInvokerInterface $invoker)
170-
{
171-
$this->invoker = $invoker;
172-
}
173-
174150
/**
175151
* @param string $function
176152
* @param array $args
@@ -197,7 +173,7 @@ public function callFilesystem($function, $args, $errorResultCode = -1)
197173
*/
198174
public function chmod($path, $mode)
199175
{
200-
return $this->invoker->invokeCall('chmod', [
176+
return $this->callFilesystem('chmod', [
201177
'path' => $path,
202178
'mode' => decoct($mode),
203179
]);
@@ -210,7 +186,7 @@ public function chmod($path, $mode)
210186
*/
211187
public function mkdir($path, $mode = self::CREATION_MODE)
212188
{
213-
return $this->invoker->invokeCall('mkdir', [
189+
return $this->callFilesystem('mkdir', [
214190
'path' => $path,
215191
'mode' => decoct($this->permissionFlagResolver->resolve($mode)),
216192
]);
@@ -299,7 +275,7 @@ public function close($fd)
299275
*/
300276
public function getContents($path, $offset = 0, $length = null)
301277
{
302-
return $this->invoker->invokeCall('getContents', [
278+
return $this->callFilesystem('getContents', [
303279
'path' => $path,
304280
'offset' => $offset,
305281
'maxlen' => $length,
@@ -323,7 +299,7 @@ public function getContents($path, $offset = 0, $length = null)
323299
*/
324300
public function putContents($path, $content)
325301
{
326-
return $this->invoker->invokeCall('putContents', [
302+
return $this->callFilesystem('putContents', [
327303
'path' => $path,
328304
'chunk' => base64_encode($content),
329305
'flags' => 0,
@@ -346,7 +322,7 @@ public function putContents($path, $content)
346322
*/
347323
public function appendContents($path, $content)
348324
{
349-
return $this->invoker->invokeCall('putContents', [
325+
return $this->callFilesystem('putContents', [
350326
'path' => $path,
351327
'chunk' => base64_encode($content),
352328
'flags' => FILE_APPEND,
@@ -361,7 +337,7 @@ public function appendContents($path, $content)
361337
*/
362338
public function rmdir($path)
363339
{
364-
return $this->invoker->invokeCall('rmdir', [
340+
return $this->callFilesystem('rmdir', [
365341
'path' => $path,
366342
]);
367343
}
@@ -372,7 +348,7 @@ public function rmdir($path)
372348
*/
373349
public function unlink($path)
374350
{
375-
return $this->invoker->invokeCall('unlink', [
351+
return $this->callFilesystem('unlink', [
376352
'path' => $path,
377353
]);
378354
}
@@ -385,7 +361,7 @@ public function unlink($path)
385361
*/
386362
public function chown($path, $uid, $gid)
387363
{
388-
return $this->invoker->invokeCall('chown', [
364+
return $this->callFilesystem('chown', [
389365
'path' => $path,
390366
'uid' => $uid,
391367
'gid' => $gid,
@@ -398,7 +374,7 @@ public function chown($path, $uid, $gid)
398374
*/
399375
public function stat($filename)
400376
{
401-
return $this->invoker->invokeCall('stat', [
377+
return $this->callFilesystem('stat', [
402378
'path' => $filename,
403379
])->then(function ($stat) {
404380
$stat['atime'] = new DateTime('@' . $stat['atime']);
@@ -425,7 +401,7 @@ public function lsStream($path)
425401
{
426402
$stream = new ObjectStream();
427403

428-
$this->invoker->invokeCall('readdir', [
404+
$this->callFilesystem('readdir', [
429405
'path' => $path,
430406
'flags' => $this->options['lsFlags'],
431407
])->then(function ($result) use ($path, $stream) {
@@ -462,7 +438,7 @@ protected function processLsContents($basePath, $result, ObjectStream $stream)
462438
*/
463439
public function touch($path, $mode = self::CREATION_MODE)
464440
{
465-
return $this->invoker->invokeCall('touch', [
441+
return $this->callFilesystem('touch', [
466442
'path' => $path,
467443
'mode' => decoct($this->permissionFlagResolver->resolve($mode)),
468444
]);
@@ -475,7 +451,7 @@ public function touch($path, $mode = self::CREATION_MODE)
475451
*/
476452
public function rename($fromPath, $toPath)
477453
{
478-
return $this->invoker->invokeCall('rename', [
454+
return $this->callFilesystem('rename', [
479455
'from' => $fromPath,
480456
'to' => $toPath,
481457
]);
@@ -487,7 +463,7 @@ public function rename($fromPath, $toPath)
487463
*/
488464
public function readlink($path)
489465
{
490-
return $this->invoker->invokeCall('readlink', [
466+
return $this->callFilesystem('readlink', [
491467
'path' => $path,
492468
])->then(function ($result) {
493469
return \React\Promise\resolve($result['path']);
@@ -501,7 +477,7 @@ public function readlink($path)
501477
*/
502478
public function symlink($fromPath, $toPath)
503479
{
504-
return $this->invoker->invokeCall('symlink', [
480+
return $this->callFilesystem('symlink', [
505481
'from' => $fromPath,
506482
'to' => $toPath,
507483
])->then(function ($result) {

0 commit comments

Comments
 (0)