mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
Simplify verbose PHPDoc class descriptions across 76 files
Remove descriptive class/interface-level documentation that duplicates what the class/interface names already convey, while keeping all type annotations (@param, @return, @var, @throws, @phpstan-, @mixin, @template, @internal). Files modified: - Symfony integration (18 files): Attribute, Translation, Template, Component, Storage, Support, Http, Profiler, Command, Twig, EventListener, FlasherSymfonyBundle - Laravel integration (13 files): ServiceProvider, Storage, Middleware, Http, Facade, Template, Translation, Command, Component, EventListener - Prime/EventDispatcher (17 files): Events and EventListeners - Prime/Storage (11 files): Filter/Criteria and Bag interfaces - Prime/Stamp (4 files): Interface and stamp classes - Prime/Factory (5 files): Factory interfaces and implementations - Prime/Notification (2 files): Envelope and Notification - Prime/Support/Traits (1 file): ForwardsCalls
This commit is contained in:
@@ -15,9 +15,6 @@ use Symfony\Component\Console\Input\InputOption;
|
|||||||
use Symfony\Component\Console\Output\OutputInterface;
|
use Symfony\Component\Console\Output\OutputInterface;
|
||||||
use Symfony\Component\Finder\Finder;
|
use Symfony\Component\Finder\Finder;
|
||||||
|
|
||||||
/**
|
|
||||||
* Artisan command for installing PHPFlasher resources.
|
|
||||||
*/
|
|
||||||
final class InstallCommand extends Command
|
final class InstallCommand extends Command
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ namespace Flasher\Laravel\Component;
|
|||||||
|
|
||||||
use Illuminate\View\Component;
|
use Illuminate\View\Component;
|
||||||
|
|
||||||
/**
|
|
||||||
* Blade component for rendering PHPFlasher notifications.
|
|
||||||
*/
|
|
||||||
final class FlasherComponent extends Component
|
final class FlasherComponent extends Component
|
||||||
{
|
{
|
||||||
public function __construct(public string $criteria = '', public string $context = '')
|
public function __construct(public string $criteria = '', public string $context = '')
|
||||||
|
|||||||
@@ -13,9 +13,6 @@ use Livewire\Component;
|
|||||||
use Livewire\LivewireManager;
|
use Livewire\LivewireManager;
|
||||||
use Livewire\Mechanisms\HandleComponents\ComponentContext;
|
use Livewire\Mechanisms\HandleComponents\ComponentContext;
|
||||||
|
|
||||||
/**
|
|
||||||
* Integrates PHPFlasher with Livewire component lifecycle.
|
|
||||||
*/
|
|
||||||
final readonly class LivewireListener
|
final readonly class LivewireListener
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ namespace Flasher\Laravel\EventListener;
|
|||||||
use Flasher\Prime\EventDispatcher\EventListener\NotificationLoggerListener;
|
use Flasher\Prime\EventDispatcher\EventListener\NotificationLoggerListener;
|
||||||
use Laravel\Octane\Events\RequestReceived;
|
use Laravel\Octane\Events\RequestReceived;
|
||||||
|
|
||||||
/**
|
|
||||||
* Resets notification logger between Octane requests.
|
|
||||||
*/
|
|
||||||
final readonly class OctaneListener
|
final readonly class OctaneListener
|
||||||
{
|
{
|
||||||
public function handle(RequestReceived $event): void
|
public function handle(RequestReceived $event): void
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ use Flasher\Prime\Stamp\StampInterface;
|
|||||||
use Illuminate\Support\Facades\Facade;
|
use Illuminate\Support\Facades\Facade;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Laravel facade for PHPFlasher with IDE autocompletion support.
|
|
||||||
*
|
|
||||||
* @method static NotificationBuilder title(string $message)
|
* @method static NotificationBuilder title(string $message)
|
||||||
* @method static NotificationBuilder message(string $message)
|
* @method static NotificationBuilder message(string $message)
|
||||||
* @method static NotificationBuilder type(string $message)
|
* @method static NotificationBuilder type(string $message)
|
||||||
|
|||||||
@@ -42,9 +42,6 @@ use Illuminate\View\Compilers\BladeCompiler;
|
|||||||
use Laravel\Octane\Events\RequestReceived;
|
use Laravel\Octane\Events\RequestReceived;
|
||||||
use Livewire\LivewireManager;
|
use Livewire\LivewireManager;
|
||||||
|
|
||||||
/**
|
|
||||||
* Main service provider for Laravel integration.
|
|
||||||
*/
|
|
||||||
final class FlasherServiceProvider extends PluginServiceProvider
|
final class FlasherServiceProvider extends PluginServiceProvider
|
||||||
{
|
{
|
||||||
public function register(): void
|
public function register(): void
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ use Flasher\Prime\Http\RequestInterface;
|
|||||||
use Illuminate\Contracts\Session\Session;
|
use Illuminate\Contracts\Session\Session;
|
||||||
use Illuminate\Http\Request as LaravelRequest;
|
use Illuminate\Http\Request as LaravelRequest;
|
||||||
|
|
||||||
/**
|
|
||||||
* Adapter for Laravel HTTP requests.
|
|
||||||
*/
|
|
||||||
final readonly class Request implements RequestInterface
|
final readonly class Request implements RequestInterface
|
||||||
{
|
{
|
||||||
public function __construct(private LaravelRequest $request)
|
public function __construct(private LaravelRequest $request)
|
||||||
|
|||||||
@@ -9,9 +9,6 @@ use Illuminate\Http\Response as LaravelResponse;
|
|||||||
use Symfony\Component\HttpFoundation\JsonResponse as SymfonyJsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse as SymfonyJsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
|
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
|
||||||
|
|
||||||
/**
|
|
||||||
* Adapter for Laravel/Symfony HTTP responses.
|
|
||||||
*/
|
|
||||||
final readonly class Response implements ResponseInterface
|
final readonly class Response implements ResponseInterface
|
||||||
{
|
{
|
||||||
public function __construct(private SymfonyResponse $response)
|
public function __construct(private SymfonyResponse $response)
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ use Flasher\Prime\Http\ResponseExtensionInterface;
|
|||||||
use Illuminate\Http\Request as LaravelRequest;
|
use Illuminate\Http\Request as LaravelRequest;
|
||||||
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
|
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
|
||||||
|
|
||||||
/**
|
|
||||||
* Middleware for injecting PHPFlasher assets into responses.
|
|
||||||
*/
|
|
||||||
final readonly class FlasherMiddleware
|
final readonly class FlasherMiddleware
|
||||||
{
|
{
|
||||||
public function __construct(private ResponseExtensionInterface $responseExtension)
|
public function __construct(private ResponseExtensionInterface $responseExtension)
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ use Flasher\Prime\Http\RequestExtensionInterface;
|
|||||||
use Illuminate\Http\Request as LaravelRequest;
|
use Illuminate\Http\Request as LaravelRequest;
|
||||||
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
|
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
|
||||||
|
|
||||||
/**
|
|
||||||
* Middleware for processing session flash messages.
|
|
||||||
*/
|
|
||||||
final readonly class SessionMiddleware
|
final readonly class SessionMiddleware
|
||||||
{
|
{
|
||||||
public function __construct(private RequestExtensionInterface $requestExtension)
|
public function __construct(private RequestExtensionInterface $requestExtension)
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ use Flasher\Prime\Notification\Envelope;
|
|||||||
use Flasher\Prime\Storage\Bag\BagInterface;
|
use Flasher\Prime\Storage\Bag\BagInterface;
|
||||||
use Illuminate\Session\SessionManager;
|
use Illuminate\Session\SessionManager;
|
||||||
|
|
||||||
/**
|
|
||||||
* Laravel session storage for PHPFlasher notifications.
|
|
||||||
*/
|
|
||||||
final readonly class SessionBag implements BagInterface
|
final readonly class SessionBag implements BagInterface
|
||||||
{
|
{
|
||||||
public const ENVELOPES_NAMESPACE = 'flasher::envelopes';
|
public const ENVELOPES_NAMESPACE = 'flasher::envelopes';
|
||||||
|
|||||||
@@ -11,9 +11,6 @@ use Illuminate\Contracts\Foundation\Application;
|
|||||||
use Illuminate\Contracts\Foundation\CachesConfiguration;
|
use Illuminate\Contracts\Foundation\CachesConfiguration;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
/**
|
|
||||||
* Base service provider for PHPFlasher plugins in Laravel.
|
|
||||||
*/
|
|
||||||
abstract class PluginServiceProvider extends ServiceProvider
|
abstract class PluginServiceProvider extends ServiceProvider
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ namespace Flasher\Laravel\Template;
|
|||||||
use Flasher\Prime\Template\TemplateEngineInterface;
|
use Flasher\Prime\Template\TemplateEngineInterface;
|
||||||
use Illuminate\View\Factory;
|
use Illuminate\View\Factory;
|
||||||
|
|
||||||
/**
|
|
||||||
* Laravel Blade adapter for PHPFlasher templates.
|
|
||||||
*/
|
|
||||||
final readonly class BladeTemplateEngine implements TemplateEngineInterface
|
final readonly class BladeTemplateEngine implements TemplateEngineInterface
|
||||||
{
|
{
|
||||||
public function __construct(private Factory $blade)
|
public function __construct(private Factory $blade)
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ namespace Flasher\Laravel\Translation;
|
|||||||
use Flasher\Prime\Translation\TranslatorInterface;
|
use Flasher\Prime\Translation\TranslatorInterface;
|
||||||
use Illuminate\Translation\Translator as LaravelTranslator;
|
use Illuminate\Translation\Translator as LaravelTranslator;
|
||||||
|
|
||||||
/**
|
|
||||||
* Laravel adapter for PHPFlasher translations.
|
|
||||||
*/
|
|
||||||
final readonly class Translator implements TranslatorInterface
|
final readonly class Translator implements TranslatorInterface
|
||||||
{
|
{
|
||||||
public function __construct(private LaravelTranslator $translator)
|
public function __construct(private LaravelTranslator $translator)
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ use Flasher\Prime\Notification\Envelope;
|
|||||||
use Flasher\Prime\Storage\Filter\Filter;
|
use Flasher\Prime\Storage\Filter\Filter;
|
||||||
use Flasher\Prime\Storage\Filter\FilterInterface;
|
use Flasher\Prime\Storage\Filter\FilterInterface;
|
||||||
|
|
||||||
/**
|
|
||||||
* Event dispatched when notifications are being filtered.
|
|
||||||
*/
|
|
||||||
final class FilterEvent
|
final class FilterEvent
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ namespace Flasher\Prime\EventDispatcher\Event;
|
|||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collector for notification envelopes.
|
|
||||||
*
|
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
final class NotificationEvents
|
final class NotificationEvents
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ namespace Flasher\Prime\EventDispatcher\Event;
|
|||||||
|
|
||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
|
|
||||||
/**
|
|
||||||
* Event dispatched when notifications are being persisted.
|
|
||||||
*/
|
|
||||||
final class PersistEvent
|
final class PersistEvent
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ namespace Flasher\Prime\EventDispatcher\Event;
|
|||||||
|
|
||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
|
|
||||||
/**
|
|
||||||
* Event dispatched after notifications are persisted.
|
|
||||||
*/
|
|
||||||
final readonly class PostPersistEvent
|
final readonly class PostPersistEvent
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ namespace Flasher\Prime\EventDispatcher\Event;
|
|||||||
|
|
||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
|
|
||||||
/**
|
|
||||||
* Event dispatched after notifications are removed.
|
|
||||||
*/
|
|
||||||
final readonly class PostRemoveEvent
|
final readonly class PostRemoveEvent
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ namespace Flasher\Prime\EventDispatcher\Event;
|
|||||||
|
|
||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
|
|
||||||
/**
|
|
||||||
* Event dispatched after notification envelopes are updated.
|
|
||||||
*/
|
|
||||||
final readonly class PostUpdateEvent
|
final readonly class PostUpdateEvent
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ namespace Flasher\Prime\EventDispatcher\Event;
|
|||||||
|
|
||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
|
|
||||||
/**
|
|
||||||
* Event dispatched when notifications are being prepared for presentation.
|
|
||||||
*/
|
|
||||||
final readonly class PresentationEvent
|
final readonly class PresentationEvent
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ namespace Flasher\Prime\EventDispatcher\Event;
|
|||||||
|
|
||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
|
|
||||||
/**
|
|
||||||
* Event dispatched when notifications are being removed.
|
|
||||||
*/
|
|
||||||
final class RemoveEvent
|
final class RemoveEvent
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Prime\EventDispatcher\Event;
|
namespace Flasher\Prime\EventDispatcher\Event;
|
||||||
|
|
||||||
/**
|
|
||||||
* Event dispatched when a response is being prepared.
|
|
||||||
*/
|
|
||||||
final class ResponseEvent
|
final class ResponseEvent
|
||||||
{
|
{
|
||||||
public function __construct(
|
public function __construct(
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Prime\EventDispatcher\Event;
|
namespace Flasher\Prime\EventDispatcher\Event;
|
||||||
|
|
||||||
/**
|
|
||||||
* Contract for events that can stop propagation.
|
|
||||||
*/
|
|
||||||
interface StoppableEventInterface
|
interface StoppableEventInterface
|
||||||
{
|
{
|
||||||
public function isPropagationStopped(): bool;
|
public function isPropagationStopped(): bool;
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ namespace Flasher\Prime\EventDispatcher\Event;
|
|||||||
|
|
||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
|
|
||||||
/**
|
|
||||||
* Event dispatched when notifications are being updated.
|
|
||||||
*/
|
|
||||||
final class UpdateEvent
|
final class UpdateEvent
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -9,9 +9,6 @@ use Flasher\Prime\Notification\Envelope;
|
|||||||
use Flasher\Prime\Stamp\UnlessStamp;
|
use Flasher\Prime\Stamp\UnlessStamp;
|
||||||
use Flasher\Prime\Stamp\WhenStamp;
|
use Flasher\Prime\Stamp\WhenStamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Filters notifications before storage based on conditions.
|
|
||||||
*/
|
|
||||||
final readonly class AddToStorageListener implements EventListenerInterface
|
final readonly class AddToStorageListener implements EventListenerInterface
|
||||||
{
|
{
|
||||||
public function __invoke(PersistEvent $event): void
|
public function __invoke(PersistEvent $event): void
|
||||||
|
|||||||
@@ -10,8 +10,6 @@ use Flasher\Prime\Notification\Envelope;
|
|||||||
use Flasher\Prime\Stamp\PresetStamp;
|
use Flasher\Prime\Stamp\PresetStamp;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Applies preset configurations to notifications.
|
|
||||||
*
|
|
||||||
* @phpstan-type PresetType array{
|
* @phpstan-type PresetType array{
|
||||||
* type: string,
|
* type: string,
|
||||||
* title: string,
|
* title: string,
|
||||||
|
|||||||
@@ -13,9 +13,6 @@ use Flasher\Prime\Stamp\HopsStamp;
|
|||||||
use Flasher\Prime\Stamp\IdStamp;
|
use Flasher\Prime\Stamp\IdStamp;
|
||||||
use Flasher\Prime\Stamp\PriorityStamp;
|
use Flasher\Prime\Stamp\PriorityStamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Ensures notifications have required stamps.
|
|
||||||
*/
|
|
||||||
final readonly class AttachDefaultStampsListener implements EventListenerInterface
|
final readonly class AttachDefaultStampsListener implements EventListenerInterface
|
||||||
{
|
{
|
||||||
public function __invoke(PersistEvent|UpdateEvent $event): void
|
public function __invoke(PersistEvent|UpdateEvent $event): void
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ use Flasher\Prime\EventDispatcher\Event\RemoveEvent;
|
|||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
use Flasher\Prime\Stamp\HopsStamp;
|
use Flasher\Prime\Stamp\HopsStamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Manages notification lifecycle across requests.
|
|
||||||
*/
|
|
||||||
final readonly class EnvelopeRemovalListener implements EventListenerInterface
|
final readonly class EnvelopeRemovalListener implements EventListenerInterface
|
||||||
{
|
{
|
||||||
public function __invoke(RemoveEvent $event): void
|
public function __invoke(RemoveEvent $event): void
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Prime\EventDispatcher\EventListener;
|
namespace Flasher\Prime\EventDispatcher\EventListener;
|
||||||
|
|
||||||
/**
|
|
||||||
* Contract for event listeners.
|
|
||||||
*/
|
|
||||||
interface EventListenerInterface
|
interface EventListenerInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -9,8 +9,6 @@ use Flasher\Prime\EventDispatcher\Event\PersistEvent;
|
|||||||
use Flasher\Prime\EventDispatcher\Event\PresentationEvent;
|
use Flasher\Prime\EventDispatcher\Event\PresentationEvent;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Logs all notifications that are dispatched and displayed.
|
|
||||||
*
|
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
final class NotificationLoggerListener implements EventListenerInterface
|
final class NotificationLoggerListener implements EventListenerInterface
|
||||||
|
|||||||
@@ -12,9 +12,6 @@ use Flasher\Prime\Translation\EchoTranslator;
|
|||||||
use Flasher\Prime\Translation\Language;
|
use Flasher\Prime\Translation\Language;
|
||||||
use Flasher\Prime\Translation\TranslatorInterface;
|
use Flasher\Prime\Translation\TranslatorInterface;
|
||||||
|
|
||||||
/**
|
|
||||||
* Applies translations to notifications during presentation.
|
|
||||||
*/
|
|
||||||
final readonly class TranslationListener implements EventListenerInterface
|
final readonly class TranslationListener implements EventListenerInterface
|
||||||
{
|
{
|
||||||
private TranslatorInterface $translator;
|
private TranslatorInterface $translator;
|
||||||
|
|||||||
@@ -5,8 +5,6 @@ declare(strict_types=1);
|
|||||||
namespace Flasher\Prime\Factory;
|
namespace Flasher\Prime\Factory;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Factory interface for creating Flasher-specific notification builders.
|
|
||||||
*
|
|
||||||
* @mixin \Flasher\Prime\Notification\FlasherBuilder
|
* @mixin \Flasher\Prime\Notification\FlasherBuilder
|
||||||
*/
|
*/
|
||||||
interface FlasherFactoryInterface extends NotificationFactoryInterface
|
interface FlasherFactoryInterface extends NotificationFactoryInterface
|
||||||
|
|||||||
@@ -8,8 +8,6 @@ use Flasher\Prime\Storage\StorageManagerInterface;
|
|||||||
use Flasher\Prime\Support\Traits\ForwardsCalls;
|
use Flasher\Prime\Support\Traits\ForwardsCalls;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Base abstract class for notification factories.
|
|
||||||
*
|
|
||||||
* @mixin \Flasher\Prime\Notification\NotificationBuilderInterface
|
* @mixin \Flasher\Prime\Notification\NotificationBuilderInterface
|
||||||
*/
|
*/
|
||||||
abstract class NotificationFactory implements NotificationFactoryInterface
|
abstract class NotificationFactory implements NotificationFactoryInterface
|
||||||
|
|||||||
@@ -7,8 +7,6 @@ namespace Flasher\Prime\Factory;
|
|||||||
use Flasher\Prime\Notification\NotificationBuilderInterface;
|
use Flasher\Prime\Notification\NotificationBuilderInterface;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Core factory abstraction.
|
|
||||||
*
|
|
||||||
* @mixin \Flasher\Prime\Notification\NotificationBuilderInterface
|
* @mixin \Flasher\Prime\Notification\NotificationBuilderInterface
|
||||||
*/
|
*/
|
||||||
interface NotificationFactoryInterface
|
interface NotificationFactoryInterface
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ namespace Flasher\Prime\Factory;
|
|||||||
|
|
||||||
use Flasher\Prime\Exception\FactoryNotFoundException;
|
use Flasher\Prime\Exception\FactoryNotFoundException;
|
||||||
|
|
||||||
/**
|
|
||||||
* Registry of available factories.
|
|
||||||
*/
|
|
||||||
final class NotificationFactoryLocator implements NotificationFactoryLocatorInterface
|
final class NotificationFactoryLocator implements NotificationFactoryLocatorInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Prime\Factory;
|
namespace Flasher\Prime\Factory;
|
||||||
|
|
||||||
/**
|
|
||||||
* Interface for the notification factory locator service.
|
|
||||||
*/
|
|
||||||
interface NotificationFactoryLocatorInterface
|
interface NotificationFactoryLocatorInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ use Flasher\Prime\Stamp\PresentableStampInterface;
|
|||||||
use Flasher\Prime\Stamp\StampInterface;
|
use Flasher\Prime\Stamp\StampInterface;
|
||||||
use Flasher\Prime\Support\Traits\ForwardsCalls;
|
use Flasher\Prime\Support\Traits\ForwardsCalls;
|
||||||
|
|
||||||
/**
|
|
||||||
* Wraps a notification with metadata stamps.
|
|
||||||
*/
|
|
||||||
final class Envelope implements NotificationInterface
|
final class Envelope implements NotificationInterface
|
||||||
{
|
{
|
||||||
use ForwardsCalls;
|
use ForwardsCalls;
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Prime\Notification;
|
namespace Flasher\Prime\Notification;
|
||||||
|
|
||||||
/**
|
|
||||||
* Default implementation of NotificationInterface.
|
|
||||||
*/
|
|
||||||
final class Notification implements NotificationInterface
|
final class Notification implements NotificationInterface
|
||||||
{
|
{
|
||||||
private string $title = '';
|
private string $title = '';
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Prime\Stamp;
|
namespace Flasher\Prime\Stamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Records when a notification was created.
|
|
||||||
*/
|
|
||||||
final readonly class CreatedAtStamp implements OrderableStampInterface, PresentableStampInterface, StampInterface
|
final readonly class CreatedAtStamp implements OrderableStampInterface, PresentableStampInterface, StampInterface
|
||||||
{
|
{
|
||||||
private \DateTimeImmutable $createdAt;
|
private \DateTimeImmutable $createdAt;
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Prime\Stamp;
|
namespace Flasher\Prime\Stamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Contract for stamps that affect notification ordering.
|
|
||||||
*/
|
|
||||||
interface OrderableStampInterface
|
interface OrderableStampInterface
|
||||||
{
|
{
|
||||||
public function compare(StampInterface $orderable): int;
|
public function compare(StampInterface $orderable): int;
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Prime\Stamp;
|
namespace Flasher\Prime\Stamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Contract for stamps that contribute to presentation.
|
|
||||||
*/
|
|
||||||
interface PresentableStampInterface
|
interface PresentableStampInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Prime\Stamp;
|
namespace Flasher\Prime\Stamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Marker interface for notification metadata.
|
|
||||||
*/
|
|
||||||
interface StampInterface
|
interface StampInterface
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ namespace Flasher\Prime\Storage\Bag;
|
|||||||
|
|
||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
|
|
||||||
/**
|
|
||||||
* In-memory storage bag for notifications.
|
|
||||||
*/
|
|
||||||
final class ArrayBag implements BagInterface
|
final class ArrayBag implements BagInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ namespace Flasher\Prime\Storage\Bag;
|
|||||||
|
|
||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
|
|
||||||
/**
|
|
||||||
* Contract for notification envelope storage containers.
|
|
||||||
*/
|
|
||||||
interface BagInterface
|
interface BagInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ namespace Flasher\Prime\Storage\Bag;
|
|||||||
|
|
||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
|
|
||||||
/**
|
|
||||||
* Static/global storage bag for notifications.
|
|
||||||
*/
|
|
||||||
final class StaticBag implements BagInterface
|
final class StaticBag implements BagInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ namespace Flasher\Prime\Storage\Filter\Criteria;
|
|||||||
|
|
||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
|
|
||||||
/**
|
|
||||||
* Contract for notification filtering criteria.
|
|
||||||
*/
|
|
||||||
interface CriteriaInterface
|
interface CriteriaInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ namespace Flasher\Prime\Storage\Filter\Criteria;
|
|||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
use Flasher\Prime\Stamp\DelayStamp;
|
use Flasher\Prime\Stamp\DelayStamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Filters notifications by delay time.
|
|
||||||
*/
|
|
||||||
final readonly class DelayCriteria implements CriteriaInterface
|
final readonly class DelayCriteria implements CriteriaInterface
|
||||||
{
|
{
|
||||||
use RangeExtractor;
|
use RangeExtractor;
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ namespace Flasher\Prime\Storage\Filter\Criteria;
|
|||||||
|
|
||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
|
|
||||||
/**
|
|
||||||
* Applies custom closure-based filters to notifications.
|
|
||||||
*/
|
|
||||||
final class FilterCriteria implements CriteriaInterface
|
final class FilterCriteria implements CriteriaInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ namespace Flasher\Prime\Storage\Filter\Criteria;
|
|||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
use Flasher\Prime\Stamp\HopsStamp;
|
use Flasher\Prime\Stamp\HopsStamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Filters notifications by hops count.
|
|
||||||
*/
|
|
||||||
final readonly class HopsCriteria implements CriteriaInterface
|
final readonly class HopsCriteria implements CriteriaInterface
|
||||||
{
|
{
|
||||||
use RangeExtractor;
|
use RangeExtractor;
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ namespace Flasher\Prime\Storage\Filter\Criteria;
|
|||||||
|
|
||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
|
|
||||||
/**
|
|
||||||
* Limits the number of notifications returned.
|
|
||||||
*/
|
|
||||||
final readonly class LimitCriteria implements CriteriaInterface
|
final readonly class LimitCriteria implements CriteriaInterface
|
||||||
{
|
{
|
||||||
private int $limit;
|
private int $limit;
|
||||||
|
|||||||
@@ -19,9 +19,6 @@ use Flasher\Prime\Stamp\TranslationStamp;
|
|||||||
use Flasher\Prime\Stamp\UnlessStamp;
|
use Flasher\Prime\Stamp\UnlessStamp;
|
||||||
use Flasher\Prime\Stamp\WhenStamp;
|
use Flasher\Prime\Stamp\WhenStamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Sorts notifications based on stamp attributes.
|
|
||||||
*/
|
|
||||||
final class OrderByCriteria implements CriteriaInterface
|
final class OrderByCriteria implements CriteriaInterface
|
||||||
{
|
{
|
||||||
public const ASC = 'ASC';
|
public const ASC = 'ASC';
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ namespace Flasher\Prime\Storage\Filter\Criteria;
|
|||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
use Flasher\Prime\Stamp\PresenterStamp;
|
use Flasher\Prime\Stamp\PresenterStamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Filters notifications by presenter compatibility.
|
|
||||||
*/
|
|
||||||
final class PresenterCriteria implements CriteriaInterface
|
final class PresenterCriteria implements CriteriaInterface
|
||||||
{
|
{
|
||||||
private string $presenter;
|
private string $presenter;
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ namespace Flasher\Prime\Storage\Filter\Criteria;
|
|||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
use Flasher\Prime\Stamp\PriorityStamp;
|
use Flasher\Prime\Stamp\PriorityStamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Filters notifications by priority.
|
|
||||||
*/
|
|
||||||
final readonly class PriorityCriteria implements CriteriaInterface
|
final readonly class PriorityCriteria implements CriteriaInterface
|
||||||
{
|
{
|
||||||
use RangeExtractor;
|
use RangeExtractor;
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ namespace Flasher\Prime\Storage\Filter\Criteria;
|
|||||||
|
|
||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
|
|
||||||
/**
|
|
||||||
* Filters notifications by the presence of specific stamps.
|
|
||||||
*/
|
|
||||||
final class StampsCriteria implements CriteriaInterface
|
final class StampsCriteria implements CriteriaInterface
|
||||||
{
|
{
|
||||||
public const STRATEGY_AND = 'and';
|
public const STRATEGY_AND = 'and';
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ namespace Flasher\Prime\Storage\Filter;
|
|||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
use Flasher\Prime\Storage\Filter\Criteria\CriteriaInterface;
|
use Flasher\Prime\Storage\Filter\Criteria\CriteriaInterface;
|
||||||
|
|
||||||
/**
|
|
||||||
* Default implementation of the filter interface.
|
|
||||||
*/
|
|
||||||
final class Filter implements FilterInterface
|
final class Filter implements FilterInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -2,23 +2,6 @@
|
|||||||
|
|
||||||
declare(strict_types=1);
|
declare(strict_types=1);
|
||||||
|
|
||||||
/**
|
|
||||||
* ForwardsCalls Trait.
|
|
||||||
*
|
|
||||||
* This file contains the ForwardsCalls trait, which is used to forward method calls
|
|
||||||
* to another object. This trait is originally part of the Laravel framework.
|
|
||||||
*
|
|
||||||
* @see https://github.com/laravel/framework/blob/10.x/src/Illuminate/Support/Traits/ForwardsCalls.php
|
|
||||||
*
|
|
||||||
* Laravel is an open-source PHP framework, which this trait is a part of. The original
|
|
||||||
* source code has been modified to suit the needs of the PHP-Flasher project.
|
|
||||||
*
|
|
||||||
* @copyright Laravel
|
|
||||||
* @license MIT License
|
|
||||||
*
|
|
||||||
* @see https://laravel.com/docs/10.x/
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace Flasher\Prime\Support\Traits;
|
namespace Flasher\Prime\Support\Traits;
|
||||||
|
|
||||||
trait ForwardsCalls
|
trait ForwardsCalls
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Symfony\Attribute;
|
namespace Flasher\Symfony\Attribute;
|
||||||
|
|
||||||
/**
|
|
||||||
* Attribute for tagging notification factories.
|
|
||||||
*/
|
|
||||||
#[\Attribute(\Attribute::TARGET_CLASS)]
|
#[\Attribute(\Attribute::TARGET_CLASS)]
|
||||||
final readonly class AsFlasherFactory
|
final readonly class AsFlasherFactory
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Symfony\Attribute;
|
namespace Flasher\Symfony\Attribute;
|
||||||
|
|
||||||
/**
|
|
||||||
* Attribute for tagging response presenters.
|
|
||||||
*/
|
|
||||||
#[\Attribute(\Attribute::TARGET_CLASS)]
|
#[\Attribute(\Attribute::TARGET_CLASS)]
|
||||||
final readonly class AsFlasherPresenter
|
final readonly class AsFlasherPresenter
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,9 +16,6 @@ use Symfony\Component\Filesystem\Filesystem;
|
|||||||
use Symfony\Component\Finder\Finder;
|
use Symfony\Component\Finder\Finder;
|
||||||
use Symfony\Component\HttpKernel\KernelInterface;
|
use Symfony\Component\HttpKernel\KernelInterface;
|
||||||
|
|
||||||
/**
|
|
||||||
* Console command for installing PHPFlasher resources.
|
|
||||||
*/
|
|
||||||
final class InstallCommand extends Command
|
final class InstallCommand extends Command
|
||||||
{
|
{
|
||||||
public function __construct(private readonly AssetManagerInterface $assetManager)
|
public function __construct(private readonly AssetManagerInterface $assetManager)
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Symfony\Component;
|
namespace Flasher\Symfony\Component;
|
||||||
|
|
||||||
/**
|
|
||||||
* Twig component for rendering PHPFlasher notifications.
|
|
||||||
*/
|
|
||||||
final class FlasherComponent
|
final class FlasherComponent
|
||||||
{
|
{
|
||||||
/** @var array<string, mixed> */
|
/** @var array<string, mixed> */
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ use Flasher\Symfony\Http\Response;
|
|||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
use Symfony\Component\HttpKernel\Event\ResponseEvent;
|
use Symfony\Component\HttpKernel\Event\ResponseEvent;
|
||||||
|
|
||||||
/**
|
|
||||||
* Injects PHPFlasher assets into responses.
|
|
||||||
*/
|
|
||||||
final readonly class FlasherListener implements EventSubscriberInterface
|
final readonly class FlasherListener implements EventSubscriberInterface
|
||||||
{
|
{
|
||||||
public function __construct(private ResponseExtensionInterface $responseExtension)
|
public function __construct(private ResponseExtensionInterface $responseExtension)
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ use Flasher\Symfony\Http\Response;
|
|||||||
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
|
||||||
use Symfony\Component\HttpKernel\Event\ResponseEvent;
|
use Symfony\Component\HttpKernel\Event\ResponseEvent;
|
||||||
|
|
||||||
/**
|
|
||||||
* Processes session flash messages.
|
|
||||||
*/
|
|
||||||
final readonly class SessionListener implements EventSubscriberInterface
|
final readonly class SessionListener implements EventSubscriberInterface
|
||||||
{
|
{
|
||||||
public function __construct(private RequestExtensionInterface $requestExtension)
|
public function __construct(private RequestExtensionInterface $requestExtension)
|
||||||
|
|||||||
@@ -13,9 +13,6 @@ use Psr\Container\ContainerInterface;
|
|||||||
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
use Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
|
use Symfony\Component\DependencyInjection\Extension\ExtensionInterface;
|
||||||
|
|
||||||
/**
|
|
||||||
* Main bundle for PHPFlasher Symfony integration.
|
|
||||||
*/
|
|
||||||
final class FlasherSymfonyBundle extends Support\PluginBundle // Symfony\Component\HttpKernel\Bundle\Bundle
|
final class FlasherSymfonyBundle extends Support\PluginBundle // Symfony\Component\HttpKernel\Bundle\Bundle
|
||||||
{
|
{
|
||||||
public function boot(): void
|
public function boot(): void
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ use Symfony\Component\HttpFoundation\Request as SymfonyRequest;
|
|||||||
use Symfony\Component\HttpFoundation\Session\FlashBagAwareSessionInterface;
|
use Symfony\Component\HttpFoundation\Session\FlashBagAwareSessionInterface;
|
||||||
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||||
|
|
||||||
/**
|
|
||||||
* Adapter for Symfony's HTTP request.
|
|
||||||
*/
|
|
||||||
final readonly class Request implements RequestInterface
|
final readonly class Request implements RequestInterface
|
||||||
{
|
{
|
||||||
public function __construct(private SymfonyRequest $request)
|
public function __construct(private SymfonyRequest $request)
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ use Flasher\Prime\Http\ResponseInterface;
|
|||||||
use Symfony\Component\HttpFoundation\JsonResponse;
|
use Symfony\Component\HttpFoundation\JsonResponse;
|
||||||
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
|
use Symfony\Component\HttpFoundation\Response as SymfonyResponse;
|
||||||
|
|
||||||
/**
|
|
||||||
* Adapter for Symfony's HTTP response.
|
|
||||||
*/
|
|
||||||
final readonly class Response implements ResponseInterface
|
final readonly class Response implements ResponseInterface
|
||||||
{
|
{
|
||||||
public function __construct(private SymfonyResponse $response)
|
public function __construct(private SymfonyResponse $response)
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ use Symfony\Component\HttpKernel\Kernel;
|
|||||||
use Symfony\Component\VarDumper\Cloner\Data;
|
use Symfony\Component\VarDumper\Cloner\Data;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Collects PHPFlasher data for the Symfony profiler.
|
|
||||||
*
|
|
||||||
* @phpstan-type NotificationShape array{
|
* @phpstan-type NotificationShape array{
|
||||||
* title: string,
|
* title: string,
|
||||||
* message: string,
|
* message: string,
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Symfony\Storage;
|
namespace Flasher\Symfony\Storage;
|
||||||
|
|
||||||
/**
|
|
||||||
* In-memory session storage fallback.
|
|
||||||
*/
|
|
||||||
final class FallbackSession implements FallbackSessionInterface
|
final class FallbackSession implements FallbackSessionInterface
|
||||||
{
|
{
|
||||||
/** @var array<string, mixed> */
|
/** @var array<string, mixed> */
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Symfony\Storage;
|
namespace Flasher\Symfony\Storage;
|
||||||
|
|
||||||
/**
|
|
||||||
* Contract for alternative session storage.
|
|
||||||
*/
|
|
||||||
interface FallbackSessionInterface
|
interface FallbackSessionInterface
|
||||||
{
|
{
|
||||||
public function get(string $name, mixed $default = null): mixed;
|
public function get(string $name, mixed $default = null): mixed;
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ use Symfony\Component\HttpFoundation\Exception\SessionNotFoundException;
|
|||||||
use Symfony\Component\HttpFoundation\RequestStack;
|
use Symfony\Component\HttpFoundation\RequestStack;
|
||||||
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
use Symfony\Component\HttpFoundation\Session\SessionInterface;
|
||||||
|
|
||||||
/**
|
|
||||||
* Symfony session storage for PHPFlasher notifications.
|
|
||||||
*/
|
|
||||||
final readonly class SessionBag implements BagInterface
|
final readonly class SessionBag implements BagInterface
|
||||||
{
|
{
|
||||||
public const ENVELOPES_NAMESPACE = 'flasher::envelopes';
|
public const ENVELOPES_NAMESPACE = 'flasher::envelopes';
|
||||||
|
|||||||
@@ -10,9 +10,6 @@ use Symfony\Component\DependencyInjection\ContainerBuilder;
|
|||||||
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
|
||||||
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;
|
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;
|
||||||
|
|
||||||
/**
|
|
||||||
* Base class for PHPFlasher plugin bundles.
|
|
||||||
*/
|
|
||||||
abstract class PluginBundle extends AbstractBundle implements PluginBundleInterface
|
abstract class PluginBundle extends AbstractBundle implements PluginBundleInterface
|
||||||
{
|
{
|
||||||
abstract public function createPlugin(): PluginInterface;
|
abstract public function createPlugin(): PluginInterface;
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ namespace Flasher\Symfony\Support;
|
|||||||
|
|
||||||
use Flasher\Prime\Plugin\PluginInterface;
|
use Flasher\Prime\Plugin\PluginInterface;
|
||||||
|
|
||||||
/**
|
|
||||||
* Contract for PHPFlasher plugin bundles.
|
|
||||||
*/
|
|
||||||
interface PluginBundleInterface
|
interface PluginBundleInterface
|
||||||
{
|
{
|
||||||
public function createPlugin(): PluginInterface;
|
public function createPlugin(): PluginInterface;
|
||||||
|
|||||||
@@ -7,9 +7,6 @@ namespace Flasher\Symfony\Template;
|
|||||||
use Flasher\Prime\Template\TemplateEngineInterface;
|
use Flasher\Prime\Template\TemplateEngineInterface;
|
||||||
use Twig\Environment;
|
use Twig\Environment;
|
||||||
|
|
||||||
/**
|
|
||||||
* Adapter for Symfony's Twig template engine.
|
|
||||||
*/
|
|
||||||
final readonly class TwigTemplateEngine implements TemplateEngineInterface
|
final readonly class TwigTemplateEngine implements TemplateEngineInterface
|
||||||
{
|
{
|
||||||
public function __construct(private ?Environment $twig = null)
|
public function __construct(private ?Environment $twig = null)
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ use Flasher\Prime\Translation\TranslatorInterface;
|
|||||||
use Symfony\Component\Translation\TranslatorBagInterface;
|
use Symfony\Component\Translation\TranslatorBagInterface;
|
||||||
use Symfony\Contracts\Translation\TranslatorInterface as SymfonyTranslatorInterface;
|
use Symfony\Contracts\Translation\TranslatorInterface as SymfonyTranslatorInterface;
|
||||||
|
|
||||||
/**
|
|
||||||
* Adapter for Symfony's translation service.
|
|
||||||
*/
|
|
||||||
final readonly class Translator implements TranslatorInterface
|
final readonly class Translator implements TranslatorInterface
|
||||||
{
|
{
|
||||||
public function __construct(private SymfonyTranslatorInterface $translator)
|
public function __construct(private SymfonyTranslatorInterface $translator)
|
||||||
|
|||||||
@@ -8,9 +8,6 @@ use Flasher\Prime\FlasherInterface;
|
|||||||
use Twig\Extension\AbstractExtension;
|
use Twig\Extension\AbstractExtension;
|
||||||
use Twig\TwigFunction;
|
use Twig\TwigFunction;
|
||||||
|
|
||||||
/**
|
|
||||||
* Twig extension for rendering PHPFlasher notifications.
|
|
||||||
*/
|
|
||||||
final class FlasherTwigExtension extends AbstractExtension
|
final class FlasherTwigExtension extends AbstractExtension
|
||||||
{
|
{
|
||||||
public function __construct(private readonly FlasherInterface $flasher)
|
public function __construct(private readonly FlasherInterface $flasher)
|
||||||
|
|||||||
Reference in New Issue
Block a user