Skip to content

Commit a9ad131

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

21 files changed

+194
-1029
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 & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,6 @@ class Adapter implements AdapterInterface
6464
*/
6565
protected $permissionFlagResolver;
6666

67-
/**
68-
* @var CallInvokerInterface
69-
*/
70-
protected $invoker;
71-
7267
/**
7368
* @var array
7469
*/
@@ -85,7 +80,6 @@ public function __construct(LoopInterface $loop, array $options = [])
8580
{
8681
$this->loop = $loop;
8782

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

@@ -145,15 +139,6 @@ public function setFilesystem(FilesystemInterface $filesystem)
145139
];
146140
}
147141

148-
/**
149-
* @param CallInvokerInterface $invoker
150-
* @return void
151-
*/
152-
public function setInvoker(CallInvokerInterface $invoker)
153-
{
154-
$this->invoker = $invoker;
155-
}
156-
157142
/**
158143
* @param string $function
159144
* @param array $args
@@ -176,7 +161,7 @@ public function callFilesystem($function, $args, $errorResultCode = -1)
176161
*/
177162
public function chmod($path, $mode)
178163
{
179-
return $this->invoker->invokeCall('chmod', [
164+
return $this->callFilesystem('chmod', [
180165
'path' => $path,
181166
'mode' => decoct($mode),
182167
]);
@@ -189,7 +174,7 @@ public function chmod($path, $mode)
189174
*/
190175
public function mkdir($path, $mode = self::CREATION_MODE)
191176
{
192-
return $this->invoker->invokeCall('mkdir', [
177+
return $this->callFilesystem('mkdir', [
193178
'path' => $path,
194179
'mode' => decoct($this->permissionFlagResolver->resolve($mode)),
195180
]);
@@ -271,7 +256,7 @@ public function close($fd)
271256
*/
272257
public function rmdir($path)
273258
{
274-
return $this->invoker->invokeCall('rmdir', [
259+
return $this->callFilesystem('rmdir', [
275260
'path' => $path,
276261
]);
277262
}
@@ -282,7 +267,7 @@ public function rmdir($path)
282267
*/
283268
public function unlink($path)
284269
{
285-
return $this->invoker->invokeCall('unlink', [
270+
return $this->callFilesystem('unlink', [
286271
'path' => $path,
287272
]);
288273
}
@@ -295,7 +280,7 @@ public function unlink($path)
295280
*/
296281
public function chown($path, $uid, $gid)
297282
{
298-
return $this->invoker->invokeCall('chown', [
283+
return $this->callFilesystem('chown', [
299284
'path' => $path,
300285
'uid' => $uid,
301286
'gid' => $gid,
@@ -308,7 +293,7 @@ public function chown($path, $uid, $gid)
308293
*/
309294
public function stat($filename)
310295
{
311-
return $this->invoker->invokeCall('stat', [
296+
return $this->callFilesystem('stat', [
312297
'path' => $filename,
313298
])->then(function ($stat) {
314299
$stat['atime'] = new DateTime('@' . $stat['atime']);
@@ -335,7 +320,7 @@ public function lsStream($path)
335320
{
336321
$stream = new ObjectStream();
337322

338-
$this->invoker->invokeCall('readdir', [
323+
$this->callFilesystem('readdir', [
339324
'path' => $path,
340325
'flags' => $this->options['lsFlags'],
341326
])->then(function ($result) use ($path, $stream) {
@@ -372,7 +357,7 @@ protected function processLsContents($basePath, $result, ObjectStream $stream)
372357
*/
373358
public function touch($path, $mode = self::CREATION_MODE)
374359
{
375-
return $this->invoker->invokeCall('touch', [
360+
return $this->callFilesystem('touch', [
376361
'path' => $path,
377362
'mode' => decoct($this->permissionFlagResolver->resolve($mode)),
378363
]);
@@ -385,7 +370,7 @@ public function touch($path, $mode = self::CREATION_MODE)
385370
*/
386371
public function rename($fromPath, $toPath)
387372
{
388-
return $this->invoker->invokeCall('rename', [
373+
return $this->callFilesystem('rename', [
389374
'from' => $fromPath,
390375
'to' => $toPath,
391376
]);
@@ -397,7 +382,7 @@ public function rename($fromPath, $toPath)
397382
*/
398383
public function readlink($path)
399384
{
400-
return $this->invoker->invokeCall('readlink', [
385+
return $this->callFilesystem('readlink', [
401386
'path' => $path,
402387
])->then(function ($result) {
403388
return \React\Promise\resolve($result['path']);
@@ -411,7 +396,7 @@ public function readlink($path)
411396
*/
412397
public function symlink($fromPath, $toPath)
413398
{
414-
return $this->invoker->invokeCall('symlink', [
399+
return $this->callFilesystem('symlink', [
415400
'from' => $fromPath,
416401
'to' => $toPath,
417402
])->then(function ($result) {

src/Eio/Adapter.php

Lines changed: 15 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -44,16 +44,6 @@ class Adapter implements AdapterInterface
4444
*/
4545
protected $permissionFlagResolver;
4646

47-
/**
48-
* @var CallInvokerInterface
49-
*/
50-
protected $invoker;
51-
52-
/**
53-
* @var CallInvokerInterface
54-
*/
55-
protected $readDirInvoker;
56-
5747
/**
5848
* @var FilesystemInterface
5949
*/
@@ -96,8 +86,6 @@ public function __construct(LoopInterface $loop, array $options = [])
9686
*/
9787
protected function applyConfiguration(array $options)
9888
{
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');
10189
$this->openFileLimiter = new OpenFileLimiter(\React\Filesystem\getOpenFileLimit($options));
10290
$this->options = array_merge_recursive($this->options, $options);
10391
}
@@ -118,14 +106,6 @@ public function getLoop()
118106
return $this->loop;
119107
}
120108

121-
/**
122-
* {@inheritDoc}
123-
*/
124-
public function setInvoker(CallInvokerInterface $invoker)
125-
{
126-
$this->invoker = $invoker;
127-
}
128-
129109
/**
130110
* {@inheritDoc}
131111
*/
@@ -152,7 +132,7 @@ public function setReadDirInvoker(CallInvokerInterface $invoker)
152132
*/
153133
public function stat($filename)
154134
{
155-
return $this->invoker->invokeCall('eio_lstat', [$filename])->then(function ($stat) {
135+
return $this->callFilesystem('eio_lstat', [$filename])->then(function ($stat) {
156136
$stat['atime'] = new DateTime('@' .$stat['atime']);
157137
$stat['mtime'] = new DateTime('@' .$stat['mtime']);
158138
$stat['ctime'] = new DateTime('@' .$stat['ctime']);
@@ -165,31 +145,31 @@ public function stat($filename)
165145
*/
166146
public function unlink($filename)
167147
{
168-
return $this->invoker->invokeCall('eio_unlink', [$filename]);
148+
return $this->callFilesystem('eio_unlink', [$filename]);
169149
}
170150

171151
/**
172152
* {@inheritDoc}
173153
*/
174154
public function rename($fromFilename, $toFilename)
175155
{
176-
return $this->invoker->invokeCall('eio_rename', [$fromFilename, $toFilename]);
156+
return $this->callFilesystem('eio_rename', [$fromFilename, $toFilename]);
177157
}
178158

179159
/**
180160
* {@inheritDoc}
181161
*/
182162
public function chmod($path, $mode)
183163
{
184-
return $this->invoker->invokeCall('eio_chmod', [$path, $mode]);
164+
return $this->callFilesystem('eio_chmod', [$path, $mode]);
185165
}
186166

187167
/**
188168
* {@inheritDoc}
189169
*/
190170
public function chown($path, $uid, $gid)
191171
{
192-
return $this->invoker->invokeCall('eio_chown', [$path, $uid, $gid]);
172+
return $this->callFilesystem('eio_chown', [$path, $uid, $gid]);
193173
}
194174

195175
/**
@@ -250,7 +230,7 @@ protected function processLsContents($basePath, $result, ObjectStream $stream)
250230
*/
251231
public function mkdir($path, $mode = self::CREATION_MODE)
252232
{
253-
return $this->invoker->invokeCall('eio_mkdir', [
233+
return $this->callFilesystem('eio_mkdir', [
254234
$path,
255235
$this->permissionFlagResolver->resolve($mode),
256236
]);
@@ -261,7 +241,7 @@ public function mkdir($path, $mode = self::CREATION_MODE)
261241
*/
262242
public function rmdir($path)
263243
{
264-
return $this->invoker->invokeCall('eio_rmdir', [$path]);
244+
return $this->callFilesystem('eio_rmdir', [$path]);
265245
}
266246

267247
/**
@@ -272,7 +252,7 @@ public function open($path, $flags, $mode = self::CREATION_MODE)
272252
$eioFlags = $this->openFlagResolver->resolve($flags);
273253
$mode = $this->permissionFlagResolver->resolve($mode);
274254
return $this->openFileLimiter->open()->then(function () use ($path, $eioFlags, $mode) {
275-
return $this->invoker->invokeCall('eio_open', [
255+
return $this->callFilesystem('eio_open', [
276256
$path,
277257
$eioFlags,
278258
$mode,
@@ -288,7 +268,7 @@ public function open($path, $flags, $mode = self::CREATION_MODE)
288268
*/
289269
public function close($fd)
290270
{
291-
return $this->invoker->invokeCall('eio_close', [$fd])->always(function () {
271+
return $this->callFilesystem('eio_close', [$fd])->always(function () {
292272
$this->openFileLimiter->close();
293273
});
294274
}
@@ -302,14 +282,14 @@ public function touch($path, $mode = self::CREATION_MODE, $time = null)
302282
if ($time === null) {
303283
$time = microtime(true);
304284
}
305-
return $this->invoker->invokeCall('eio_utime', [
285+
return $this->callFilesystem('eio_utime', [
306286
$path,
307287
$time,
308288
$time,
309289
]);
310290
}, function () use ($path, $mode) {
311291
return $this->openFileLimiter->open()->then(function () use ($path, $mode) {
312-
return $this->invoker->invokeCall('eio_open', [
292+
return $this->callFilesystem('eio_open', [
313293
$path,
314294
EIO_O_CREAT,
315295
$this->permissionFlagResolver->resolve($mode),
@@ -325,7 +305,7 @@ public function touch($path, $mode = self::CREATION_MODE, $time = null)
325305
*/
326306
public function read($fileDescriptor, $length, $offset)
327307
{
328-
return $this->invoker->invokeCall('eio_read', [
308+
return $this->callFilesystem('eio_read', [
329309
$fileDescriptor,
330310
$length,
331311
$offset,
@@ -337,7 +317,7 @@ public function read($fileDescriptor, $length, $offset)
337317
*/
338318
public function write($fileDescriptor, $data, $length, $offset)
339319
{
340-
return $this->invoker->invokeCall('eio_write', [
320+
return $this->callFilesystem('eio_write', [
341321
$fileDescriptor,
342322
$data,
343323
$length,
@@ -350,7 +330,7 @@ public function write($fileDescriptor, $data, $length, $offset)
350330
*/
351331
public function readlink($path)
352332
{
353-
return $this->invoker->invokeCall('eio_readlink', [
333+
return $this->callFilesystem('eio_readlink', [
354334
$path,
355335
]);
356336
}
@@ -360,7 +340,7 @@ public function readlink($path)
360340
*/
361341
public function symlink($fromPath, $toPath)
362342
{
363-
return $this->invoker->invokeCall('eio_symlink', [
343+
return $this->callFilesystem('eio_symlink', [
364344
$fromPath,
365345
$toPath,
366346
]);

src/Filesystem.php

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -137,12 +137,4 @@ public function getContents($filename)
137137
return $file->getContents();
138138
});
139139
}
140-
141-
/**
142-
* @param CallInvokerInterface $invoker
143-
*/
144-
public function setInvoker(CallInvokerInterface $invoker)
145-
{
146-
$this->adapter->setInvoker($invoker);
147-
}
148140
}

src/FilesystemInterface.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,4 @@ public function link($path, Node\NodeInterface $destination);
5656
* @return \React\Promise\PromiseInterface
5757
*/
5858
public function getContents($filename);
59-
60-
/**
61-
* @param CallInvokerInterface $invoker
62-
*/
63-
public function setInvoker(CallInvokerInterface $invoker);
6459
}

0 commit comments

Comments
 (0)