mirror of
https://github.com/danog/psalm-plugin-laravel.git
synced 2025-01-22 21:31:21 +01:00
refactor: move relation method handler to handlers namespace
This commit is contained in:
parent
d0c27d8a0c
commit
e736c88a0d
@ -1,6 +1,6 @@
|
||||
<?php declare(strict_types=1);
|
||||
|
||||
namespace Psalm\LaravelPlugin\ReturnTypeProvider;
|
||||
namespace Psalm\LaravelPlugin\Handlers\Eloquent;
|
||||
|
||||
use Illuminate\Database\Eloquent\Builder;
|
||||
use Illuminate\Database\Eloquent\Relations\BelongsTo;
|
||||
@ -22,7 +22,7 @@ use Psalm\Type;
|
||||
use Psalm\Type\Union;
|
||||
use function in_array;
|
||||
|
||||
final class RelationReturnTypeProvider implements MethodReturnTypeProviderInterface
|
||||
final class RelationsMethodHandler implements MethodReturnTypeProviderInterface
|
||||
{
|
||||
/**
|
||||
* @return array<string>
|
@ -4,6 +4,7 @@ namespace Psalm\LaravelPlugin;
|
||||
use Psalm\LaravelPlugin\Handlers\Application\ContainerHandler;
|
||||
use Psalm\LaravelPlugin\Handlers\Application\OffsetHandler;
|
||||
use Psalm\LaravelPlugin\Handlers\Eloquent\ModelPropertyHandler;
|
||||
use Psalm\LaravelPlugin\Handlers\Eloquent\RelationsMethodHandler;
|
||||
use Psalm\LaravelPlugin\Handlers\Helpers\PathHandler;
|
||||
use Psalm\LaravelPlugin\Handlers\Helpers\RedirectHandler;
|
||||
use Psalm\LaravelPlugin\Handlers\Helpers\TransHandler;
|
||||
@ -59,6 +60,8 @@ class Plugin implements PluginEntryPointInterface
|
||||
$registration->registerHooksFromClass(OffsetHandler::class);
|
||||
require_once 'Handlers/Eloquent/ModelPropertyHandler.php';
|
||||
$registration->registerHooksFromClass(ModelPropertyHandler::class);
|
||||
require_once 'Handlers/Eloquent/RelationsMethodHandler.php';
|
||||
$registration->registerHooksFromClass(RelationsMethodHandler::class);
|
||||
require_once 'Handlers/Helpers/ViewHandler.php';
|
||||
$registration->registerHooksFromClass(ViewHandler::class);
|
||||
require_once 'Handlers/Helpers/PathHandler.php';
|
||||
@ -73,8 +76,6 @@ class Plugin implements PluginEntryPointInterface
|
||||
// @todo: migrate these to `Handlers` namespace
|
||||
require_once 'ReturnTypeProvider/ModelReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(ModelReturnTypeProvider::class);
|
||||
require_once 'ReturnTypeProvider/RelationReturnTypeProvider.php';
|
||||
$registration->registerHooksFromClass(RelationReturnTypeProvider::class);
|
||||
}
|
||||
|
||||
private function generateStubFiles(): void
|
||||
|
Loading…
x
Reference in New Issue
Block a user