10000 [Filesystem] Improve exception message for copy method by King2500 · Pull Request #13692 · symfony/symfony · GitHub
[go: up one dir, main page]

Skip to content

[Filesystem] Improve exception message for copy method #13692

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 3 commits into from

Conversation

King2500
Copy link
Contributor

see diff

Q A
Bug fix? no
New feature? no
BC breaks? no
Deprecations? no
Tests pass? yes? (no change in semantics)
Fixed tickets
License MIT
Doc PR

@King2500 King2500 changed the title Improve exception message for copy method [Filesystem] Improve exception message for copy method Feb 14, 2015
$bytesOrigin = filesize($originFile);

if (stream_is_local($originFile) && $bytesCopied !== $bytesOrigin) {
throw new IOException(sprintf('Failed to copy the whole content of "%s" to "%s" (%g of %g bytes copied).', $originFile, $targetFile, $bytesCopied, $bytesOrigin), 0, null, $originFile);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice change 👍
Why not move the declaration of $bytesOrigin inside of the if-check/statement itself? That way it is only declarated if the stream_is_local check is true.

@fabpot
Copy link
Member
A1EF fabpot commented Feb 16, 2015

Thank you @King2500.

@fabpot fabpot closed this in 3bbca21 Feb 16, 2015
@King2500
Copy link
Contributor Author

Why not 2.6 branch?

Edit:
Ok, I understand: http://symfony.com/doc/current/contributing/code/patches.html#choose-the-right-branch
2.6 gets bugfixes from 2.3 (if applicable), new features/updates go into 2.7 (next release).
What about bugfixes for 2.6 exclusive code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants
0