ci: fix phpstan errors

This commit is contained in:
Younes ENNAJI
2024-09-19 07:30:11 +01:00
parent 61bd5f7a96
commit e44c1d675e
9 changed files with 43 additions and 63 deletions
+1
View File
@@ -2,6 +2,7 @@
## [Unreleased](https://github.com/php-flasher/php-flasher/compare/v2.0.1...2.x)
* feature [Flasher] add escapeHtml option for secure HTML escaping in notifications. See [PR #196](https://github.com/php-flasher/php-flasher/pull/196) by [yoeunes](https://github.com/yoeunes)
* feature [Flasher] add Default configuration options. See [PR #183](https://github.com/php-flasher/php-flasher/pull/183) by [AhmedGamal](https://github.com/AhmedGamal)
* feature [Laravel] Refactor middleware to use Symfony's base response class, addressing compatibility issues. See [PR #184](https://github.com/php-flasher/php-flasher/pull/184) by [yoeunes](https://github.com/yoeunes)
+10 -15
View File
@@ -13,37 +13,32 @@ use Illuminate\Support\Facades\Facade;
* @method static NotificationBuilder title(string $message)
* @method static NotificationBuilder message(string $message)
* @method static NotificationBuilder type(string $message)
* @method static NotificationBuilder options(array $options, bool $merge = true)
* @method static NotificationBuilder options(array<string, mixed> $options, bool $merge = true)
* @method static NotificationBuilder option(string $name, $value)
* @method static NotificationBuilder priority(int $priority)
* @method static NotificationBuilder hops(int $amount)
* @method static NotificationBuilder keep()
* @method static NotificationBuilder delay(int $delay)
* @method static NotificationBuilder translate(array $parameters = [], ?string $locale = null)
* @method static NotificationBuilder translate(array<string, mixed> $parameters = [], ?string $locale = null)
* @method static NotificationBuilder handler(string $handler)
* @method static NotificationBuilder context(array $context)
* @method static NotificationBuilder context(array<string, mixed> $context)
* @method static NotificationBuilder when(bool|\Closure $condition)
* @method static NotificationBuilder unless(bool|\Closure $condition)
* @method static NotificationBuilder with(StampInterface[] $stamps = array())
* @method static NotificationBuilder withStamp(StampInterface $stamp)
* @method static Envelope success(string $message, array $options = [], ?string $title = null)
* @method static Envelope error(string $message, array $options = [], ?string $title = null)
* @method static Envelope info(string $message, array $options = [], ?string $title = null)
* @method static Envelope warning(string $message, array $options = [], ?string $title = null)
* @method static Envelope flash(?string $type = null, ?string $message = null, array $options = [], ?string $title = null)
* @method static Envelope preset(string $preset, array $parameters = [])
* @method static Envelope success(string $message, array<string, mixed> $options = [], ?string $title = null)
* @method static Envelope error(string $message, array<string, mixed> $options = [], ?string $title = null)
* @method static Envelope info(string $message, array<string, mixed> $options = [], ?string $title = null)
* @method static Envelope warning(string $message, array<string, mixed> $options = [], ?string $title = null)
* @method static Envelope flash(?string $type = null, ?string $message = null, array<string, mixed> $options = [], ?string $title = null)
* @method static Envelope preset(string $preset, array<string, mixed> $parameters = [])
* @method static Envelope operation(string $operation, string|object|null $resource = null)
* @method static Envelope created(string|object|null $resource = null)
* @method static Envelope updated(string|object|null $resource = null)
* @method static Envelope saved(string|object|null $resource = null)
* @method static Envelope deleted(string|object|null $resource = null)
* @method static Envelope push()
* @method static Envelope addSuccess(string $message, array $options = [], ?string $title = null)
* @method static Envelope addError(string $message, array $options = [], ?string $title = null)
* @method static Envelope addInfo(string $message, array $options = [], ?string $title = null)
* @method static Envelope addWarning(string $message, array $options = [], ?string $title = null)
* @method static Envelope addFlash(?string $type = null, ?string $message = null, array $options = [], ?string $title = null)
* @method static Envelope addPreset(string $preset, array $parameters = [])
* @method static Envelope addPreset(string $preset, array<string, mixed> $parameters = [])
* @method static Envelope addCreated(string|object|null $resource = null)
* @method static Envelope addUpdated(string|object|null $resource = null)
* @method static Envelope addDeleted(string|object|null $resource = null)
+8 -15
View File
@@ -6,25 +6,18 @@ namespace Flasher\Noty\Laravel\Facade;
use Flasher\Noty\Prime\NotyBuilder;
use Flasher\Prime\Notification\Envelope;
use Flasher\Prime\Notification\NotificationInterface;
use Flasher\Prime\Stamp\StampInterface;
use Illuminate\Support\Facades\Facade;
/**
* @method static NotyBuilder addSuccess(string $message, array $options = array())
* @method static NotyBuilder addError(string $message, array $options = array())
* @method static NotyBuilder addWarning(string $message, array $options = array())
* @method static NotyBuilder addInfo(string $message, array $options = array())
* @method static NotyBuilder addFlash(NotificationInterface|string $type, string $message = null, array $options = array())
* @method static NotyBuilder success(string $message, array<string, mixed> $options = array())
* @method static NotyBuilder error(string $message, array<string, mixed> $options = array())
* @method static NotyBuilder warning(string $message, array<string, mixed> $options = array())
* @method static NotyBuilder info(string $message, array<string, mixed> $options = array())
* @method static NotyBuilder flash(StampInterface[] $stamps = array())
* @method static NotyBuilder type(string $type, string $message = null, array $options = array())
* @method static NotyBuilder message(string $message)
* @method static NotyBuilder options(array $options, bool $merge = true)
* @method static NotyBuilder options(array<string, mixed> $options, bool $merge = true)
* @method static NotyBuilder option(string $name, string $value)
* @method static NotyBuilder success(string $message = null, array $options = array())
* @method static NotyBuilder error(string $message = null, array $options = array())
* @method static NotyBuilder info(string $message = null, array $options = array())
* @method static NotyBuilder warning(string $message = null, array $options = array())
* @method static NotyBuilder priority(int $priority)
* @method static NotyBuilder hops(int $amount)
* @method static NotyBuilder keep()
@@ -35,12 +28,12 @@ use Illuminate\Support\Facades\Facade;
* @method static NotyBuilder handler(string $handler)
* @method static Envelope getEnvelope()
* @method static NotyBuilder text(string $text)
* @method static NotyBuilder alert(string $message = null, array $options = array())
* @method static NotyBuilder alert(string $message = null, array<string, mixed> $options = array())
* @method static NotyBuilder layout(string $layout)
* @method static NotyBuilder theme(string $theme)
* @method static NotyBuilder timeout(bool|int $timeout)
* @method static NotyBuilder progressBar(bool $progressBar = false)
* @method static NotyBuilder closeWith(array|string $closeWith)
* @method static NotyBuilder closeWith(string|string[] $closeWith)
* @method static NotyBuilder animation(string $animation, string $effect)
* @method static NotyBuilder sounds(string $option, mixed $value)
* @method static NotyBuilder docTitle(string $option, mixed $docTitle)
@@ -50,7 +43,7 @@ use Illuminate\Support\Facades\Facade;
* @method static NotyBuilder queue(string $queue)
* @method static NotyBuilder killer(bool|string $killer)
* @method static NotyBuilder container(bool|string $container)
* @method static NotyBuilder buttons(array $buttons)
* @method static NotyBuilder buttons(string[] $buttons)
* @method static NotyBuilder visibilityControl(bool $visibilityControl)
*/
final class Noty extends Facade
+5 -12
View File
@@ -6,25 +6,18 @@ namespace Flasher\Notyf\Laravel\Facade;
use Flasher\Notyf\Prime\NotyfBuilder;
use Flasher\Prime\Notification\Envelope;
use Flasher\Prime\Notification\NotificationInterface;
use Flasher\Prime\Stamp\StampInterface;
use Illuminate\Support\Facades\Facade;
/**
* @method static NotyfBuilder addSuccess(string $message, array $options = array())
* @method static NotyfBuilder addError(string $message, array $options = array())
* @method static NotyfBuilder addWarning(string $message, array $options = array())
* @method static NotyfBuilder addInfo(string $message, array $options = array())
* @method static NotyfBuilder addFlash(NotificationInterface|string $type, string $message = null, array $options = array())
* @method static NotyfBuilder success(string $message, array<string, mixed> $options = array())
* @method static NotyfBuilder error(string $message, array<string, mixed> $options = array())
* @method static NotyfBuilder warning(string $message, array<string, mixed> $options = array())
* @method static NotyfBuilder info(string $message, array<string, mixed> $options = array())
* @method static NotyfBuilder flash(StampInterface[] $stamps = array())
* @method static NotyfBuilder type(string $type, string $message = null, array $options = array())
* @method static NotyfBuilder message(string $message)
* @method static NotyfBuilder options(array $options, bool $merge = true)
* @method static NotyfBuilder options(array<string, mixed> $options, bool $merge = true)
* @method static NotyfBuilder option(string $name, string $value)
* @method static NotyfBuilder success(string $message = null, array $options = array())
* @method static NotyfBuilder error(string $message = null, array $options = array())
* @method static NotyfBuilder info(string $message = null, array $options = array())
* @method static NotyfBuilder warning(string $message = null, array $options = array())
* @method static NotyfBuilder priority(int $priority)
* @method static NotyfBuilder hops(int $amount)
* @method static NotyfBuilder keep()
+5 -1
View File
@@ -100,7 +100,11 @@ final class FlasherPlugin extends Plugin
* scripts: string[],
* styles: string[],
* options: array<string, mixed>,
* plugins?: array<string, array<string, mixed>>,
* plugins?: array<string, array{
* scripts?: string[],
* styles?: string[],
* options?: array<string, mixed>,
* }>,
* } $config
*
* @return array{
@@ -21,6 +21,7 @@ final class HtmlPresenter implements PresenterInterface
/** @var array{csp_script_nonce?: ?string, envelopes_only?: bool} $context */
$context = $response->getContext();
/** @var array{envelopes: array<int, array{metadata: array{html?: string}}>} $options */
$options = $response->toArray();
$html = '';
+6 -13
View File
@@ -5,26 +5,19 @@ declare(strict_types=1);
namespace Flasher\SweetAlert\Laravel\Facade;
use Flasher\Prime\Notification\Envelope;
use Flasher\Prime\Notification\NotificationInterface;
use Flasher\Prime\Stamp\StampInterface;
use Flasher\SweetAlert\Prime\SweetAlertBuilder;
use Illuminate\Support\Facades\Facade;
/**
* @method static SweetAlertBuilder addSuccess(string $message, array $options = array())
* @method static SweetAlertBuilder addError(string $message, array $options = array())
* @method static SweetAlertBuilder addWarning(string $message, array $options = array())
* @method static SweetAlertBuilder addInfo(string $message, array $options = array())
* @method static SweetAlertBuilder addFlash(NotificationInterface|string $type, string $message = null, array $options = array())
* @method static SweetAlertBuilder success(string $message, array<string, mixed> $options = array())
* @method static SweetAlertBuilder error(string $message, array<string, mixed> $options = array())
* @method static SweetAlertBuilder warning(string $message, array<string, mixed> $options = array())
* @method static SweetAlertBuilder info(string $message, array<string, mixed> $options = array())
* @method static SweetAlertBuilder flash(StampInterface[] $stamps = array())
* @method static SweetAlertBuilder type(string $type, string $message = null, array $options = array())
* @method static SweetAlertBuilder message(string $message)
* @method static SweetAlertBuilder options(array $options, bool $merge = true)
* @method static SweetAlertBuilder options(array<string, mixed> $options, bool $merge = true)
* @method static SweetAlertBuilder option(string $name, string $value)
* @method static SweetAlertBuilder success(string $message = null, array $options = array())
* @method static SweetAlertBuilder error(string $message = null, array $options = array())
* @method static SweetAlertBuilder info(string $message = null, array $options = array())
* @method static SweetAlertBuilder warning(string $message = null, array $options = array())
* @method static SweetAlertBuilder priority(int $priority)
* @method static SweetAlertBuilder hops(int $amount)
* @method static SweetAlertBuilder keep()
@@ -34,7 +27,7 @@ use Illuminate\Support\Facades\Facade;
* @method static SweetAlertBuilder withStamp(StampInterface $stamp)
* @method static SweetAlertBuilder handler(string $handler)
* @method static Envelope getEnvelope()
* @method static SweetAlertBuilder question(string $message = null, array $options = array())
* @method static SweetAlertBuilder question(string $message = null, array<string, mixed> $options = array())
* @method static SweetAlertBuilder title(string $title)
* @method static SweetAlertBuilder titleText(string $titleText)
* @method static SweetAlertBuilder html(string $html)
+6 -6
View File
@@ -11,14 +11,14 @@ use Illuminate\Support\Facades\Facade;
/**
* @method static ToastrBuilder flash(StampInterface[] $stamps = array())
* @method static ToastrBuilder type(string $type, string $message = null, array $options = array())
* @method static ToastrBuilder type(string $type, string $message = null, array<string, mixed> $options = array())
* @method static ToastrBuilder message(string $message)
* @method static ToastrBuilder options(array $options, bool $merge = true)
* @method static ToastrBuilder options(array<string, mixed> $options, bool $merge = true)
* @method static ToastrBuilder option(string $name, $value)
* @method static ToastrBuilder success(string $message = null, array $options = array())
* @method static ToastrBuilder error(string $message = null, array $options = array())
* @method static ToastrBuilder info(string $message = null, array $options = array())
* @method static ToastrBuilder warning(string $message = null, array $options = array())
* @method static ToastrBuilder success(string $message = null, array<string, mixed> $options = array())
* @method static ToastrBuilder error(string $message = null, array<string, mixed> $options = array())
* @method static ToastrBuilder info(string $message = null, array<string, mixed> $options = array())
* @method static ToastrBuilder warning(string $message = null, array<string, mixed> $options = array())
* @method static ToastrBuilder priority(int $priority)
* @method static ToastrBuilder hops(int $amount)
* @method static ToastrBuilder keep()
+1 -1
View File
@@ -29,7 +29,7 @@ tasks:
lint:
desc: "🔍 Run various linting tools to ensure code quality."
cmds:
- vendor/bin/php-cs-fixer fix --dry-run
- vendor/bin/php-cs-fixer fix
- vendor/bin/phpstan analyse --memory-limit=-1
- composer validate --strict
- vendor/bin/phplint