File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1414use CodeIgniter \Files \Exceptions \FileException ;
1515use CodeIgniter \Files \Exceptions \FileNotFoundException ;
1616use Config \Mimes ;
17+ use ReturnTypeWillChange ;
1718use SplFileInfo ;
1819
1920/**
@@ -29,15 +30,15 @@ class File extends SplFileInfo
2930 protected $ size ;
3031
3132 /**
32- * Original MimeType
33- *
3433 * @var string|null
3534 */
3635 protected $ originalMimeType ;
3736
3837 /**
3938 * Run our SplFileInfo constructor with an optional verification
4039 * that the path is really a file.
40+ *
41+ * @throws FileNotFoundException
4142 */
4243 public function __construct (string $ path , bool $ checkFile = false )
4344 {
@@ -55,8 +56,9 @@ public function __construct(string $path, bool $checkFile = false)
5556 * the file in the $_FILES array if available, as PHP calculates this based
5657 * on the actual size transmitted.
5758 *
58- * @return int The file size in bytes
59+ * @return false| int The file size in bytes, or false on failure
5960 */
61+ #[ReturnTypeWillChange]
6062 public function getSize ()
6163 {
6264 return $ this ->size ?? ($ this ->size = parent ::getSize ());
@@ -65,7 +67,7 @@ public function getSize()
6567 /**
6668 * Retrieve the file size by unit.
6769 *
68- * @return int|string
70+ * @return false| int|string
6971 */
7072 public function getSizeByUnit (string $ unit = 'b ' )
7173 {
You can’t perform that action at this time.
0 commit comments