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 type declaration in hooks #317

Merged
merged 3 commits into from
Dec 8, 2021
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
6 changes: 3 additions & 3 deletions src/Event/Hook/AfterAnalysisHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

namespace Churn\Event\Hook;

use Churn\Event\Event\AfterAnalysisEvent;
use Churn\Event\Event\AfterAnalysis;

interface AfterAnalysisHook
{

/**
* @param AfterAnalysisEvent $event The event triggered when the analysis is done.
* @param AfterAnalysis $event The event triggered when the analysis is done.
*/
public static function afterAnalysis(AfterAnalysisEvent $event): void;
public static function afterAnalysis(AfterAnalysis $event): void;
}
6 changes: 3 additions & 3 deletions src/Event/Hook/AfterFileAnalysisHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

namespace Churn\Event\Hook;

use Churn\Event\Event\AfterFileAnalysisEvent;
use Churn\Event\Event\AfterFileAnalysis;

interface AfterFileAnalysisHook
{

/**
* @param AfterFileAnalysisEvent $event The event triggered when the analysis of a file is done.
* @param AfterFileAnalysis $event The event triggered when the analysis of a file is done.
*/
public static function afterFileAnalysis(AfterFileAnalysisEvent $event): void;
public static function afterFileAnalysis(AfterFileAnalysis $event): void;
}
6 changes: 3 additions & 3 deletions src/Event/Hook/BeforeAnalysisHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,13 @@

namespace Churn\Event\Hook;

use Churn\Event\Event\BeforeAnalysisEvent;
use Churn\Event\Event\BeforeAnalysis;

interface BeforeAnalysisHook
{

/**
* @param BeforeAnalysisEvent $event The event triggered when the analysis starts.
* @param BeforeAnalysis $event The event triggered when the analysis starts.
*/
public static function beforeAnalysis(BeforeAnalysisEvent $event): void;
public static function beforeAnalysis(BeforeAnalysis $event): void;
}
12 changes: 6 additions & 6 deletions tests/Integration/Command/Assets/PrintHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@

namespace Churn\Tests\Integration\Command\Assets;

use Churn\Event\Event\AfterAnalysisEvent;
use Churn\Event\Event\BeforeAnalysisEvent;
use Churn\Event\Event\AfterAnalysis;
use Churn\Event\Event\BeforeAnalysis;
use Churn\Event\Hook\AfterAnalysisHook;
use Churn\Event\Hook\BeforeAnalysisHook;

class PrintHook implements AfterAnalysisHook, BeforeAnalysisHook
{

/**
* @param AfterAnalysisEvent $event The event triggered when the analysis is done.
* @param AfterAnalysis $event The event triggered when the analysis is done.
*/
public static function afterAnalysis(AfterAnalysisEvent $event): void
public static function afterAnalysis(AfterAnalysis $event): void
{
echo "DONE";
}

/**
* @param BeforeAnalysisEvent $event The event triggered when the analysis starts.
* @param BeforeAnalysis $event The event triggered when the analysis starts.
*/
public static function beforeAnalysis(BeforeAnalysisEvent $event): void
public static function beforeAnalysis(BeforeAnalysis $event): void
{
echo "Churn: ";
}
Expand Down
18 changes: 9 additions & 9 deletions tests/Integration/Command/Assets/TestHook.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace Churn\Tests\Integration\Command\Assets;

use Churn\Event\Event\AfterAnalysisEvent;
use Churn\Event\Event\AfterFileAnalysisEvent;
use Churn\Event\Event\BeforeAnalysisEvent;
use Churn\Event\Event\AfterAnalysis;
use Churn\Event\Event\AfterFileAnalysis;
use Churn\Event\Event\BeforeAnalysis;
use Churn\Event\Hook\AfterAnalysisHook;
use Churn\Event\Hook\AfterFileAnalysisHook;
use Churn\Event\Hook\BeforeAnalysisHook;
Expand All @@ -26,25 +26,25 @@ public static function reset(): void
}

/**
* @param AfterAnalysisEvent $event The event triggered when the analysis is done.
* @param AfterAnalysis $event The event triggered when the analysis is done.
*/
public static function afterAnalysis(AfterAnalysisEvent $event): void
public static function afterAnalysis(AfterAnalysis $event): void
{
self::$nbAfterAnalysisEvent++;
}

/**
* @param AfterFileAnalysisEvent $event The event triggered when the analysis of a file is done.
* @param AfterFileAnalysis $event The event triggered when the analysis of a file is done.
*/
public static function afterFileAnalysis(AfterFileAnalysisEvent $event): void
public static function afterFileAnalysis(AfterFileAnalysis $event): void
{
self::$nbAfterFileAnalysisEvent++;
}

/**
* @param BeforeAnalysisEvent $event The event triggered when the analysis starts.
* @param BeforeAnalysis $event The event triggered when the analysis starts.
*/
public static function beforeAnalysis(BeforeAnalysisEvent $event): void
public static function beforeAnalysis(BeforeAnalysis $event): void
{
self::$nbBeforeAnalysisEvent++;
}
Expand Down
18 changes: 9 additions & 9 deletions tests/Integration/Command/Assets/hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@

namespace Churn\Tests\Integration\Command\Assets;

use Churn\Event\Event\AfterAnalysisEvent;
use Churn\Event\Event\AfterFileAnalysisEvent;
use Churn\Event\Event\BeforeAnalysisEvent;
use Churn\Event\Event\AfterAnalysis;
use Churn\Event\Event\AfterFileAnalysis;
use Churn\Event\Event\BeforeAnalysis;
use Churn\Event\Hook\AfterAnalysisHook;
use Churn\Event\Hook\AfterFileAnalysisHook;
use Churn\Event\Hook\BeforeAnalysisHook;
Expand All @@ -16,9 +16,9 @@ class TestAfterAnalysisHook implements AfterAnalysisHook
public static $nbAfterAnalysisEvent = 0;

/**
* @param AfterAnalysisEvent $event The event triggered when the analysis is done.
* @param AfterAnalysis $event The event triggered when the analysis is done.
*/
public static function afterAnalysis(AfterAnalysisEvent $event): void
public static function afterAnalysis(AfterAnalysis $event): void
{
self::$nbAfterAnalysisEvent++;
}
Expand All @@ -29,9 +29,9 @@ class TestAfterFileAnalysisHook implements AfterFileAnalysisHook
public static $nbAfterFileAnalysisEvent = 0;

/**
* @param AfterFileAnalysisEvent $event The event triggered when the analysis of a file is done.
* @param AfterFileAnalysis $event The event triggered when the analysis of a file is done.
*/
public static function afterFileAnalysis(AfterFileAnalysisEvent $event): void
public static function afterFileAnalysis(AfterFileAnalysis $event): void
{
self::$nbAfterFileAnalysisEvent++;
}
Expand All @@ -42,9 +42,9 @@ class TestBeforeAnalysisHook implements BeforeAnalysisHook
public static $nbBeforeAnalysisEvent = 0;

/**
* @param BeforeAnalysisEvent $event The event triggered when the analysis starts.
* @param BeforeAnalysis $event The event triggered when the analysis starts.
*/
public static function beforeAnalysis(BeforeAnalysisEvent $event): void
public static function beforeAnalysis(BeforeAnalysis $event): void
{
self::$nbBeforeAnalysisEvent++;
}
Expand Down