Skip to content

Commit 9597237

Browse files
authored
Merge pull request #9037 from christianberkman/docs-file-getsize
docs: [File Instance] RunTimeException if file does not exist
2 parents 73141f9 + 8053635 commit 9597237

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

system/Files/File.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ public function __construct(string $path, bool $checkFile = false)
5959
*
6060
* Implementations SHOULD return the value stored in the "size" key of
6161
* the file in the $_FILES array if available, as PHP calculates this based
62-
* on the actual size transmitted.
62+
* on the actual size transmitted. A RuntimeException will be thrown if the file
63+
* does not exist or an error occurs.
6364
*
6465
* @return false|int The file size in bytes, or false on failure
6566
*/

user_guide_src/source/libraries/files.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ Returns the size of the file in bytes:
5151
.. literalinclude:: files/004.php
5252
:lines: 2-
5353

54+
A ``RuntimeException`` will be thrown if the file does not exist or an error occurs.
55+
5456
getSizeByUnit()
5557
===============
5658

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

65+
A ``RuntimeException`` will be thrown if the file does not exist or an error occurs.
66+
6367
getMimeType()
6468
=============
6569

0 commit comments

Comments
 (0)