-
-
Notifications
You must be signed in to change notification settings - Fork 9.6k
[HttpFoundation] Incorrect documentation and method name for UploadedFile::getClientSize() #25324
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
Conversation
50794b6
to
df51428
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
reasonable 👍
where's the picture/photo? 🤔
*/ | ||
public function getClientSize() | ||
{ | ||
@trigger_error(sprintf('%s is deprecated since 4.1 and will be removed in 5.0 use %s::%s.', __METHOD__, __CLASS__, 'getSize'), E_USER_DEPRECATED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"%s" ... 5.0. Use getFileSize() instead.
* | ||
* @return int|null The file size | ||
*/ | ||
public function getFileSize() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
getClientSize
becomes getSize
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
which you are actually suggesting above :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's not the same thing I guess, getSize
already exists.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, my bad. \SplFileInfo::getSize — Gets file size
.
So what do we suggest here? Another file size? Or should we override getSize to avoid re-calculating / forward if $size is null.
getUploadedSize
maybe? Would it make sense?
df51428
to
eb469dc
Compare
@ro0NL There are no picture on this one because i've pushed 2 PR this morning and didn't take the time to take one picture for this one ^^'. |
*/ | ||
public function getClientSize() | ||
{ | ||
@trigger_error(sprintf('%s is deprecated since 4.1 and will be removed in 5.0 use %s instead.', __METHOD__, 'getFileSize'), E_USER_DEPRECATED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We really want the first %s
to be quoted i guess for HTML purpose (e.g. make it bold in the profiler log panel).
Also i suggested to start a new sentence as of 5.0. Use ... instead
(no real reason to use a sprintf placeholder here also).
Sorry :) just following 3.x convention AFAIK.
157f01a
to
f5a8168
Compare
@@ -60,6 +60,9 @@ public function __construct(string $path, string $originalName, string $mimeType | |||
$this->originalName = $this->getName($originalName); | |||
$this->mimeType = $mimeType ?: 'application/octet-stream'; | |||
$this->size = $size; | |||
if (null !== $size) { | |||
@trigger_error('Passing a size in the constructor is deprecated since 4.1 and will be removed in 5.0. Use getSize instead.', E_USER_DEPRECATED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"getSize()"
*/ | ||
public function getClientSize() | ||
{ | ||
@trigger_error(sprintf('"%s" is deprecated since 4.1 and will be removed in 5.0. Use getSize instead.', __METHOD__), E_USER_DEPRECATED); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same here
f5a8168
to
a8e4d7a
Compare
…File::getClientSize()
a8e4d7a
to
b136320
Compare
The PR has been fixed from review and rebased with current master. |
Thank you @Simperfit. |
…me for UploadedFile::getClientSize() (Simperfit) This PR was merged into the 4.1-dev branch. Discussion ---------- [HttpFoundation] Incorrect documentation and method name for UploadedFile::getClientSize() | Q | A | ------------- | --- | Branch? | 4.1 | Bug fix? | no | New feature? | no <!-- don't forget to update src/**/CHANGELOG.md files --> | BC breaks? | no | Deprecations? | yes <!-- don't forget to update UPGRADE-*.md files --> | Tests pass? | yes | Fixed tickets | #23791 | License | MIT | Doc PR | none Replace the wrong named and documented method by another with better doc and better naming Commits ------- b136320 [HttpFoundation] Incorrect documentation and method name for UploadedFile::getClientSize()
Replace the wrong named and documented method by another with better doc and better naming