Skip to content

Commit

Permalink
Merge pull request #9037 from christianberkman/docs-file-getsize
Browse files Browse the repository at this point in the history
docs: [File Instance] RunTimeException if file does not exist
  • Loading branch information
kenjis authored Jul 25, 2024
2 parents 73141f9 + 8053635 commit 9597237
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion system/Files/File.php
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ public function __construct(string $path, bool $checkFile = false)
*
* Implementations SHOULD return the value stored in the "size" key of
* the file in the $_FILES array if available, as PHP calculates this based
* on the actual size transmitted.
* on the actual size transmitted. A RuntimeException will be thrown if the file
* does not exist or an error occurs.
*
* @return false|int The file size in bytes, or false on failure
*/
Expand Down
4 changes: 4 additions & 0 deletions user_guide_src/source/libraries/files.rst
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ Returns the size of the file in bytes:
.. literalinclude:: files/004.php
:lines: 2-

A ``RuntimeException`` will be thrown if the file does not exist or an error occurs.

getSizeByUnit()
===============

Expand All @@ -60,6 +62,8 @@ the results in kilobytes or megabytes, respectively:
.. literalinclude:: files/005.php
:lines: 2-

A ``RuntimeException`` will be thrown if the file does not exist or an error occurs.

getMimeType()
=============

Expand Down

0 comments on commit 9597237

Please sign in to comment.