mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
Simplify PHPDoc comments in Stamp classes and PhpStorm meta files
Removes verbose documentation and comments from: - Stamp classes (PriorityStamp, HopsStamp, DelayStamp, etc.) - .phpstorm.meta.php files (Prime, Noty, Notyf, SweetAlert, Toastr) - Factory and EventDispatcher classes
This commit is contained in:
@@ -1,30 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
|
||||||
* PhpStorm Meta File - IDE Enhancement for Noty.
|
|
||||||
*
|
|
||||||
* This file provides PhpStorm with additional type information and method completion
|
|
||||||
* capabilities for the Noty library. It's not loaded during runtime but is used
|
|
||||||
* exclusively by the IDE to improve developer experience.
|
|
||||||
*
|
|
||||||
* The file enhances code intelligence in several ways:
|
|
||||||
* 1. Adds expected arguments for Noty functions and methods
|
|
||||||
* 2. Maps factory methods to their return types
|
|
||||||
*
|
|
||||||
* Design patterns:
|
|
||||||
* - Metadata: Provides additional information about code that's only used by tools
|
|
||||||
* - IDE Integration: Bridges the gap between dynamic PHP code and static analysis tools
|
|
||||||
*
|
|
||||||
* Note: This file is part of the development tooling and has no effect on runtime behavior.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace PHPSTORM_META;
|
namespace PHPSTORM_META;
|
||||||
|
|
||||||
// Define expected values for noty function's type parameter
|
|
||||||
expectedArguments(\noty(), 1, 'success', 'error', 'info', 'warning');
|
expectedArguments(\noty(), 1, 'success', 'error', 'info', 'warning');
|
||||||
expectedArguments(\Flasher\Noty\Prime\noty(), 1, 'success', 'error', 'info', 'warning');
|
expectedArguments(\Flasher\Noty\Prime\noty(), 1, 'success', 'error', 'info', 'warning');
|
||||||
|
|
||||||
// Define expected values for various builder methods
|
|
||||||
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::layout(), 0, 'top', 'topLeft', 'topCenter', 'topRight', 'center', 'centerLeft', 'centerRight', 'bottom', 'bottomLeft', 'bottomCenter', 'bottomRight');
|
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::layout(), 0, 'top', 'topLeft', 'topCenter', 'topRight', 'center', 'centerLeft', 'centerRight', 'bottom', 'bottomLeft', 'bottomCenter', 'bottomRight');
|
||||||
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::theme(), 0, 'relax', 'mint', 'metroui');
|
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::theme(), 0, 'relax', 'mint', 'metroui');
|
||||||
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::timeout(), 0, false, 1000, 3000, 3500, 5000);
|
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::timeout(), 0, false, 1000, 3000, 3500, 5000);
|
||||||
@@ -33,8 +12,6 @@ expectedArguments(\Flasher\Noty\Prime\NotyBuilder::animation(), 0, 'open', 'clos
|
|||||||
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::sounds(), 0, 'sources', 'volume', 'conditions');
|
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::sounds(), 0, 'sources', 'volume', 'conditions');
|
||||||
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::docTitle(), 0, 'conditions');
|
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::docTitle(), 0, 'conditions');
|
||||||
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::queue(), 0, 'global');
|
expectedArguments(\Flasher\Noty\Prime\NotyBuilder::queue(), 0, 'global');
|
||||||
|
|
||||||
// Map factory methods to their return types
|
|
||||||
override(\Flasher\Prime\FlasherInterface::use(), map(['noty' => \Flasher\Noty\Prime\NotyInterface::class]));
|
override(\Flasher\Prime\FlasherInterface::use(), map(['noty' => \Flasher\Noty\Prime\NotyInterface::class]));
|
||||||
override(\Flasher\Prime\FlasherInterface::create(), map(['noty' => \Flasher\Noty\Prime\NotyInterface::class]));
|
override(\Flasher\Prime\FlasherInterface::create(), map(['noty' => \Flasher\Noty\Prime\NotyInterface::class]));
|
||||||
override(\Flasher\Prime\Container\FlasherContainer::create(), map(['flasher.noty' => \Flasher\Noty\Prime\NotyInterface::class]));
|
override(\Flasher\Prime\Container\FlasherContainer::create(), map(['flasher.noty' => \Flasher\Noty\Prime\NotyInterface::class]));
|
||||||
|
|||||||
@@ -1,35 +1,12 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
|
||||||
* PhpStorm Meta File - IDE Enhancement for Notyf.
|
|
||||||
*
|
|
||||||
* This file provides PhpStorm with additional type information and method completion
|
|
||||||
* capabilities for the Notyf library. It's not loaded during runtime but is used
|
|
||||||
* exclusively by the IDE to improve developer experience.
|
|
||||||
*
|
|
||||||
* The file enhances code intelligence in several ways:
|
|
||||||
* 1. Adds expected arguments for Notyf functions and methods
|
|
||||||
* 2. Maps factory methods to their return types
|
|
||||||
*
|
|
||||||
* Design patterns:
|
|
||||||
* - Metadata: Provides additional information about code that's only used by tools
|
|
||||||
* - IDE Integration: Bridges the gap between dynamic PHP code and static analysis tools
|
|
||||||
*
|
|
||||||
* Note: This file is part of the development tooling and has no effect on runtime behavior.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace PHPSTORM_META;
|
namespace PHPSTORM_META;
|
||||||
|
|
||||||
// Define expected values for notyf function's type parameter
|
|
||||||
expectedArguments(\notyf(), 1, 'success', 'error', 'info', 'warning');
|
expectedArguments(\notyf(), 1, 'success', 'error', 'info', 'warning');
|
||||||
expectedArguments(\Flasher\Notyf\Prime\notyf(), 1, 'success', 'error', 'info', 'warning');
|
expectedArguments(\Flasher\Notyf\Prime\notyf(), 1, 'success', 'error', 'info', 'warning');
|
||||||
|
|
||||||
// Define expected values for various builder methods
|
|
||||||
expectedArguments(\Flasher\Notyf\Prime\NotyfBuilder::duration(), 0, 1000, 2000, 3000, 4000, 5000);
|
expectedArguments(\Flasher\Notyf\Prime\NotyfBuilder::duration(), 0, 1000, 2000, 3000, 4000, 5000);
|
||||||
expectedArguments(\Flasher\Notyf\Prime\NotyfBuilder::position(), 0, 'x', 'y');
|
expectedArguments(\Flasher\Notyf\Prime\NotyfBuilder::position(), 0, 'x', 'y');
|
||||||
expectedArguments(\Flasher\Notyf\Prime\NotyfBuilder::position(), 1, 'top', 'right', 'bottom', 'left', 'center');
|
expectedArguments(\Flasher\Notyf\Prime\NotyfBuilder::position(), 1, 'top', 'right', 'bottom', 'left', 'center');
|
||||||
|
|
||||||
// Map factory methods to their return types
|
|
||||||
override(\Flasher\Prime\FlasherInterface::use(), map(['notyf' => \Flasher\Notyf\Prime\NotyfInterface::class]));
|
override(\Flasher\Prime\FlasherInterface::use(), map(['notyf' => \Flasher\Notyf\Prime\NotyfInterface::class]));
|
||||||
override(\Flasher\Prime\FlasherInterface::create(), map(['notyf' => \Flasher\Notyf\Prime\NotyfInterface::class]));
|
override(\Flasher\Prime\FlasherInterface::create(), map(['notyf' => \Flasher\Notyf\Prime\NotyfInterface::class]));
|
||||||
override(\Flasher\Prime\Container\FlasherContainer::create(), map(['flasher.notyf' => \Notyf\Notyf\Prime\NotyfInterface::class]));
|
override(\Flasher\Prime\Container\FlasherContainer::create(), map(['flasher.notyf' => \Notyf\Notyf\Prime\NotyfInterface::class]));
|
||||||
|
|||||||
@@ -1,36 +1,11 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
|
||||||
* PhpStorm Meta File - IDE Enhancement for PHPFlasher.
|
|
||||||
*
|
|
||||||
* This file provides PhpStorm with additional type information and method completion
|
|
||||||
* capabilities for the PHPFlasher library. It's not loaded during runtime but is used
|
|
||||||
* exclusively by the IDE to improve developer experience.
|
|
||||||
*
|
|
||||||
* The file enhances code intelligence in several ways:
|
|
||||||
* 1. Adds type inference for Envelope::get() method
|
|
||||||
* 2. Provides completion for factory methods in FlasherInterface
|
|
||||||
* 3. Registers expected argument sets for notification types
|
|
||||||
* 4. Defines expected arguments for various builder methods
|
|
||||||
*
|
|
||||||
* Design patterns:
|
|
||||||
* - Metadata: Provides additional information about code that's only used by tools
|
|
||||||
* - IDE Integration: Bridges the gap between dynamic PHP code and static analysis tools
|
|
||||||
*
|
|
||||||
* Note: This file is part of the development tooling and has no effect on runtime behavior.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace PHPSTORM_META;
|
namespace PHPSTORM_META;
|
||||||
|
|
||||||
// Infer the correct type when Envelope::get() is called with a class name
|
|
||||||
override(Envelope::get(0), type(0));
|
override(Envelope::get(0), type(0));
|
||||||
|
|
||||||
// Map factory methods to their return types for better autocompletion
|
|
||||||
override(\Flasher\Prime\FlasherInterface::create(), map(['flasher' => \Flasher\Prime\Factory\FlasherFactory::class, 'theme.' => \Flasher\Prime\Factory\FlasherFactory::class]));
|
override(\Flasher\Prime\FlasherInterface::create(), map(['flasher' => \Flasher\Prime\Factory\FlasherFactory::class, 'theme.' => \Flasher\Prime\Factory\FlasherFactory::class]));
|
||||||
override(\Flasher\Prime\Container\FlasherContainer::create(), map(['flasher' => \Flasher\Prime\Factory\FlasherFactory::class, 'theme.' => \Flasher\Prime\Factory\FlasherFactory::class]));
|
override(\Flasher\Prime\Container\FlasherContainer::create(), map(['flasher' => \Flasher\Prime\Factory\FlasherFactory::class, 'theme.' => \Flasher\Prime\Factory\FlasherFactory::class]));
|
||||||
override(\Flasher\Prime\FlasherInterface::use(), map(['flasher' => \Flasher\Prime\Factory\FlasherFactory::class, 'theme.' => \Flasher\Prime\Factory\FlasherFactory::class]));
|
override(\Flasher\Prime\FlasherInterface::use(), map(['flasher' => \Flasher\Prime\Factory\FlasherFactory::class, 'theme.' => \Flasher\Prime\Factory\FlasherFactory::class]));
|
||||||
|
|
||||||
// Register and utilize notification type constants for better code completion
|
|
||||||
registerArgumentsSet('types', 'success', 'error', 'warning', 'info');
|
registerArgumentsSet('types', 'success', 'error', 'warning', 'info');
|
||||||
expectedArguments(\Flasher\Prime\Notification\NotificationBuilderInterface::type(), 0, argumentsSet('types'));
|
expectedArguments(\Flasher\Prime\Notification\NotificationBuilderInterface::type(), 0, argumentsSet('types'));
|
||||||
expectedArguments(\Flasher\Prime\Notification\NotificationBuilderInterface::addFlash(), 0, argumentsSet('types'));
|
expectedArguments(\Flasher\Prime\Notification\NotificationBuilderInterface::addFlash(), 0, argumentsSet('types'));
|
||||||
@@ -39,12 +14,6 @@ expectedArguments(\Flasher\Prime\Notification\NotificationInterface::setType(),
|
|||||||
expectedArguments(flash(), 1, argumentsSet('types'));
|
expectedArguments(flash(), 1, argumentsSet('types'));
|
||||||
expectedArguments(\Flasher\Prime\flash(), 1, argumentsSet('types'));
|
expectedArguments(\Flasher\Prime\flash(), 1, argumentsSet('types'));
|
||||||
expectedReturnValues(\Flasher\Prime\Notification\NotificationInterface::getType(), argumentsSet('types'));
|
expectedReturnValues(\Flasher\Prime\Notification\NotificationInterface::getType(), argumentsSet('types'));
|
||||||
|
|
||||||
// Define expected arguments for handlers
|
|
||||||
expectedArguments(\Flasher\Prime\Notification\NotificationBuilderInterface::handler(), 0, 'flasher', 'toastr', 'noty', 'notyf', 'sweetalert');
|
expectedArguments(\Flasher\Prime\Notification\NotificationBuilderInterface::handler(), 0, 'flasher', 'toastr', 'noty', 'notyf', 'sweetalert');
|
||||||
|
|
||||||
// Define expected arguments for render formats
|
|
||||||
expectedArguments(\Flasher\Prime\FlasherInterface::render(), 0, 'html', 'json', 'array');
|
expectedArguments(\Flasher\Prime\FlasherInterface::render(), 0, 'html', 'json', 'array');
|
||||||
|
|
||||||
// Define expected arguments for common option keys
|
|
||||||
expectedArguments(\Flasher\Prime\Notification\FlasherBuilder::option(), 0, 'timeout', 'timeouts', 'fps', 'position', 'direction', 'rtl', 'style', 'escapeHtml');
|
expectedArguments(\Flasher\Prime\Notification\FlasherBuilder::option(), 0, 'timeout', 'timeouts', 'fps', 'position', 'direction', 'rtl', 'style', 'escapeHtml');
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Prime\Stamp;
|
namespace Flasher\Prime\Stamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Stores additional context data for a notification.
|
|
||||||
*/
|
|
||||||
final readonly class ContextStamp implements PresentableStampInterface, StampInterface
|
final readonly class ContextStamp implements PresentableStampInterface, StampInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Prime\Stamp;
|
namespace Flasher\Prime\Stamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Controls notification display delay.
|
|
||||||
*/
|
|
||||||
final readonly class DelayStamp implements StampInterface
|
final readonly class DelayStamp implements StampInterface
|
||||||
{
|
{
|
||||||
public function __construct(private int $delay)
|
public function __construct(private int $delay)
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Prime\Stamp;
|
namespace Flasher\Prime\Stamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Controls notification persistence across requests.
|
|
||||||
*/
|
|
||||||
final readonly class HopsStamp implements StampInterface
|
final readonly class HopsStamp implements StampInterface
|
||||||
{
|
{
|
||||||
public function __construct(private int $amount)
|
public function __construct(private int $amount)
|
||||||
|
|||||||
@@ -6,9 +6,6 @@ namespace Flasher\Prime\Stamp;
|
|||||||
|
|
||||||
use Flasher\Prime\Notification\Envelope;
|
use Flasher\Prime\Notification\Envelope;
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides a unique identifier for notifications.
|
|
||||||
*/
|
|
||||||
final readonly class IdStamp implements PresentableStampInterface, StampInterface
|
final readonly class IdStamp implements PresentableStampInterface, StampInterface
|
||||||
{
|
{
|
||||||
private string $id;
|
private string $id;
|
||||||
@@ -23,8 +20,6 @@ final readonly class IdStamp implements PresentableStampInterface, StampInterfac
|
|||||||
try {
|
try {
|
||||||
return bin2hex(random_bytes(16));
|
return bin2hex(random_bytes(16));
|
||||||
} catch (\Exception) {
|
} catch (\Exception) {
|
||||||
// Handle the exception or fallback to another method of ID generation
|
|
||||||
// For example, using uniqid() as a fallback
|
|
||||||
return uniqid('', true);
|
return uniqid('', true);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Prime\Stamp;
|
namespace Flasher\Prime\Stamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Associates a notification with a predefined template.
|
|
||||||
*/
|
|
||||||
final readonly class PresetStamp implements StampInterface
|
final readonly class PresetStamp implements StampInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Prime\Stamp;
|
namespace Flasher\Prime\Stamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Controls notification priority for ordering.
|
|
||||||
*/
|
|
||||||
final readonly class PriorityStamp implements OrderableStampInterface, PresentableStampInterface, StampInterface
|
final readonly class PriorityStamp implements OrderableStampInterface, PresentableStampInterface, StampInterface
|
||||||
{
|
{
|
||||||
public function __construct(private int $priority)
|
public function __construct(private int $priority)
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Prime\Stamp;
|
namespace Flasher\Prime\Stamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Provides translation parameters and locale for a notification.
|
|
||||||
*/
|
|
||||||
final readonly class TranslationStamp implements StampInterface
|
final readonly class TranslationStamp implements StampInterface
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Prime\Stamp;
|
namespace Flasher\Prime\Stamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Controls conditional suppression of notifications.
|
|
||||||
*/
|
|
||||||
final readonly class UnlessStamp implements StampInterface
|
final readonly class UnlessStamp implements StampInterface
|
||||||
{
|
{
|
||||||
public function __construct(private bool $condition)
|
public function __construct(private bool $condition)
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace Flasher\Prime\Stamp;
|
namespace Flasher\Prime\Stamp;
|
||||||
|
|
||||||
/**
|
|
||||||
* Controls conditional display of notifications.
|
|
||||||
*/
|
|
||||||
final readonly class WhenStamp implements StampInterface
|
final readonly class WhenStamp implements StampInterface
|
||||||
{
|
{
|
||||||
public function __construct(private bool $condition)
|
public function __construct(private bool $condition)
|
||||||
|
|||||||
@@ -1,30 +1,9 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
|
||||||
* PhpStorm Meta File - IDE Enhancement for SweetAlert2.
|
|
||||||
*
|
|
||||||
* This file provides PhpStorm with additional type information and method completion
|
|
||||||
* capabilities for the SweetAlert2 library. It's not loaded during runtime but is used
|
|
||||||
* exclusively by the IDE to improve developer experience.
|
|
||||||
*
|
|
||||||
* The file enhances code intelligence in several ways:
|
|
||||||
* 1. Adds expected arguments for SweetAlert functions and methods
|
|
||||||
* 2. Maps factory methods to their return types
|
|
||||||
*
|
|
||||||
* Design patterns:
|
|
||||||
* - Metadata: Provides additional information about code that's only used by tools
|
|
||||||
* - IDE Integration: Bridges the gap between dynamic PHP code and static analysis tools
|
|
||||||
*
|
|
||||||
* Note: This file is part of the development tooling and has no effect on runtime behavior.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace PHPSTORM_META;
|
namespace PHPSTORM_META;
|
||||||
|
|
||||||
// Define expected values for sweetalert function's type parameter
|
|
||||||
expectedArguments(\sweetalert(), 1, 'success', 'error', 'info', 'warning');
|
expectedArguments(\sweetalert(), 1, 'success', 'error', 'info', 'warning');
|
||||||
expectedArguments(\Flasher\SweetAlert\Prime\sweetalert(), 1, 'success', 'error', 'info', 'warning');
|
expectedArguments(\Flasher\SweetAlert\Prime\sweetalert(), 1, 'success', 'error', 'info', 'warning');
|
||||||
|
|
||||||
// Define expected values for various builder methods
|
|
||||||
expectedArguments(\Flasher\SweetAlert\Prime\SweetAlertBuilder::icon(), 0, 'warning', 'error', 'success', 'info', 'question');
|
expectedArguments(\Flasher\SweetAlert\Prime\SweetAlertBuilder::icon(), 0, 'warning', 'error', 'success', 'info', 'question');
|
||||||
expectedArguments(\Flasher\SweetAlert\Prime\SweetAlertBuilder::showClass(), 0, 'popup', 'backdrop', 'icon');
|
expectedArguments(\Flasher\SweetAlert\Prime\SweetAlertBuilder::showClass(), 0, 'popup', 'backdrop', 'icon');
|
||||||
expectedArguments(\Flasher\SweetAlert\Prime\SweetAlertBuilder::hideClass(), 0, 'popup', 'backdrop', 'icon');
|
expectedArguments(\Flasher\SweetAlert\Prime\SweetAlertBuilder::hideClass(), 0, 'popup', 'backdrop', 'icon');
|
||||||
@@ -33,8 +12,6 @@ expectedArguments(\Flasher\SweetAlert\Prime\SweetAlertBuilder::position(), 0, 't
|
|||||||
expectedArguments(\Flasher\SweetAlert\Prime\SweetAlertBuilder::toast(), 1, 'top', 'top-start', 'top-end', 'center', 'center-start', 'center-end', 'bottom', 'bottom-start', 'bottom-end');
|
expectedArguments(\Flasher\SweetAlert\Prime\SweetAlertBuilder::toast(), 1, 'top', 'top-start', 'top-end', 'center', 'center-start', 'center-end', 'bottom', 'bottom-start', 'bottom-end');
|
||||||
expectedArguments(\Flasher\SweetAlert\Prime\SweetAlertBuilder::grow(), 0, 'row', 'column', 'fullscreen', false);
|
expectedArguments(\Flasher\SweetAlert\Prime\SweetAlertBuilder::grow(), 0, 'row', 'column', 'fullscreen', false);
|
||||||
expectedArguments(\Flasher\SweetAlert\Prime\SweetAlertBuilder::customClass(), 0, 'container', 'popup', 'header', 'title', 'closeButton', 'icon', 'image', 'content', 'input', 'inputLabel', 'validationMessage', 'actions', 'confirmButton', 'denyButton', 'cancelButton', 'loader', 'footer');
|
expectedArguments(\Flasher\SweetAlert\Prime\SweetAlertBuilder::customClass(), 0, 'container', 'popup', 'header', 'title', 'closeButton', 'icon', 'image', 'content', 'input', 'inputLabel', 'validationMessage', 'actions', 'confirmButton', 'denyButton', 'cancelButton', 'loader', 'footer');
|
||||||
|
|
||||||
// Map factory methods to their return types
|
|
||||||
override(\Flasher\Prime\FlasherInterface::use(), map(['sweetalert' => \Flasher\SweetAlert\Prime\SweetAlertInterface::class]));
|
override(\Flasher\Prime\FlasherInterface::use(), map(['sweetalert' => \Flasher\SweetAlert\Prime\SweetAlertInterface::class]));
|
||||||
override(\Flasher\Prime\FlasherInterface::create(), map(['sweetalert' => \Flasher\SweetAlert\Prime\SweetAlertInterface::class]));
|
override(\Flasher\Prime\FlasherInterface::create(), map(['sweetalert' => \Flasher\SweetAlert\Prime\SweetAlertInterface::class]));
|
||||||
override(\Flasher\Prime\Container\FlasherContainer::create(), map(['flasher.sweetalert' => \Flasher\SweetAlert\Prime\SweetAlertInterface::class]));
|
override(\Flasher\Prime\Container\FlasherContainer::create(), map(['flasher.sweetalert' => \Flasher\SweetAlert\Prime\SweetAlertInterface::class]));
|
||||||
|
|||||||
@@ -1,41 +1,16 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
/**
|
|
||||||
* PhpStorm Meta File - IDE Enhancement for Toastr.
|
|
||||||
*
|
|
||||||
* This file provides PhpStorm with additional type information and method completion
|
|
||||||
* capabilities for the Toastr library. It's not loaded during runtime but is used
|
|
||||||
* exclusively by the IDE to improve developer experience.
|
|
||||||
*
|
|
||||||
* The file enhances code intelligence in several ways:
|
|
||||||
* 1. Adds expected arguments for Toastr functions and methods
|
|
||||||
* 2. Maps factory methods to their return types
|
|
||||||
*
|
|
||||||
* Design patterns:
|
|
||||||
* - Metadata: Provides additional information about code that's only used by tools
|
|
||||||
* - IDE Integration: Bridges the gap between dynamic PHP code and static analysis tools
|
|
||||||
*
|
|
||||||
* Note: This file is part of the development tooling and has no effect on runtime behavior.
|
|
||||||
*/
|
|
||||||
|
|
||||||
namespace PHPSTORM_META;
|
namespace PHPSTORM_META;
|
||||||
|
|
||||||
// Define expected values for toastr function's type parameter
|
|
||||||
expectedArguments(\toastr(), 1, 'success', 'error', 'info', 'warning');
|
expectedArguments(\toastr(), 1, 'success', 'error', 'info', 'warning');
|
||||||
expectedArguments(\Flasher\Toastr\Prime\toastr(), 1, 'success', 'error', 'info', 'warning');
|
expectedArguments(\Flasher\Toastr\Prime\toastr(), 1, 'success', 'error', 'info', 'warning');
|
||||||
|
|
||||||
// Define expected values for various builder methods
|
|
||||||
expectedArguments(\Flasher\Toastr\Prime\ToastrBuilder::showMethod(), 0, 'fadeIn', 'fadeOut', 'slideDown', 'show');
|
expectedArguments(\Flasher\Toastr\Prime\ToastrBuilder::showMethod(), 0, 'fadeIn', 'fadeOut', 'slideDown', 'show');
|
||||||
expectedArguments(\Flasher\Toastr\Prime\ToastrBuilder::hideMethod(), 0, 'fadeIn', 'fadeOut', 'slideDown', 'show');
|
expectedArguments(\Flasher\Toastr\Prime\ToastrBuilder::hideMethod(), 0, 'fadeIn', 'fadeOut', 'slideDown', 'show');
|
||||||
expectedArguments(\Flasher\Toastr\Prime\ToastrBuilder::showEasing(), 0, 'swing', 'linear');
|
expectedArguments(\Flasher\Toastr\Prime\ToastrBuilder::showEasing(), 0, 'swing', 'linear');
|
||||||
expectedArguments(\Flasher\Toastr\Prime\ToastrBuilder::hideEasing(), 0, 'swing', 'linear');
|
expectedArguments(\Flasher\Toastr\Prime\ToastrBuilder::hideEasing(), 0, 'swing', 'linear');
|
||||||
expectedArguments(\Flasher\Toastr\Prime\ToastrBuilder::timeOut(), 0, 0, 3000, 5000, 9000);
|
expectedArguments(\Flasher\Toastr\Prime\ToastrBuilder::timeOut(), 0, 0, 3000, 5000, 9000);
|
||||||
expectedArguments(\Flasher\Toastr\Prime\ToastrBuilder::positionClass(), 0, 'toast-top-right', 'toast-top-center', 'toast-bottom-center', 'toast-top-full-width', 'toast-bottom-full-width', 'toast-top-left', 'toast-bottom-right', 'toast-bottom-left');
|
expectedArguments(\Flasher\Toastr\Prime\ToastrBuilder::positionClass(), 0, 'toast-top-right', 'toast-top-center', 'toast-bottom-center', 'toast-top-full-width', 'toast-bottom-full-width', 'toast-top-left', 'toast-bottom-right', 'toast-bottom-left');
|
||||||
|
|
||||||
// Map factory methods to their return types
|
|
||||||
override(\Flasher\Prime\FlasherInterface::use(), map(['toastr' => \Flasher\Toastr\Prime\ToastrInterface::class]));
|
override(\Flasher\Prime\FlasherInterface::use(), map(['toastr' => \Flasher\Toastr\Prime\ToastrInterface::class]));
|
||||||
override(\Flasher\Prime\FlasherInterface::create(), map(['toastr' => \Flasher\Toastr\Prime\ToastrInterface::class]));
|
override(\Flasher\Prime\FlasherInterface::create(), map(['toastr' => \Flasher\Toastr\Prime\ToastrInterface::class]));
|
||||||
override(\Flasher\Prime\Container\FlasherContainer::create(), map(['flasher.toastr' => \Flasher\Toastr\Prime\ToastrInterface::class]));
|
override(\Flasher\Prime\Container\FlasherContainer::create(), map(['flasher.toastr' => \Flasher\Toastr\Prime\ToastrInterface::class]));
|
||||||
|
|
||||||
// Define expected option names for the option method
|
|
||||||
expectedArguments(\Flasher\Toastr\Prime\ToastrBuilder::option(), 0, 'closeButton', 'closeClass', 'closeDuration', 'closeEasing', 'closeHtml', 'closeMethod', 'closeOnHover', 'containerId', 'debug', 'escapeHtml', 'extendedTimeOut', 'hideDuration', 'hideEasing', 'hideMethod', 'iconClass', 'messageClass', 'newestOnTop', 'onHidden', 'onShown', 'positionClass', 'preventDuplicates', 'progressBar', 'progressClass', 'rtl', 'showDuration', 'showEasing', 'showMethod', 'tapToDismiss', 'target', 'timeOut', 'titleClass', 'toastClass');
|
expectedArguments(\Flasher\Toastr\Prime\ToastrBuilder::option(), 0, 'closeButton', 'closeClass', 'closeDuration', 'closeEasing', 'closeHtml', 'closeMethod', 'closeOnHover', 'containerId', 'debug', 'escapeHtml', 'extendedTimeOut', 'hideDuration', 'hideEasing', 'hideMethod', 'iconClass', 'messageClass', 'newestOnTop', 'onHidden', 'onShown', 'positionClass', 'preventDuplicates', 'progressBar', 'progressClass', 'rtl', 'showDuration', 'showEasing', 'showMethod', 'tapToDismiss', 'target', 'timeOut', 'titleClass', 'toastClass');
|
||||||
|
|||||||
Reference in New Issue
Block a user