Skip to content

Commit

Permalink
Moved step validation to the separate package.
Browse files Browse the repository at this point in the history
  • Loading branch information
lexalium committed Mar 3, 2022
1 parent 47e7534 commit 081c562
Show file tree
Hide file tree
Showing 11 changed files with 0 additions and 363 deletions.
1 change: 0 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
},
"suggest": {
"illuminate/events": "Required to use Laravel Dispatcher as form Event Dispatcher (^8.0).",
"illuminate/validation": "Required to use step data validation on Before Handle Step event (^8.0).",
"illuminate/view": "Required to render Laravel views (^8.0).",
"illuminate/session": "Required to use Laravel Session as Stepped Form storage (^8.0).",
"illuminate/config": "Required to use Laravel config (^8.0)."
Expand Down
48 changes: 0 additions & 48 deletions src/Entity/RulesDefinition.php

This file was deleted.

31 changes: 0 additions & 31 deletions src/Event/Listener/BeforeHandleStepListener.php

This file was deleted.

22 changes: 0 additions & 22 deletions src/ServiceProvider/ServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,27 +7,22 @@
use Illuminate\Contracts\Config\Repository;
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Contracts\Validation\Factory as ValidationFactory;
use Illuminate\Contracts\View\Factory as ViewFactory;
use Illuminate\Support\ServiceProvider as LaravelServiceProvider;
use Lexal\HttpSteppedForm\ExceptionNormalizer\ExceptionNormalizer;
use Lexal\HttpSteppedForm\ExceptionNormalizer\ExceptionNormalizerInterface;
use Lexal\HttpSteppedForm\Renderer\RendererInterface;
use Lexal\HttpSteppedForm\Routing\RedirectorInterface;
use Lexal\LaravelSteppedForm\Event\Dispatcher\EventDispatcher;
use Lexal\LaravelSteppedForm\Event\Listener\BeforeHandleStepListener;
use Lexal\LaravelSteppedForm\Renderer\Renderer;
use Lexal\LaravelSteppedForm\Routing\Redirector;
use Lexal\LaravelSteppedForm\Validator\Validator;
use Lexal\LaravelSteppedForm\Validator\ValidatorInterface;
use Lexal\SteppedForm\Data\FormDataStorage;
use Lexal\SteppedForm\Data\FormDataStorageInterface;
use Lexal\SteppedForm\Data\StepControl;
use Lexal\SteppedForm\Data\StepControlInterface;
use Lexal\SteppedForm\Data\Storage\StorageInterface;
use Lexal\SteppedForm\EntityCopy\EntityCopyInterface;
use Lexal\SteppedForm\EntityCopy\SimpleEntityCopy;
use Lexal\SteppedForm\EventDispatcher\Event\BeforeHandleStep;
use Lexal\SteppedForm\EventDispatcher\EventDispatcherInterface;
use Lexal\SteppedForm\State\FormState;
use Lexal\SteppedForm\State\FormStateInterface;
Expand All @@ -46,10 +41,6 @@ class ServiceProvider extends LaravelServiceProvider
{
private const CONFIG_FILENAME = 'stepped-form.php';

/**
* @throws ContainerExceptionInterface
* @throws NotFoundExceptionInterface
*/
public function boot(): void
{
$path = dirname(__DIR__, 2) . DIRECTORY_SEPARATOR . 'config' . DIRECTORY_SEPARATOR . self::CONFIG_FILENAME;
Expand All @@ -59,13 +50,6 @@ public function boot(): void
]);

$this->mergeConfigFrom($path, 'stepped-form');

if ($this->app->bound(Dispatcher::class) && $this->app->bound(ValidationFactory::class)) {
/** @var Dispatcher $dispatcher */
$dispatcher = $this->app->get(Dispatcher::class);

$dispatcher->listen(BeforeHandleStep::class, [BeforeHandleStepListener::class, 'handle']);
}
}

public function register(): void
Expand All @@ -86,7 +70,6 @@ public function register(): void
$this->registerFormState();
$this->registerStepsBuilder();
$this->registerEventDispatcher();
$this->registerValidator();
$this->registerEntityCopy();
}

Expand Down Expand Up @@ -141,11 +124,6 @@ private function registerEventDispatcher(): void
}
}

private function registerValidator(): void
{
$this->app->singleton(ValidatorInterface::class, Validator::class);
}

private function registerEntityCopy(): void
{
$this->app->singleton(EntityCopyInterface::class, SimpleEntityCopy::class);
Expand Down
15 changes: 0 additions & 15 deletions src/Steps/ValidateStepInterface.php

This file was deleted.

11 changes: 0 additions & 11 deletions src/Validator/Exception/ValidatorException.php

This file was deleted.

30 changes: 0 additions & 30 deletions src/Validator/Validator.php

This file was deleted.

20 changes: 0 additions & 20 deletions src/Validator/ValidatorInterface.php

This file was deleted.

101 changes: 0 additions & 101 deletions tests/Event/Listener/BeforeHandleStepListenerTest.php

This file was deleted.

12 changes: 0 additions & 12 deletions tests/Event/Listener/ValidatableStepInterface.php

This file was deleted.

Loading

0 comments on commit 081c562

Please sign in to comment.