src/Filesystem.php
/**
     * Execute a callback in a directory, callback is passed the
     * absolute path.
     */
Execute a callback in a directory, callback is passed the
absolute path.
Execute a callback in a directory callback is passed the absolute path .
public function executeInPath(string $path, callable $callback): void
    {
        $currentPath = (string) getcwd();
        if (!$this->exists($path)) {
            throw new IOException(sprintf('Path: "%s" does not exist.', $path));
        }
        chdir($path);
        $callback($path);
        chdir($currentPath);
    }
public function executeInPath ( string $ path , callable $ callback ) : void { $ currentPath = ( string ) getcwd ( ) ; if ( ! $ this -> exists ( $ path ) ) { throw new IOException ( sprintf ( 'Path: "%s" does not exist.' , $ path ) ) ; } chdir ( $ path ) ; $ callback ( $ path ) ; chdir ( $ currentPath ) ; }
Execute a callback in a directory, callback is passed the
 absolute path.
Execute a callback in a directory callback is passed the absolute path .