Skip to content

Commit 5dc3810

Browse files
committedAug 7, 2023
Dev: Remove the File ignore errors.
1 parent 0e70713 commit 5dc3810

File tree

4 files changed

+17
-26
lines changed

4 files changed

+17
-26
lines changed
 

‎phpstan-baseline.php

-25
Original file line numberDiff line numberDiff line change
@@ -946,31 +946,6 @@
946946
'count' => 1,
947947
'path' => __DIR__ . '/system/Exceptions/TestException.php',
948948
];
949-
$ignoreErrors[] = [
950-
'message' => '#^Method CodeIgniter\\\\Files\\\\Exceptions\\\\FileException\\:\\:forExpectedDirectory\\(\\) has no return type specified\\.$#',
951-
'count' => 1,
952-
'path' => __DIR__ . '/system/Files/Exceptions/FileException.php',
953-
];
954-
$ignoreErrors[] = [
955-
'message' => '#^Method CodeIgniter\\\\Files\\\\Exceptions\\\\FileException\\:\\:forExpectedFile\\(\\) has no return type specified\\.$#',
956-
'count' => 1,
957-
'path' => __DIR__ . '/system/Files/Exceptions/FileException.php',
958-
];
959-
$ignoreErrors[] = [
960-
'message' => '#^Method CodeIgniter\\\\Files\\\\Exceptions\\\\FileException\\:\\:forUnableToMove\\(\\) has no return type specified\\.$#',
961-
'count' => 1,
962-
'path' => __DIR__ . '/system/Files/Exceptions/FileException.php',
963-
];
964-
$ignoreErrors[] = [
965-
'message' => '#^Method CodeIgniter\\\\Files\\\\Exceptions\\\\FileNotFoundException\\:\\:forFileNotFound\\(\\) has no return type specified\\.$#',
966-
'count' => 1,
967-
'path' => __DIR__ . '/system/Files/Exceptions/FileNotFoundException.php',
968-
];
969-
$ignoreErrors[] = [
970-
'message' => '#^Property CodeIgniter\\\\Files\\\\File\\:\\:\\$size \\(int\\) on left side of \\?\\? is not nullable\\.$#',
971-
'count' => 1,
972-
'path' => __DIR__ . '/system/Files/File.php',
973-
];
974949
$ignoreErrors[] = [
975950
'message' => '#^Expression on left side of \\?\\? is not nullable\\.$#',
976951
'count' => 1,

‎system/Files/Exceptions/FileException.php

+11
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,13 @@ class FileException extends RuntimeException implements ExceptionInterface
1919
{
2020
use DebugTraceableTrait;
2121

22+
/**
23+
*
24+
* @param string|null $from
25+
* @param string|null $to
26+
* @param string|null $error
27+
* @return FileException
28+
*/
2229
public static function forUnableToMove(?string $from = null, ?string $to = null, ?string $error = null)
2330
{
2431
return new static(lang('Files.cannotMove', [$from, $to, $error]));
@@ -28,6 +35,8 @@ public static function forUnableToMove(?string $from = null, ?string $to = null,
2835
* Throws when an item is expected to be a directory but is not or is missing.
2936
*
3037
* @param string $caller The method causing the exception
38+
*
39+
* @return FileException
3140
*/
3241
public static function forExpectedDirectory(string $caller)
3342
{
@@ -38,6 +47,8 @@ public static function forExpectedDirectory(string $caller)
3847
* Throws when an item is expected to be a file but is not or is missing.
3948
*
4049
* @param string $caller The method causing the exception
50+
*
51+
* @return FileException
4152
*/
4253
public static function forExpectedFile(string $caller)
4354
{

‎system/Files/Exceptions/FileNotFoundException.php

+5
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,11 @@ class FileNotFoundException extends RuntimeException implements ExceptionInterfa
1919
{
2020
use DebugTraceableTrait;
2121

22+
/**
23+
*
24+
* @param string $path
25+
* @return FileNotFoundException
26+
*/
2227
public static function forFileNotFound(string $path)
2328
{
2429
return new static(lang('Files.fileNotFound', [$path]));

‎system/Files/File.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ class File extends SplFileInfo
2828
*
2929
* @var int
3030
*/
31-
protected $size;
31+
protected int $size;
3232

3333
/**
3434
* @var string|null

0 commit comments

Comments
 (0)
Please sign in to comment.