Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix: Remove the File ignore errors. #7790

Merged
merged 3 commits into from
Aug 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 0 additions & 20 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -946,26 +946,6 @@
'count' => 1,
'path' => __DIR__ . '/system/Exceptions/TestException.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Files\\\\Exceptions\\\\FileException\\:\\:forExpectedDirectory\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Files/Exceptions/FileException.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Files\\\\Exceptions\\\\FileException\\:\\:forExpectedFile\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Files/Exceptions/FileException.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Files\\\\Exceptions\\\\FileException\\:\\:forUnableToMove\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Files/Exceptions/FileException.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Files\\\\Exceptions\\\\FileNotFoundException\\:\\:forFileNotFound\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Files/Exceptions/FileNotFoundException.php',
];
$ignoreErrors[] = [
'message' => '#^Property CodeIgniter\\\\Files\\\\File\\:\\:\\$size \\(int\\) on left side of \\?\\? is not nullable\\.$#',
'count' => 1,
Expand Down
7 changes: 7 additions & 0 deletions system/Files/Exceptions/FileException.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class FileException extends RuntimeException implements ExceptionInterface
{
use DebugTraceableTrait;

/**
* @return static
*/
public static function forUnableToMove(?string $from = null, ?string $to = null, ?string $error = null)
{
return new static(lang('Files.cannotMove', [$from, $to, $error]));
Expand All @@ -28,6 +31,8 @@ public static function forUnableToMove(?string $from = null, ?string $to = null,
* Throws when an item is expected to be a directory but is not or is missing.
*
* @param string $caller The method causing the exception
*
* @return static
*/
public static function forExpectedDirectory(string $caller)
{
Expand All @@ -38,6 +43,8 @@ public static function forExpectedDirectory(string $caller)
* Throws when an item is expected to be a file but is not or is missing.
*
* @param string $caller The method causing the exception
*
* @return static
*/
public static function forExpectedFile(string $caller)
{
Expand Down
3 changes: 3 additions & 0 deletions system/Files/Exceptions/FileNotFoundException.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@ class FileNotFoundException extends RuntimeException implements ExceptionInterfa
{
use DebugTraceableTrait;

/**
* @return static
*/
public static function forFileNotFound(string $path)
{
return new static(lang('Files.fileNotFound', [$path]));
Expand Down