From 98ee5d4adba8973b64848f9515ca1760d38e5620 Mon Sep 17 00:00:00 2001 From: christianberkman <39840601+christianberkman@users.noreply.github.com> Date: Tue, 9 Jul 2024 15:32:48 +0300 Subject: [PATCH 1/4] doc: add exception to docblock --- system/Files/File.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/system/Files/File.php b/system/Files/File.php index 02c8f181b19b..3ac2ffd9f1aa 100644 --- a/system/Files/File.php +++ b/system/Files/File.php @@ -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 */ From a7190d504354b8fd1b4881dfbef1c3b300291e34 Mon Sep 17 00:00:00 2001 From: christianberkman <39840601+christianberkman@users.noreply.github.com> Date: Tue, 9 Jul 2024 15:34:00 +0300 Subject: [PATCH 2/4] doc: add posibility of exception --- user_guide_src/source/libraries/files.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/user_guide_src/source/libraries/files.rst b/user_guide_src/source/libraries/files.rst index 0b55982692c2..f30e067f57c4 100644 --- a/user_guide_src/source/libraries/files.rst +++ b/user_guide_src/source/libraries/files.rst @@ -46,6 +46,8 @@ Returns the size of the uploaded file in bytes: .. literalinclude:: files/004.php +A RuntimeException will be thrown if the file does not exist or an error occurs. + getSizeByUnit() =============== @@ -54,6 +56,8 @@ the results in kilobytes or megabytes, respectively: .. literalinclude:: files/005.php +A RuntimeException will be thrown if the file does not exist or an error occurs. + getMimeType() ============= From c4396c321f174ddd3ffe98470cc982aa46d348b0 Mon Sep 17 00:00:00 2001 From: christianberkman <39840601+christianberkman@users.noreply.github.com> Date: Tue, 9 Jul 2024 17:32:45 +0300 Subject: [PATCH 3/4] delete stray empty space --- system/Files/File.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/system/Files/File.php b/system/Files/File.php index 3ac2ffd9f1aa..15b53262e9c2 100644 --- a/system/Files/File.php +++ b/system/Files/File.php @@ -60,7 +60,7 @@ 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. A RuntimeException will be thrown if the file - * does not exist or an error occurs. + * does not exist or an error occurs. * * @return false|int The file size in bytes, or false on failure */ From 80536358cf3a0c729f4480bd6fb34fd96d8a5fd0 Mon Sep 17 00:00:00 2001 From: christianberkman <39840601+christianberkman@users.noreply.github.com> Date: Thu, 25 Jul 2024 08:51:08 +0300 Subject: [PATCH 4/4] Apply suggestions from code review Co-authored-by: kenjis --- user_guide_src/source/libraries/files.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/user_guide_src/source/libraries/files.rst b/user_guide_src/source/libraries/files.rst index f30e067f57c4..8d2e90c9df46 100644 --- a/user_guide_src/source/libraries/files.rst +++ b/user_guide_src/source/libraries/files.rst @@ -46,7 +46,7 @@ Returns the size of the uploaded file in bytes: .. literalinclude:: files/004.php -A RuntimeException will be thrown if the file does not exist or an error occurs. +A ``RuntimeException`` will be thrown if the file does not exist or an error occurs. getSizeByUnit() =============== @@ -56,7 +56,7 @@ the results in kilobytes or megabytes, respectively: .. literalinclude:: files/005.php -A RuntimeException will be thrown if the file does not exist or an error occurs. +A ``RuntimeException`` will be thrown if the file does not exist or an error occurs. getMimeType() =============