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:
+10
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Pnotify\Prime;
|
||||
|
||||
use Flasher\Prime\Notification\Notification;
|
||||
|
||||
final class Pnotify extends Notification
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Pnotify\Prime;
|
||||
|
||||
use Flasher\Prime\Notification\NotificationBuilder;
|
||||
|
||||
/**
|
||||
* @method Pnotify getNotification()
|
||||
*/
|
||||
final class PnotifyBuilder extends NotificationBuilder
|
||||
{
|
||||
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\Pnotify\Prime;
|
||||
|
||||
use Flasher\Prime\Factory\AbstractFactory;
|
||||
|
||||
final class PnotifyFactory extends AbstractFactory
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function createNotification()
|
||||
{
|
||||
return new Pnotify();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function createNotificationBuilder()
|
||||
{
|
||||
return new PnotifyBuilder($this->getEventDispatcher(), $this->createNotification(), 'pnotify');
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function supports($name = null, array $context = array())
|
||||
{
|
||||
return in_array($name, array(__CLASS__, 'pnotify'));
|
||||
}
|
||||
}
|
||||
@@ -1,15 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\PFlasher\Prime\Renderer;
|
||||
namespace Flasher\PFlasher\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 PnotifyRenderer implements RendererInterface, HasScriptsInterface, HasStylesInterface, HasGlobalOptionsInterface
|
||||
class PnotifyRenderer implements RendererInterface, HasScriptsInterface, HasStylesInterface, HasOptionsInterface
|
||||
{
|
||||
/**
|
||||
* @var ConfigInterface
|
||||
@@ -44,10 +44,8 @@ class PnotifyRenderer implements RendererInterface, HasScriptsInterface, HasStyl
|
||||
*/
|
||||
public function render(Envelope $envelope)
|
||||
{
|
||||
$context = $envelope->getContext();
|
||||
$options = isset($context['options']) ? $context['options'] : array();
|
||||
$options = $envelope->getOptions();
|
||||
|
||||
$options['title'] = " " . $envelope->getTitle();
|
||||
$options['text'] = $envelope->getMessage();
|
||||
$options['type'] = $envelope->getType();
|
||||
|
||||
@@ -74,4 +72,12 @@ class PnotifyRenderer implements RendererInterface, HasScriptsInterface, HasStyl
|
||||
{
|
||||
return sprintf('PNotify.defaults = %s;', json_encode($this->options));
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function supports($name = null, array $context = array())
|
||||
{
|
||||
return in_array($name, array(__CLASS__, 'pnotify', 'Flasher\Pnotify\Prime\PnotifyFactory', 'Flasher\Pnotify\Prime\Pnotify'));
|
||||
}
|
||||
}
|
||||
@@ -1,24 +0,0 @@
|
||||
<?php
|
||||
|
||||
namespace Flasher\PFlasher\Prime\TestsProducer;
|
||||
|
||||
use Flasher\Prime\AbstractFlasher;
|
||||
|
||||
final class PnotifyProducer extends AbstractFlasher
|
||||
{
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function getRenderer()
|
||||
{
|
||||
return 'pnotify';
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function warning($message, $title = '', $context = array(), array $stamps = array())
|
||||
{
|
||||
return $this->render('notice', $message, $title, $context, $stamps);
|
||||
}
|
||||
}
|
||||
+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\\Pnotify\\": "src"
|
||||
"Flasher\\Pnotify\\": "",
|
||||
"exclude-from-classmap": [
|
||||
"/Tests/"
|
||||
]
|
||||
}
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": {
|
||||
"Flasher\\Pnotify\\Tests\\": "tests/"
|
||||
"Flasher\\Pnotify\\Tests\\": "Tests/"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
|
||||
Reference in New Issue
Block a user