add phpdoc and phpstorm autocomplete

This commit is contained in:
Khoubza Younes
2020-12-06 06:23:34 +01:00
parent 97e32a6a6e
commit 22290e02b6
5 changed files with 81 additions and 6 deletions
+12 -3
View File
@@ -4,11 +4,20 @@ namespace PHPSTORM_META;
use Flasher\Prime\Envelope;
use Flasher\Prime\Flasher;
use Flasher\Prime\Notification\NotificationInterface;
use Flasher\Prime\Presenter\PresenterManager;
use Flasher\Prime\Renderer\RendererManager;
override(Envelope::get(), type(0));
override(ManagerInterface::make(0), map(['' => '@']));
override(Flasher::make(''), map(['' => '@']));
override(RendererManager::make(''), map(['' => '@']));
override(PresenterManager::make(''), map(['' => '@']));
registerArgumentsSet('notificationTypes',
NotificationInterface::TYPE_SUCCESS,
NotificationInterface::TYPE_ERROR,
NotificationInterface::TYPE_INFO,
NotificationInterface::TYPE_INFO,
);
expectedArguments(NotificationBuilder::type(), 1, argumentsSet('notificationTypes'));
expectedReturnValues(NotificationInterface::setType(), 1, argumentsSet('notificationTypes'));
expectedReturnValues(NotificationInterface::getType(), argumentsSet('notificationTypes'));
+7
View File
@@ -2,11 +2,13 @@
namespace Flasher\Prime\Factory;
use Flasher\Prime\Envelope;
use Flasher\Prime\EventDispatcher\EventDispatcherInterface;
use Flasher\Prime\Notification\Notification;
use Flasher\Prime\Notification\NotificationBuilder;
use Flasher\Prime\Notification\NotificationBuilderInterface;
use Flasher\Prime\Notification\NotificationInterface;
use Flasher\Prime\Stamp\StampInterface;
/**
* @method NotificationBuilderInterface type($type, $message = null, array $options = array())
@@ -14,6 +16,9 @@ use Flasher\Prime\Notification\NotificationInterface;
* @method NotificationBuilderInterface options($options)
* @method NotificationBuilderInterface setOption($name, $value)
* @method NotificationBuilderInterface unsetOption($name)
* @method NotificationBuilderInterface handler(string $handler)
* @method NotificationBuilderInterface with(StampInterface[] $stamps)
* @method NotificationBuilderInterface withStamp(StampInterface $stamp)
* @method NotificationBuilderInterface priority($priority)
* @method NotificationBuilderInterface hops($amount)
* @method NotificationBuilderInterface keep()
@@ -21,7 +26,9 @@ use Flasher\Prime\Notification\NotificationInterface;
* @method NotificationBuilderInterface error($message = null, array $options = array())
* @method NotificationBuilderInterface info($message = null, array $options = array())
* @method NotificationBuilderInterface warning($message = null, array $options = array())
* @method Envelope dispatch(StampInterface[] $stamps)
* @method NotificationInterface getNotification()
* @method NotificationInterface getEnvelope()
*/
abstract class AbstractFactory implements FlasherFactoryInterface
{
@@ -8,6 +8,7 @@ use Flasher\Prime\EventDispatcher\EventDispatcherInterface;
use Flasher\Prime\Stamp\HandlerStamp;
use Flasher\Prime\Stamp\HopsStamp;
use Flasher\Prime\Stamp\PriorityStamp;
use Flasher\Prime\Stamp\StampInterface;
class NotificationBuilder implements NotificationBuilderInterface
{
@@ -186,7 +187,7 @@ class NotificationBuilder implements NotificationBuilderInterface
/**
* @inheritDoc
*/
public function with($stamps = array())
public function with(array $stamps = array())
{
$this->envelope->with($stamps);
@@ -196,9 +197,9 @@ class NotificationBuilder implements NotificationBuilderInterface
/**
* @inheritDoc
*/
public function withStamp($stamps = array())
public function withStamp(StampInterface $stamp)
{
$this->envelope->withStamp($stamps);
$this->envelope->withStamp($stamp);
return $this;
}
+6
View File
@@ -1,3 +1,9 @@
<?php
namespace PHPSTORM_META;
use Flasher\Toastr\Prime\ToastrBuilder;
expectedArguments(ToastrBuilder::showMethod(), 1, ['fadeIn', 'slideDown', 'show']);
expectedArguments(ToastrBuilder::showEasing(), 1, ['swing', 'linear']);
expectedArguments(ToastrBuilder::positionClass(), 1, ['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']);
+52
View File
@@ -3,7 +3,59 @@
namespace Flasher\Toastr\Prime;
use Flasher\Prime\Factory\AbstractFactory;
use Flasher\Prime\Notification\NotificationBuilderInterface;
use Flasher\Prime\Stamp\StampInterface;
/**
* @method ToastrBuilder type(string $type, string $message = null, array $options = array())
* @method ToastrBuilder message(string $message)
* @method ToastrBuilder options(array $options, bool $merge = true)
* @method ToastrBuilder setOption(string $name, $value)
* @method ToastrBuilder unsetOption(string $name)
* @method ToastrBuilder priority(int $priority)
* @method ToastrBuilder handler(string $handler)
* @method ToastrBuilder with(StampInterface[] $stamps)
* @method ToastrBuilder withStamp(StampInterface $stamp)
* @method ToastrBuilder hops(int $amount)
* @method ToastrBuilder keep()
* @method ToastrBuilder success(string $message = null, array $options = array())
* @method ToastrBuilder error(string $message = null, array $options = array())
* @method ToastrBuilder info(string $message = null, array $options = array())
* @method ToastrBuilder warning(string $message = null, array $options = array())
* @method ToastrBuilder title(string $title)
* @method ToastrBuilder closeButton(bool $closeButton = true)
* @method ToastrBuilder closeClass(string $closeClass)
* @method ToastrBuilder closeDuration(int $closeDuration)
* @method ToastrBuilder closeEasing(string $closeEasing)
* @method ToastrBuilder closeHtml(string $closeHtml)
* @method ToastrBuilder closeMethod(string $closeMethod)
* @method ToastrBuilder closeOnHover(bool $closeOnHover = true)
* @method ToastrBuilder containerId(string $containerId)
* @method ToastrBuilder debug(bool $debug = true)
* @method ToastrBuilder escapeHtml(bool $escapeHtml = true)
* @method ToastrBuilder extendedTimeOut(int $extendedTimeOut)
* @method ToastrBuilder hideDuration(int $hideDuration)
* @method ToastrBuilder hideEasing(string $hideEasing)
* @method ToastrBuilder hideMethod(string $hideMethod)
* @method ToastrBuilder iconClass(string $iconClass)
* @method ToastrBuilder messageClass(string $messageClass)
* @method ToastrBuilder newestOnTop(bool $newestOnTop = true)
* @method ToastrBuilder onHidden(string $onHidden)
* @method ToastrBuilder onShown(string $onShown)
* @method ToastrBuilder positionClass(string $positionClass)
* @method ToastrBuilder preventDuplicates(bool $preventDuplicates = true)
* @method ToastrBuilder progressBar(bool $progressBar = true)
* @method ToastrBuilder progressClass(string $progressClass)
* @method ToastrBuilder rtl(bool $rtl = true)
* @method ToastrBuilder showDuration(int $showDuration)
* @method ToastrBuilder showEasing(string $showEasing)
* @method ToastrBuilder showMethod(string $showMethod)
* @method ToastrBuilder tapToDismiss(bool $tapToDismiss = true)
* @method ToastrBuilder target(string $target)
* @method ToastrBuilder timeOut(int $timeOut)
* @method ToastrBuilder titleClass(string $titleClass)
* @method ToastrBuilder toastClass(string $toastClass)
*/
final class ToastrFactory extends AbstractFactory
{
/**