88use React \Filesystem \ObjectStream ;
99use React \Filesystem \ObjectStreamSink ;
1010use React \Filesystem \AdapterInterface ;
11- use React \Filesystem \CallInvokerInterface ;
1211use React \Filesystem \FilesystemInterface ;
1312use React \Filesystem \MappedTypeDetector ;
1413use 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 ) {
0 commit comments