Skip to content

Commit 0f6c071

Browse files
committed
Remove traces of call invokers
1 parent 4e2af61 commit 0f6c071

21 files changed

+195
-1040
lines changed

src/AdapterInterface.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,14 +33,6 @@ public function getLoop();
3333
*/
3434
public function setFilesystem(FilesystemInterface $filesystem);
3535

36-
/**
37-
* Set the call invoker for this adapter.
38-
*
39-
* @param CallInvokerInterface $invoker
40-
* @return void
41-
*/
42-
public function setInvoker(CallInvokerInterface $invoker);
43-
4436
/**
4537
* Call the underlying filesystem.
4638
*

src/CallInvokerInterface.php

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

src/ChildProcess/Adapter.php

Lines changed: 11 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
use React\Filesystem\ObjectStream;
99
use React\Filesystem\ObjectStreamSink;
1010
use React\Filesystem\AdapterInterface;
11-
use React\Filesystem\CallInvokerInterface;
1211
use React\Filesystem\FilesystemInterface;
1312
use React\Filesystem\MappedTypeDetector;
1413
use React\Filesystem\ModeTypeDetector;
@@ -64,11 +63,6 @@ class Adapter implements AdapterInterface
6463
*/
6564
protected $permissionFlagResolver;
6665

67-
/**
68-
* @var CallInvokerInterface
69-
*/
70-
protected $invoker;
71-
7266
/**
7367
* @var array
7468
*/
@@ -85,7 +79,6 @@ public function __construct(LoopInterface $loop, array $options = [])
8579
{
8680
$this->loop = $loop;
8781

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

@@ -145,15 +138,6 @@ public function setFilesystem(FilesystemInterface $filesystem)
145138
];
146139
}
147140

148-
/**
149-
* @param CallInvokerInterface $invoker
150-
* @return void
151-
*/
152-
public function setInvoker(CallInvokerInterface $invoker)
153-
{
154-
$this->invoker = $invoker;
155-
}
156-
157141
/**
158142
* @param string $function
159143
* @param array $args
@@ -176,7 +160,7 @@ public function callFilesystem($function, $args, $errorResultCode = -1)
176160
*/
177161
public function chmod($path, $mode)
178162
{
179-
return $this->invoker->invokeCall('chmod', [
163+
return $this->callFilesystem('chmod', [
180164
'path' => $path,
181165
'mode' => decoct($mode),
182166
]);
@@ -189,7 +173,7 @@ public function chmod($path, $mode)
189173
*/
190174
public function mkdir($path, $mode = self::CREATION_MODE)
191175
{
192-
return $this->invoker->invokeCall('mkdir', [
176+
return $this->callFilesystem('mkdir', [
193177
'path' => $path,
194178
'mode' => decoct($this->permissionFlagResolver->resolve($mode)),
195179
]);
@@ -271,7 +255,7 @@ public function close($fd)
271255
*/
272256
public function rmdir($path)
273257
{
274-
return $this->invoker->invokeCall('rmdir', [
258+
return $this->callFilesystem('rmdir', [
275259
'path' => $path,
276260
]);
277261
}
@@ -282,7 +266,7 @@ public function rmdir($path)
282266
*/
283267
public function unlink($path)
284268
{
285-
return $this->invoker->invokeCall('unlink', [
269+
return $this->callFilesystem('unlink', [
286270
'path' => $path,
287271
]);
288272
}
@@ -295,7 +279,7 @@ public function unlink($path)
295279
*/
296280
public function chown($path, $uid, $gid)
297281
{
298-
return $this->invoker->invokeCall('chown', [
282+
return $this->callFilesystem('chown', [
299283
'path' => $path,
300284
'uid' => $uid,
301285
'gid' => $gid,
@@ -308,7 +292,7 @@ public function chown($path, $uid, $gid)
308292
*/
309293
public function stat($filename)
310294
{
311-
return $this->invoker->invokeCall('stat', [
295+
return $this->callFilesystem('stat', [
312296
'path' => $filename,
313297
])->then(function ($stat) {
314298
$stat['atime'] = new DateTime('@' . $stat['atime']);
@@ -335,7 +319,7 @@ public function lsStream($path)
335319
{
336320
$stream = new ObjectStream();
337321

338-
$this->invoker->invokeCall('readdir', [
322+
$this->callFilesystem('readdir', [
339323
'path' => $path,
340324
'flags' => $this->options['lsFlags'],
341325
])->then(function ($result) use ($path, $stream) {
@@ -372,7 +356,7 @@ protected function processLsContents($basePath, $result, ObjectStream $stream)
372356
*/
373357
public function touch($path, $mode = self::CREATION_MODE)
374358
{
375-
return $this->invoker->invokeCall('touch', [
359+
return $this->callFilesystem('touch', [
376360
'path' => $path,
377361
'mode' => decoct($this->permissionFlagResolver->resolve($mode)),
378362
]);
@@ -385,7 +369,7 @@ public function touch($path, $mode = self::CREATION_MODE)
385369
*/
386370
public function rename($fromPath, $toPath)
387371
{
388-
return $this->invoker->invokeCall('rename', [
372+
return $this->callFilesystem('rename', [
389373
'from' => $fromPath,
390374
'to' => $toPath,
391375
]);
@@ -397,7 +381,7 @@ public function rename($fromPath, $toPath)
397381
*/
398382
public function readlink($path)
399383
{
400-
return $this->invoker->invokeCall('readlink', [
384+
return $this->callFilesystem('readlink', [
401385
'path' => $path,
402386
])->then(function ($result) {
403387
return \React\Promise\resolve($result['path']);
@@ -411,7 +395,7 @@ public function readlink($path)
411395
*/
412396
public function symlink($fromPath, $toPath)
413397
{
414-
return $this->invoker->invokeCall('symlink', [
398+
return $this->callFilesystem('symlink', [
415399
'from' => $fromPath,
416400
'to' => $toPath,
417401
])->then(function ($result) {

src/Eio/Adapter.php

Lines changed: 16 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
use DateTime;
66
use React\EventLoop\LoopInterface;
77
use React\Filesystem\AdapterInterface;
8-
use React\Filesystem\CallInvokerInterface;
98
use React\Filesystem\FilesystemInterface;
109
use React\Filesystem\ModeTypeDetector;
1110
use React\Filesystem\Node\NodeInterface;
@@ -44,16 +43,6 @@ class Adapter implements AdapterInterface
4443
*/
4544
protected $permissionFlagResolver;
4645

47-
/**
48-
* @var CallInvokerInterface
49-
*/
50-
protected $invoker;
51-
52-
/**
53-
* @var CallInvokerInterface
54-
*/
55-
protected $readDirInvoker;
56-
5746
/**
5847
* @var FilesystemInterface
5948
*/
@@ -96,8 +85,6 @@ public function __construct(LoopInterface $loop, array $options = [])
9685
*/
9786
protected function applyConfiguration(array $options)
9887
{
99-
$this->invoker = \React\Filesystem\getInvoker($this, $options, 'invoker', 'React\Filesystem\InstantInvoker');
100-
$this->readDirInvoker = \React\Filesystem\getInvoker($this, $options, 'read_dir_invoker', 'React\Filesystem\InstantInvoker');
10188
$this->openFileLimiter = new OpenFileLimiter(\React\Filesystem\getOpenFileLimit($options));
10289
$this->options = array_merge_recursive($this->options, $options);
10390
}
@@ -118,14 +105,6 @@ public function getLoop()
118105
return $this->loop;
119106
}
120107

121-
/**
122-
* {@inheritDoc}
123-
*/
124-
public function setInvoker(CallInvokerInterface $invoker)
125-
{
126-
$this->invoker = $invoker;
127-
}
128-
129108
/**
130109
* {@inheritDoc}
131110
*/
@@ -139,20 +118,12 @@ public function setFilesystem(FilesystemInterface $filesystem)
139118
];
140119
}
141120

142-
/**
143-
* {@inheritDoc}
144-
*/
145-
public function setReadDirInvoker(CallInvokerInterface $invoker)
146-
{
147-
$this->readDirInvoker = $invoker;
148-
}
149-
150121
/**
151122
* {@inheritDoc}
152123
*/
153124
public function stat($filename)
154125
{
155-
return $this->invoker->invokeCall('eio_lstat', [$filename])->then(function ($stat) {
126+
return $this->callFilesystem('eio_lstat', [$filename])->then(function ($stat) {
156127
$stat['atime'] = new DateTime('@' .$stat['atime']);
157128
$stat['mtime'] = new DateTime('@' .$stat['mtime']);
158129
$stat['ctime'] = new DateTime('@' .$stat['ctime']);
@@ -165,31 +136,31 @@ public function stat($filename)
165136
*/
166137
public function unlink($filename)
167138
{
168-
return $this->invoker->invokeCall('eio_unlink', [$filename]);
139+
return $this->callFilesystem('eio_unlink', [$filename]);
169140
}
170141

171142
/**
172143
* {@inheritDoc}
173144
*/
174145
public function rename($fromFilename, $toFilename)
175146
{
176-
return $this->invoker->invokeCall('eio_rename', [$fromFilename, $toFilename]);
147+
return $this->callFilesystem('eio_rename', [$fromFilename, $toFilename]);
177148
}
178149

179150
/**
180151
* {@inheritDoc}
181152
*/
182153
public function chmod($path, $mode)
183154
{
184-
return $this->invoker->invokeCall('eio_chmod', [$path, $mode]);
155+
return $this->callFilesystem('eio_chmod', [$path, $mode]);
185156
}
186157

187158
/**
188159
* {@inheritDoc}
189160
*/
190161
public function chown($path, $uid, $gid)
191162
{
192-
return $this->invoker->invokeCall('eio_chown', [$path, $uid, $gid]);
163+
return $this->callFilesystem('eio_chown', [$path, $uid, $gid]);
193164
}
194165

195166
/**
@@ -208,7 +179,7 @@ public function lsStream($path)
208179
{
209180
$stream = new ObjectStream();
210181

211-
$this->readDirInvoker->invokeCall('eio_readdir', [$path, $this->options['lsFlags']], false)->then(function ($result) use ($path, $stream) {
182+
$this->callFilesystem('eio_readdir', [$path, $this->options['lsFlags']], false)->then(function ($result) use ($path, $stream) {
212183
$this->processLsContents($path, $result, $stream);
213184
});
214185

@@ -250,7 +221,7 @@ protected function processLsContents($basePath, $result, ObjectStream $stream)
250221
*/
251222
public function mkdir($path, $mode = self::CREATION_MODE)
252223
{
253-
return $this->invoker->invokeCall('eio_mkdir', [
224+
return $this->callFilesystem('eio_mkdir', [
254225
$path,
255226
$this->permissionFlagResolver->resolve($mode),
256227
]);
@@ -261,7 +232,7 @@ public function mkdir($path, $mode = self::CREATION_MODE)
261232
*/
262233
public function rmdir($path)
263234
{
264-
return $this->invoker->invokeCall('eio_rmdir', [$path]);
235+
return $this->callFilesystem('eio_rmdir', [$path]);
265236
}
266237

267238
/**
@@ -272,7 +243,7 @@ public function open($path, $flags, $mode = self::CREATION_MODE)
272243
$eioFlags = $this->openFlagResolver->resolve($flags);
273244
$mode = $this->permissionFlagResolver->resolve($mode);
274245
return $this->openFileLimiter->open()->then(function () use ($path, $eioFlags, $mode) {
275-
return $this->invoker->invokeCall('eio_open', [
246+
return $this->callFilesystem('eio_open', [
276247
$path,
277248
$eioFlags,
278249
$mode,
@@ -288,7 +259,7 @@ public function open($path, $flags, $mode = self::CREATION_MODE)
288259
*/
289260
public function close($fd)
290261
{
291-
return $this->invoker->invokeCall('eio_close', [$fd])->always(function () {
262+
return $this->callFilesystem('eio_close', [$fd])->always(function () {
292263
$this->openFileLimiter->close();
293264
});
294265
}
@@ -302,14 +273,14 @@ public function touch($path, $mode = self::CREATION_MODE, $time = null)
302273
if ($time === null) {
303274
$time = microtime(true);
304275
}
305-
return $this->invoker->invokeCall('eio_utime', [
276+
return $this->callFilesystem('eio_utime', [
306277
$path,
307278
$time,
308279
$time,
309280
]);
310281
}, function () use ($path, $mode) {
311282
return $this->openFileLimiter->open()->then(function () use ($path, $mode) {
312-
return $this->invoker->invokeCall('eio_open', [
283+
return $this->callFilesystem('eio_open', [
313284
$path,
314285
EIO_O_CREAT,
315286
$this->permissionFlagResolver->resolve($mode),
@@ -325,7 +296,7 @@ public function touch($path, $mode = self::CREATION_MODE, $time = null)
325296
*/
326297
public function read($fileDescriptor, $length, $offset)
327298
{
328-
return $this->invoker->invokeCall('eio_read', [
299+
return $this->callFilesystem('eio_read', [
329300
$fileDescriptor,
330301
$length,
331302
$offset,
@@ -337,7 +308,7 @@ public function read($fileDescriptor, $length, $offset)
337308
*/
338309
public function write($fileDescriptor, $data, $length, $offset)
339310
{
340-
return $this->invoker->invokeCall('eio_write', [
311+
return $this->callFilesystem('eio_write', [
341312
$fileDescriptor,
342313
$data,
343314
$length,
@@ -350,7 +321,7 @@ public function write($fileDescriptor, $data, $length, $offset)
350321
*/
351322
public function readlink($path)
352323
{
353-
return $this->invoker->invokeCall('eio_readlink', [
324+
return $this->callFilesystem('eio_readlink', [
354325
$path,
355326
]);
356327
}
@@ -360,7 +331,7 @@ public function readlink($path)
360331
*/
361332
public function symlink($fromPath, $toPath)
362333
{
363-
return $this->invoker->invokeCall('eio_symlink', [
334+
return $this->callFilesystem('eio_symlink', [
364335
$fromPath,
365336
$toPath,
366337
]);

0 commit comments

Comments
 (0)