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

Dev: remove the event ignore errors in phpstan-baseline.php #7766

Merged
merged 1 commit into from
Aug 3, 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
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