Skip to content
This repository has been archived by the owner on Jan 30, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/43'
Browse files Browse the repository at this point in the history
Close #43
  • Loading branch information
weierophinney committed May 17, 2017
2 parents 90c72b9 + 0b638a8 commit 56fb2b8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 3 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ All notable changes to this project will be documented in this file, in reverse
`Callback` filter's `setCallback()` method to allow passing a string name of a
class that is instantiable without constructor arguments, and which defines
`__invoke()`.
- [#43](https://github.com/zendframework/zend-filter/pull/43) updates the
exception thrown by the `File\Rename` filter when the target already exists to
indicate the target filename path.

### Deprecated

Expand Down
8 changes: 5 additions & 3 deletions src/File/Rename.php
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,11 @@ public function getNewName($value, $source = false)
}

if (file_exists($file['target'])) {
throw new Exception\InvalidArgumentException(
sprintf("File '%s' could not be renamed. It already exists.", $value)
);
throw new Exception\InvalidArgumentException(sprintf(
'"File "%s" could not be renamed to "%s"; target file already exists',
$value,
realpath($file['target'])
));
}

if ($source) {
Expand Down

0 comments on commit 56fb2b8

Please sign in to comment.