Repository: codeigniter4/CodeIgniter4 (PHP)

Issue:
Bug: The getFiles method of \CodeIgniter\Events class is declared as 'public', but it should probably be 'public static'.
### PHP Version

8.2

### CodeIgniter4 Version

4.2.11

### CodeIgniter4 Installation Method

Composer (using `codeigniter4/appstarter`)

### Which operating systems have you tested for this bug?

Linux

### Which server did you use?

apache

### Database

MySQL

### What happened?

The getFiles method of \CodeIgniter\Events class is declared as 'public', but it should probably be 'public static'?

### Steps to Reproduce

Just try to make this call (which will throw an error since the getFiles is not static, and its an anti-pattern to instantiate the Events class just to be able to call this method.):
\CodeIgniter\Events\Events::getFiles();

### Expected Output

A list of Events.php config file locations.

### Anything else?

We ran into this issue while trying to implement a solution that requires us to get a list of those locations, our system is a web-based configuration for installations were you don't have access to modify the files on the drive.

Our current workaround was just to patch the class to add the static keyword to that method definition and update our installation. Just wondering if there is maybe a valid reason why the getFiles method is not public static and if maybe we should change it to include the static keyword.


Discussion:
The properties in the Event class are all static and all methods other than getFiles() are static.
So I agree that the method should be static.
That looks like just a typo to me. It will still work in an instantiated object even if we change it to `static` so let's do just that. @benedict-tshaba Would you send a PR for this please? Literally just add the word `static` - you can donut through GitHub's UI if you're not comfortable with the workflow, it will guide you. 
Hi @MGatner, there is already a PR for this which has been reviewed: #7046.
So I think we are sorted on this one.
Thanks.



Patch:
diff --git a/system/Events/Events.php b/system/Events/Events.php
index 3117969882df..064f01ab4104 100644
--- a/system/Events/Events.php
+++ b/system/Events/Events.php
@@ -246,7 +246,7 @@ public static function setFiles(array $files)
      *
      * @return string[]
      */
-    public function getFiles()
+    public static function getFiles()
     {
         return static::$files;
     }


Test patch:
diff --git a/tests/system/Events/EventsTest.php b/tests/system/Events/EventsTest.php
index b6a8aa1a4cb7..1a106aca3548 100644
--- a/tests/system/Events/EventsTest.php
+++ b/tests/system/Events/EventsTest.php
@@ -55,21 +55,21 @@ public function testInitialize()
 
         // it should start out empty
         MockEvents::setFiles([]);
-        $this->assertEmpty($this->manager->getFiles());
+        $this->assertEmpty(Events::getFiles());
 
         // make sure we have a default events file
         $default = [APPPATH . 'Config' . DIRECTORY_SEPARATOR . 'Events.php'];
         $this->manager->unInitialize();
         MockEvents::initialize();
-        $this->assertSame($default, $this->manager->getFiles());
+        $this->assertSame($default, Events::getFiles());
 
         // but we should be able to change it through the backdoor
         MockEvents::setFiles(['/peanuts']);
-        $this->assertSame(['/peanuts'], $this->manager->getFiles());
+        $this->assertSame(['/peanuts'], Events::getFiles());
 
         // re-initializing should have no effect
         MockEvents::initialize();
-        $this->assertSame(['/peanuts'], $this->manager->getFiles());
+        $this->assertSame(['/peanuts'], Events::getFiles());
     }
 
     public function testPerformance()