src/filesystem/Directory.php
private function directoryOperation(string $operation, string $destination):void
    {
        try {
            Filesystem::checkExists($destination);
        } catch (FileNotFoundException $e) {
            $destinationDir = new self($destination);
            $destinationDir->create();
        }

        $files = $this->getFiles();
        foreach ($files as $file) {
            $destinationPath = "$destination/" . basename($file);
            $file->$operation($destinationPath);
        }
    }
private function directoryOperation(string $operation, string $destination):void
    {
        try {
            Filesystem::checkExists($destination);
        } catch (FileNotFoundException $e) {
            $destinationDir = new self($destination);
            $destinationDir->create();
        }

        $files = $this->getFiles();
        foreach ($files as $file) {
            $destinationPath = "$destination/" . basename($file);
            $file->$operation($destinationPath);
        }
    }
private function directoryOperation ( string $ operation , string $ destination ) : void { try { Filesystem :: checkExists ( $ destination ) ; } catch ( FileNotFoundException $ e ) { $ destinationDir = new self ( $ destination ) ; $ destinationDir -> create ( ) ; } $ files = $ this -> getFiles ( ) ; foreach ( $ files as $ file ) { $ destinationPath = "$destination/" . basename ( $ file ) ; $ file -> $ operation ( $ destinationPath ) ; } }
Used to perform copies and moves.

@param string $operation
@param string $destination
@throws FileNotFoundException
@throws FilesystemException
@throws \ntentan\utils\exceptions\FileAlreadyExistsException
@throws \ntentan\utils\exceptions\FileNotReadableException
@throws \ntentan\utils\exceptions\FileNotWriteableException
Used to perform copies and moves .