Skip to content

Commit

Permalink
Merge pull request #7766 from ping-yee/230802-phpstan-event
Browse files Browse the repository at this point in the history
Dev: remove the `event` ignore errors in phpstan-baseline.php
  • Loading branch information
kenjis committed Aug 3, 2023
2 parents b3fe701 + 35b1aa9 commit 89d249a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 25 deletions.
25 changes: 0 additions & 25 deletions phpstan-baseline.php
Original file line number Diff line number Diff line change
Expand Up @@ -901,41 +901,16 @@
'count' => 1,
'path' => __DIR__ . '/system/Entity/Entity.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Events\\\\Events\\:\\:initialize\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Events/Events.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Events\\\\Events\\:\\:on\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Events/Events.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Events\\\\Events\\:\\:on\\(\\) has parameter \\$callback with no signature specified for callable\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Events/Events.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Events\\\\Events\\:\\:removeAllListeners\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Events/Events.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Events\\\\Events\\:\\:removeListener\\(\\) has parameter \\$listener with no signature specified for callable\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Events/Events.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Events\\\\Events\\:\\:setFiles\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Events/Events.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Events\\\\Events\\:\\:simulate\\(\\) has no return type specified\\.$#',
'count' => 1,
'path' => __DIR__ . '/system/Events/Events.php',
];
$ignoreErrors[] = [
'message' => '#^Method CodeIgniter\\\\Exceptions\\\\CastException\\:\\:forInvalidJsonFormatException\\(\\) has no return type specified\\.$#',
'count' => 1,
Expand Down
10 changes: 10 additions & 0 deletions system/Events/Events.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,8 @@ class Events

/**
* Ensures that we have a events file ready.
*
* @return void
*/
public static function initialize()
{
Expand Down Expand Up @@ -108,6 +110,8 @@ public static function initialize()
* @param string $eventName
* @param callable $callback
* @param int $priority
*
* @return void
*/
public static function on($eventName, $callback, $priority = self::PRIORITY_NORMAL)
{
Expand Down Expand Up @@ -222,6 +226,8 @@ public static function removeListener($eventName, callable $listener): bool
* removed, otherwise all listeners for all events are removed.
*
* @param string|null $eventName
*
* @return void
*/
public static function removeAllListeners($eventName = null)
{
Expand All @@ -234,6 +240,8 @@ public static function removeAllListeners($eventName = null)

/**
* Sets the path to the file that routes are read from.
*
* @return void
*/
public static function setFiles(array $files)
{
Expand All @@ -254,6 +262,8 @@ public static function getFiles()
* Turns simulation on or off. When on, events will not be triggered,
* simply logged. Useful during testing when you don't actually want
* the tests to run.
*
* @return void
*/
public static function simulate(bool $choice = true)
{
Expand Down

0 comments on commit 89d249a

Please sign in to comment.