codeigniter4 / CodeIgniter4

Open Source PHP Framework (originally from EllisLab)
https://codeigniter.com/
MIT License
5.4k stars 1.9k forks source link

Bug: PhpStorm warnings in public/index.php #7434

Closed InsiteFX closed 1 year ago

InsiteFX commented 1 year ago

PHP Version

8.2

CodeIgniter4 Version

4.3.3 updated today

CodeIgniter4 Installation Method

Manual (zip or tar.gz)

Which operating systems have you tested for this bug?

Windows

Which server did you use?

apache

Database

MariaDB 10.4.28

What happened?

phpStorm throwing Warnings on these 2 lines now.

Line #16 - Can be replaced with 'const' syntax

// Path to the front controller (this file) define('FCPATH', )DIR . DIRECTORY_SEPARATOR;

Line #67 - Unhandled \CodeIgniter\Router\Exceptions\RedirectException $app->run();

Steps to Reproduce

Open in phpStorm Top right Warning sign.

Expected Output

No Warnings.

Anything else?

No response

kenjis commented 1 year ago

If you think this should be fixed, why don't you send a PR? See https://github.com/codeigniter4/CodeIgniter4/blob/develop/contributing/pull_request.md

iRedds commented 1 year ago

@kenjis Can the Codeigniter::run() method really throw RedirectExceptions? This exception is caught in the catch block, so I think the @throws RedirectException docblock is misleading. Or am I missing something?

kenjis commented 1 year ago

@InsiteFX If you report an issue, please write the file path.

kenjis commented 1 year ago

PhpStorm says "Exception 'RedirectException' is never thrown in the function". Screenshot 2023-04-14 15 46 28

kenjis commented 1 year ago

@iRedds It seems you are correct. The @throws RedirectException should be removed.