mirror of
https://github.com/danog/psalm-plugin-laravel.git
synced 2024-11-30 04:39:01 +01:00
refactor: extract registerHandlers to method
This commit is contained in:
parent
bd55a5aec3
commit
9d96f541e3
@ -42,31 +42,7 @@ class Plugin implements PluginEntryPointInterface
|
||||
return;
|
||||
}
|
||||
|
||||
require_once 'ReturnTypeProvider/AuthReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(ReturnTypeProvider\AuthReturnTypeProvider::class);
|
||||
require_once 'ReturnTypeProvider/TransReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(ReturnTypeProvider\TransReturnTypeProvider::class);
|
||||
require_once 'ReturnTypeProvider/RedirectReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(ReturnTypeProvider\RedirectReturnTypeProvider::class);
|
||||
require_once 'ReturnTypeProvider/ViewReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(ReturnTypeProvider\ViewReturnTypeProvider::class);
|
||||
require_once 'ReturnTypeProvider/AppReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(ReturnTypeProvider\AppReturnTypeProvider::class);
|
||||
require_once 'Handlers/Application/ContainerHandler.php';
|
||||
$registration->registerHooksFromClass(ContainerHandler::class);
|
||||
require_once 'Handlers/Application/OffsetHandler.php';
|
||||
$registration->registerHooksFromClass(OffsetHandler::class);
|
||||
require_once 'PropertyProvider/ModelPropertyProvider.php';
|
||||
$registration->registerHooksFromClass(PropertyProvider\ModelPropertyProvider::class);
|
||||
require_once 'ReturnTypeProvider/UrlReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(UrlReturnTypeProvider::class);
|
||||
require_once 'ReturnTypeProvider/ModelReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(ModelReturnTypeProvider::class);
|
||||
require_once 'ReturnTypeProvider/RelationReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(RelationReturnTypeProvider::class);
|
||||
require_once 'ReturnTypeProvider/PathHelpersReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(PathHelpersReturnTypeProvider::class);
|
||||
|
||||
$this->registerHandlers($registration);
|
||||
$this->addOurStubs($registration);
|
||||
}
|
||||
|
||||
@ -222,4 +198,35 @@ class Plugin implements PluginEntryPointInterface
|
||||
$registration->addStubFile($stubFilePath);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \Psalm\Plugin\RegistrationInterface $registration
|
||||
*/
|
||||
private function registerHandlers(RegistrationInterface $registration): void
|
||||
{
|
||||
require_once 'ReturnTypeProvider/AuthReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(ReturnTypeProvider\AuthReturnTypeProvider::class);
|
||||
require_once 'ReturnTypeProvider/TransReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(ReturnTypeProvider\TransReturnTypeProvider::class);
|
||||
require_once 'ReturnTypeProvider/RedirectReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(ReturnTypeProvider\RedirectReturnTypeProvider::class);
|
||||
require_once 'ReturnTypeProvider/ViewReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(ReturnTypeProvider\ViewReturnTypeProvider::class);
|
||||
require_once 'ReturnTypeProvider/AppReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(ReturnTypeProvider\AppReturnTypeProvider::class);
|
||||
require_once 'Handlers/Application/ContainerHandler.php';
|
||||
$registration->registerHooksFromClass(ContainerHandler::class);
|
||||
require_once 'Handlers/Application/OffsetHandler.php';
|
||||
$registration->registerHooksFromClass(OffsetHandler::class);
|
||||
require_once 'PropertyProvider/ModelPropertyProvider.php';
|
||||
$registration->registerHooksFromClass(PropertyProvider\ModelPropertyProvider::class);
|
||||
require_once 'ReturnTypeProvider/UrlReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(UrlReturnTypeProvider::class);
|
||||
require_once 'ReturnTypeProvider/ModelReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(ModelReturnTypeProvider::class);
|
||||
require_once 'ReturnTypeProvider/RelationReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(RelationReturnTypeProvider::class);
|
||||
require_once 'ReturnTypeProvider/PathHelpersReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(PathHelpersReturnTypeProvider::class);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user