Skip to content

Commit

Permalink
Modals require ModalsHandler interface
Browse files Browse the repository at this point in the history
  • Loading branch information
juniwalk committed May 21, 2024
1 parent 0a6a012 commit 82b0474
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/Interfaces/ModalHandler.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?php declare(strict_types=1);

/**
* @copyright Martin Procházka (c) 2024
* @license MIT License
*/

namespace JuniWalk\Utils\Interfaces;

use JuniWalk\Utils\Interfaces\Modal;

interface ModalHandler
{
/**
* @param array<string, mixed> $params
*/
public function openModal(Modal|string $modal, array $params = []): void;
}
5 changes: 5 additions & 0 deletions src/Traits/Modals.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,16 @@

use JuniWalk\Utils\Interfaces\EventHandler;
use JuniWalk\Utils\Interfaces\Modal;
use JuniWalk\Utils\Interfaces\ModalHandler;
use Nette\InvalidArgumentException;

/**
* @phpstan-require-implements ModalHandler
*/
trait Modals
{
/**
* @param array<string, mixed> $params
* @throws InvalidArgumentException
*/
public function openModal(Modal|string $modal, array $params = []): void
Expand Down

0 comments on commit 82b0474

Please sign in to comment.