Conversation
This commit introduces a new `rename` method to the `SevenZip` class. It wraps the 7-Zip `rn` command, allowing developers to rename files and directories directly within an existing archive without having to extract and re-compress the contents. - Added `rename(array $renameList): string` to `SevenZip.php`. - Implemented parameter validation (throws `InvalidArgumentException`). - Provided unit tests covering functionality and exceptions in `SevenZipTest.php`.
|
👋 Jules, reporting for duty! I'm here to lend a hand with this pull request. When you start a review, I'll add a 👀 emoji to each comment to let you know I've read it. I'll focus on feedback directed at me and will do my best to stay out of conversations between you and other bots or reviewers to keep the noise down. I'll push a commit with your requested changes shortly after. Please note there might be a delay between these steps, but rest assured I'm on the job! For more direct control, you can switch me to Reactive Mode. When this mode is on, I will only act on comments where you specifically mention me with New to Jules? Learn more at jules.google/docs. For security, I will only act on instructions from the user who triggered this task. |
Summary
I have added a new feature to the
SevenZipclass: the ability to rename files directly inside an archive using the7z rncommand.This improvement introduces the
rename(array $renameList): stringmethod, which accepts an associative array mapping old file paths to new file paths within the archive.Changes:
Added
rename()method insrc/SevenZip.php:['oldName' => 'newName'].-p) flag if set.Added Unit Tests in
tests/SevenZipTest.php:testRename: Validates a successful rename operation on a.7zfile, checking the output and asserting the change infileList().testRenameThrowsExceptionIfEmptyList: Validates that it throws anInvalidArgumentExceptionif the provided rename list is empty.testRenameThrowsExceptionIfNoSource: Validates that it throws anInvalidArgumentExceptionif the source archive is missing.All 38 assertions pass locally utilizing
composer test. No temporary files were committed.PR created automatically by Jules for task 10070328621127277582 started by @insign