mirror of
https://github.com/php-flasher/php-flasher.git
synced 2026-03-31 15:07:47 +01:00
update namespaces
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Notyf\Prime;
|
||||
|
||||
use Flasher\Prime\Notification\Notification;
|
||||
|
||||
final class Notyf extends Notification
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Notyf\Prime;
|
||||
|
||||
use Flasher\Prime\Notification\NotificationBuilder;
|
||||
|
||||
/**
|
||||
* @method Pnotify getNotification()
|
||||
*/
|
||||
final class NotyfBuilder extends NotificationBuilder
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Notyf\Prime;
|
||||
|
||||
use Flasher\Prime\Factory\AbstractFactory;
|
||||
|
||||
final class NotyfFactory extends AbstractFactory
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function createNotification()
|
||||
{
|
||||
return new Pnotify();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function createNotificationBuilder()
|
||||
{
|
||||
return new PnotifyBuilder($this->getEventDispatcher(), $this->createNotification(), 'notyf');
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function supports($name = null, array $context = array())
|
||||
{
|
||||
return in_array($name, array(__CLASS__, 'notyf'));
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Notyf\Prime\Renderer;
|
||||
namespace Flasher\Notyf\Prime;
|
||||
|
||||
use Flasher\Prime\Config\ConfigInterface;
|
||||
use Flasher\Prime\Envelope;
|
||||
use Flasher\Prime\Renderer\HasGlobalOptionsInterface;
|
||||
use Flasher\Prime\Renderer\HasOptionsInterface;
|
||||
use Flasher\Prime\Renderer\HasScriptsInterface;
|
||||
use Flasher\Prime\Renderer\HasStylesInterface;
|
||||
use Flasher\Prime\Renderer\RendererInterface;
|
||||
|
||||
class NotyfRenderer implements RendererInterface, HasScriptsInterface, HasStylesInterface, HasGlobalOptionsInterface
|
||||
final class NotyfRenderer implements RendererInterface, HasScriptsInterface, HasStylesInterface, HasOptionsInterface
|
||||
{
|
||||
/**
|
||||
* @var ConfigInterface
|
||||
@@ -44,8 +44,7 @@ class NotyfRenderer implements RendererInterface, HasScriptsInterface, HasStyles
|
||||
*/
|
||||
public function render(Envelope $envelope)
|
||||
{
|
||||
$context = $envelope->getContext();
|
||||
$options = isset($context['options']) ? $context['options'] : array();
|
||||
$options = $envelope->getOptions();
|
||||
|
||||
$options['message'] = $envelope->getMessage();
|
||||
$options['type'] = $envelope->getType();
|
||||
@@ -73,4 +72,14 @@ class NotyfRenderer implements RendererInterface, HasScriptsInterface, HasStyles
|
||||
{
|
||||
return sprintf('if ("undefined" === typeof notyf) { var notyf = new Notyf(%s); }', json_encode($this->options));
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function supports($name = null, array $context = array())
|
||||
{
|
||||
return in_array($name, array(__CLASS__, 'notyf', 'Flasher\Notyf\Prime\NotyfFactory',
|
||||
'Flasher\Notyf\Prime\Pnotify'
|
||||
));
|
||||
}
|
||||
}
|
||||
@@ -1,14 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Notyf\Prime\Factory;
|
||||
|
||||
final class NotyfProducer extends \Flasher\Prime\AbstractFlasher
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getRenderer()
|
||||
{
|
||||
return 'notyf';
|
||||
}
|
||||
}
|
||||
+6
-6
@@ -26,19 +26,19 @@
|
||||
"license": "MIT",
|
||||
"require": {
|
||||
"php": ">=5.3",
|
||||
"php-flasher/flasher": "^1.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "4.8.36"
|
||||
"php-flasher/flasher": "dev-main"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Flasher\\Notyf\\": "src"
|
||||
"Flasher\\Notyf\\Prime\\": "",
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Flasher\\Notyf\\Tests\\": "tests/"
|
||||
"Flasher\\Notyf\\prime\\Tests\\": "Tests/"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
|
||||
Reference in New Issue
Block a user