add phpdoc and phpstorm autocomplete

This commit is contained in:
Khoubza Younes
2020-12-06 06:23:34 +01:00
parent 71b7908f92
commit 708880d5fd
3 changed files with 23 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
{
+4 -3
View File
@@ -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;
}