diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/ecs.php b/ecs.php new file mode 100644 index 00000000..9fcf9bda --- /dev/null +++ b/ecs.php @@ -0,0 +1,39 @@ +parameters(); + + $parameters->set(Option::PATHS, [ + __DIR__ . '/src' + ]); + + $parameters->set(Option::SKIP, [ + PhpCsFixer\Fixer\ClassNotation\VisibilityRequiredFixer::class, + PhpCsFixer\Fixer\ControlStructure\YodaStyleFixer::class, + PhpCsFixer\Fixer\Whitespace\MethodChainingIndentationFixer::class, + PhpCsFixer\Fixer\Operator\NotOperatorWithSuccessorSpaceFixer::class, + Symplify\CodingStandard\Fixer\Spacing\MethodChainingNewlineFixer::class, + ]); + + $containerConfigurator->import(SetList::ARRAY); + $containerConfigurator->import(SetList::CLEAN_CODE); + $containerConfigurator->import(SetList::COMMENTS); + $containerConfigurator->import(SetList::COMMON); + $containerConfigurator->import(SetList::CONTROL_STRUCTURES); + $containerConfigurator->import(SetList::DOCBLOCK); + $containerConfigurator->import(SetList::NAMESPACES); + $containerConfigurator->import(SetList::PSR_12); + $containerConfigurator->import(SetList::SPACES); + $containerConfigurator->import(SetList::STRICT); + $containerConfigurator->import(SetList::SYMPLIFY); + + $services = $containerConfigurator->services(); + $services->set(PhpCsFixer\Fixer\ArrayNotation\ArraySyntaxFixer::class) + ->call('configure', [[ + 'syntax' => 'long', + ]]); +}; \ No newline at end of file diff --git a/src/Laravel/.phpcs.xml.dist b/src/Laravel/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/src/Laravel/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Laravel/Config/Config.php b/src/Laravel/Config/Config.php index 52ac8e3e..6bef240d 100644 --- a/src/Laravel/Config/Config.php +++ b/src/Laravel/Config/Config.php @@ -2,8 +2,8 @@ namespace Flasher\Laravel\Config; -use Illuminate\Config\Repository; use Flasher\Prime\Config\ConfigInterface; +use Illuminate\Config\Repository; final class Config implements ConfigInterface { @@ -19,6 +19,6 @@ final class Config implements ConfigInterface public function get($key, $default = null) { - return $this->config->get('flasher'.$this->separator.$key, $default); + return $this->config->get('flasher' . $this->separator . $key, $default); } } diff --git a/src/Laravel/Facade/Flasher.php b/src/Laravel/Facade/Flasher.php index 6b43215b..749fcf42 100644 --- a/src/Laravel/Facade/Flasher.php +++ b/src/Laravel/Facade/Flasher.php @@ -6,11 +6,8 @@ use Illuminate\Support\Facades\Facade; class Flasher extends Facade { - /** - * @inheritdoc - */ protected static function getFacadeAccessor() { return 'flasher'; } -} \ No newline at end of file +} diff --git a/src/Laravel/FlasherServiceProvider.php b/src/Laravel/FlasherServiceProvider.php index 8c0cd051..e93d4c1b 100644 --- a/src/Laravel/FlasherServiceProvider.php +++ b/src/Laravel/FlasherServiceProvider.php @@ -2,8 +2,8 @@ namespace Flasher\Laravel; -use Illuminate\Support\ServiceProvider; use Flasher\Laravel\ServiceProvider\ServiceProviderManager; +use Illuminate\Support\ServiceProvider; final class FlasherServiceProvider extends ServiceProvider { @@ -45,33 +45,21 @@ final class FlasherServiceProvider extends ServiceProvider return $this->app; } - /** - * {@inheritdoc} - */ public function mergeConfigFrom($path, $key) { parent::mergeConfigFrom($path, $key); } - /** - * {@inheritdoc} - */ public function publishes(array $paths, $groups = null) { parent::publishes($paths, $groups); } - /** - * {@inheritdoc} - */ public function loadTranslationsFrom($path, $namespace) { parent::loadTranslationsFrom($path, $namespace); } - /** - * {@inheritdoc} - */ public function loadViewsFrom($path, $namespace) { parent::loadViewsFrom($path, $namespace); diff --git a/src/Laravel/Middleware/SessionMiddleware.php b/src/Laravel/Middleware/SessionMiddleware.php index 82121e2c..cbaed177 100755 --- a/src/Laravel/Middleware/SessionMiddleware.php +++ b/src/Laravel/Middleware/SessionMiddleware.php @@ -26,11 +26,6 @@ final class SessionMiddleware */ private $renderer; - /** - * @param ConfigInterface $config - * @param FlasherInterface $flasher - * @param ResponseManagerInterface $renderer - */ public function __construct(ConfigInterface $config, FlasherInterface $flasher, ResponseManagerInterface $renderer) { $this->config = $config; @@ -41,16 +36,11 @@ final class SessionMiddleware /** * Run the request filter. * - * @param Request $request - * @param Closure $next - * * @return mixed */ public function handle(Request $request, Closure $next) { - /** - * @var Response $response - */ + /** @var Response $response */ $response = $next($request); if ($request->isXmlHttpRequest() || true !== $this->config->get('auto_create_from_session')) { @@ -76,7 +66,7 @@ final class SessionMiddleware $content = $response->getContent(); $htmlResponse = $this->renderer->render(array(), array( - 'format' => 'html', + 'format' => 'html', 'content' => $content, )); @@ -85,7 +75,7 @@ final class SessionMiddleware } $pos = strripos($content, ''); - $content = substr($content, 0, $pos).$htmlResponse.substr($content, $pos); + $content = substr($content, 0, $pos) . $htmlResponse . substr($content, $pos); $response->setContent($content); return $response; @@ -103,7 +93,7 @@ final class SessionMiddleware $type = $aliases; } - foreach ((array)$aliases as $alias) { + foreach ((array) $aliases as $alias) { $mapping[$alias] = $type; } } diff --git a/src/Laravel/Observer/FlasherModelObserver.php b/src/Laravel/Observer/FlasherModelObserver.php index 589a885b..26d995f4 100644 --- a/src/Laravel/Observer/FlasherModelObserver.php +++ b/src/Laravel/Observer/FlasherModelObserver.php @@ -24,11 +24,6 @@ final class FlasherModelObserver */ private $translator; - /** - * @param ConfigInterface $config - * @param FlasherInterface $flasher - * @param Translator $translator - */ public function __construct(ConfigInterface $config, FlasherInterface $flasher, Translator $translator) { $this->config = $config; @@ -38,10 +33,6 @@ final class FlasherModelObserver /** * Handle the Model "created" event. - * - * @param Model $model - * - * @return void */ public function created(Model $model) { @@ -50,10 +41,6 @@ final class FlasherModelObserver /** * Handle the Model "updated" event. - * - * @param Model $model - * - * @return void */ public function updated(Model $model) { @@ -62,10 +49,6 @@ final class FlasherModelObserver /** * Handle the Model "deleted" event. - * - * @param Model $model - * - * @return void */ public function deleted(Model $model) { @@ -74,10 +57,6 @@ final class FlasherModelObserver /** * Handle the Model "restored" event. - * - * @param Model $model - * - * @return void */ public function restored(Model $model) { @@ -86,10 +65,6 @@ final class FlasherModelObserver /** * Handle the Model "force deleted" event. - * - * @param Model $model - * - * @return void */ public function forceDeleted(Model $model) { @@ -98,16 +73,15 @@ final class FlasherModelObserver /** * @param string $method - * @param Model $model */ private function addFlash($method, Model $model) { $exludes = $this->config->get('observer_events.exclude', array()); - if (in_array($method, $exludes)) { + if (in_array($method, $exludes, true)) { return; } - if (isset($exludes[$method]) && in_array(get_class($model), $exludes[$method])) { + if (isset($exludes[$method]) && in_array(get_class($model), $exludes[$method], true)) { return; } @@ -115,7 +89,7 @@ final class FlasherModelObserver $message = $this->translator->get(sprintf('flasher::messages.flashable.%s.%s', get_class($model), $method)); } else { $message = $this->translator->get(sprintf('flasher::messages.flashable.default.%s', $method)); - $message = str_replace('{{ model }}', substr(strrchr(get_class($model), "\\"), 1), $message); + $message = str_replace('{{ model }}', substr(strrchr(get_class($model), '\\'), 1), $message); } $this->flasher->addSuccess($message); diff --git a/src/Laravel/Resources/config/config.php b/src/Laravel/Resources/config/config.php index 0ed02bea..92decca2 100644 --- a/src/Laravel/Resources/config/config.php +++ b/src/Laravel/Resources/config/config.php @@ -4,7 +4,7 @@ return array( 'default' => 'template', 'root_scripts' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher@0.1.3/dist/flasher.min.js' + 'https://cdn.jsdelivr.net/npm/@flasher/flasher@0.1.3/dist/flasher.min.js', ), 'template_factory' => array( @@ -14,12 +14,12 @@ return array( 'view' => 'flasher::tailwindcss', 'styles' => array( 'https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.1/base.min.css', - 'https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.1/utilities.css' + 'https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.1/utilities.css', ), ), 'tailwindcss_bg' => array( 'view' => 'flasher::tailwindcss_bg', - "styles" => array( + 'styles' => array( 'https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.1/base.min.css', 'https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.1/utilities.css', ), @@ -27,7 +27,7 @@ return array( 'bootstrap' => array( 'view' => 'flasher::bootstrap', 'styles' => array( - "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.3/css/bootstrap.min.css", + 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.3/css/bootstrap.min.css', ), ), ), @@ -37,9 +37,9 @@ return array( 'types_mapping' => array( 'success' => array('success'), - 'error' => array('error', 'danger'), + 'error' => array('error', 'danger'), 'warning' => array('warning', 'alarm'), - 'info' => array('info', 'notice', 'alert'), + 'info' => array('info', 'notice', 'alert'), ), 'observer_events' => array( diff --git a/src/Laravel/Resources/lang/en/messages.php b/src/Laravel/Resources/lang/en/messages.php index e826dd60..ab9fb320 100644 --- a/src/Laravel/Resources/lang/en/messages.php +++ b/src/Laravel/Resources/lang/en/messages.php @@ -3,10 +3,10 @@ return array( 'flashable' => array( 'default' => array( - 'created' => '{{ model }} has been created.', - 'updated' => '{{ model }} has been updated.', - 'deleted' => '{{ model }} has been deleted.', - 'restored' => '{{ model }} has been restored.', + 'created' => '{{ model }} has been created.', + 'updated' => '{{ model }} has been updated.', + 'deleted' => '{{ model }} has been deleted.', + 'restored' => '{{ model }} has been restored.', 'forceDeleted' => '{{ model }} has been deleted.', ), ), diff --git a/src/Laravel/ServiceProvider/Providers/Laravel.php b/src/Laravel/ServiceProvider/Providers/Laravel.php index c2a89c58..c7df15d5 100755 --- a/src/Laravel/ServiceProvider/Providers/Laravel.php +++ b/src/Laravel/ServiceProvider/Providers/Laravel.php @@ -29,43 +29,37 @@ class Laravel implements ServiceProviderInterface */ protected $app; - /** - * @param Container $app - */ public function __construct(Container $app) { $this->app = $app; } - /** - * @inheritDoc - */ public function shouldBeUsed() { return $this->app instanceof Application; } - /** - * @inheritDoc - */ public function boot(FlasherServiceProvider $provider) { - $provider->loadTranslationsFrom(flasher_path(__DIR__.'/../../Resources/lang'), 'flasher'); - $provider->loadViewsFrom(flasher_path(__DIR__.'/../../Resources/views'), 'flasher'); + $provider->loadTranslationsFrom(flasher_path(__DIR__ . '/../../Resources/lang'), 'flasher'); + $provider->loadViewsFrom(flasher_path(__DIR__ . '/../../Resources/views'), 'flasher'); - $provider->publishes(array(flasher_path(__DIR__.'/../../Resources/config/config.php') => config_path('flasher.php')), 'flasher-config'); - $provider->publishes(array(flasher_path(__DIR__.'/../../Resources/lang') => resource_path(flasher_path('lang/vendor/flasher'))), 'flasher-lang'); - $provider->publishes(array(flasher_path(__DIR__.'/../../Resources/views') => resource_path(flasher_path('views/vendor/flasher'))), 'flasher-views'); + $provider->publishes(array( + flasher_path(__DIR__ . '/../../Resources/config/config.php') => config_path('flasher.php'), + ), 'flasher-config'); + $provider->publishes(array( + flasher_path(__DIR__ . '/../../Resources/lang') => resource_path(flasher_path('lang/vendor/flasher')), + ), 'flasher-lang'); + $provider->publishes(array( + flasher_path(__DIR__ . '/../../Resources/views') => resource_path(flasher_path('views/vendor/flasher')), + ), 'flasher-views'); $this->registerBladeDirectives(); } - /** - * @inheritDoc - */ public function register(FlasherServiceProvider $provider) { - $provider->mergeConfigFrom(flasher_path(__DIR__.'/../../Resources/config/config.php'), 'flasher'); + $provider->mergeConfigFrom(flasher_path(__DIR__ . '/../../Resources/config/config.php'), 'flasher'); $this->app->singleton('flasher.config', function (Application $app) { return new Config($app['config'], '.'); @@ -89,13 +83,13 @@ class Laravel implements ServiceProviderInterface $templates = $app['flasher.config']->get('template_factory.templates', array()); foreach ($templates as $template => $factory) { if (isset($factory['scripts'])) { - $resourceManager->addScripts('template_'.$template, $factory['scripts']); + $resourceManager->addScripts('template_' . $template, $factory['scripts']); } if (isset($factory['styles'])) { - $resourceManager->addStyles('template_'.$template, $factory['styles']); + $resourceManager->addStyles('template_' . $template, $factory['styles']); } if (isset($factory['options'])) { - $resourceManager->addOptions('template_'.$template, $factory['options']); + $resourceManager->addOptions('template_' . $template, $factory['options']); } } @@ -103,7 +97,11 @@ class Laravel implements ServiceProviderInterface }); $this->app->singleton('flasher.response_manager', function (Application $app) { - $responseManager = new ResponseManager($app['flasher.storage_manager'], $app['flasher.event_dispatcher'], $app['flasher.resource_manager']); + $responseManager = new ResponseManager( + $app['flasher.storage_manager'], + $app['flasher.event_dispatcher'], + $app['flasher.resource_manager'] + ); $responseManager->addPresenter('html', new HtmlPresenter()); $responseManager->addPresenter('array', new ArrayPresenter()); @@ -152,7 +150,6 @@ class Laravel implements ServiceProviderInterface $this->app->alias('flasher.notification_factory', 'Flasher\Prime\Factory\NotificationFactory'); $this->app->alias('Flasher\Prime\Factory\NotificationFactory', 'flasher.template'); - $this->app->bind('Flasher\Prime\Config\ConfigInterface', 'flasher.config'); $this->app->bind('Flasher\Prime\FlasherInterface', 'flasher'); $this->app->bind('Flasher\Prime\Storage\StorageManagerInterface', 'flasher.storage_manager'); @@ -166,24 +163,24 @@ class Laravel implements ServiceProviderInterface protected function registerBladeDirectives() { - $startsWith = function($haystack, $needle) { + $startsWith = function ($haystack, $needle) { return substr_compare($haystack, $needle, 0, strlen($needle)) === 0; }; - $endsWith = function($haystack, $needle) { + $endsWith = function ($haystack, $needle) { return substr_compare($haystack, $needle, -strlen($needle)) === 0; }; - Blade::directive('flasher_render', function ($criteria = array()) use($startsWith, $endsWith) { - if (!empty($criteria) && $startsWith($criteria, "(") && $endsWith($criteria, ")")) { + Blade::directive('flasher_render', function ($criteria = array()) use ($startsWith, $endsWith) { + if (!empty($criteria) && $startsWith($criteria, '(') && $endsWith($criteria, ')')) { $criteria = substr($criteria, 1, -1); } if (empty($criteria)) { - $criteria = "array()"; + $criteria = 'array()'; } - return "render($criteria, 'html'); ?>"; + return "render(${criteria}, 'html'); ?>"; }); } } diff --git a/src/Laravel/ServiceProvider/Providers/Laravel4.php b/src/Laravel/ServiceProvider/Providers/Laravel4.php index d4df3024..85e0ada4 100644 --- a/src/Laravel/ServiceProvider/Providers/Laravel4.php +++ b/src/Laravel/ServiceProvider/Providers/Laravel4.php @@ -10,27 +10,18 @@ use Illuminate\View\Compilers\BladeCompiler; final class Laravel4 extends Laravel { - /** - * @inheritDoc - */ public function shouldBeUsed() { return $this->app instanceof Application && 0 === strpos(Application::VERSION, '4.'); } - /** - * @inheritDoc - */ public function boot(FlasherServiceProvider $provider) { - $provider->package('php-flasher/flasher-laravel', 'flasher', flasher_path(__DIR__.'/../../Resources')); + $provider->package('php-flasher/flasher-laravel', 'flasher', flasher_path(__DIR__ . '/../../Resources')); $this->registerBladeDirectives(); } - /** - * @inheritDoc - */ public function register(FlasherServiceProvider $provider) { $this->app->singleton('flasher.config', function (Application $app) { diff --git a/src/Laravel/ServiceProvider/Providers/Laravel50.php b/src/Laravel/ServiceProvider/Providers/Laravel50.php index ff209777..18138ae5 100644 --- a/src/Laravel/ServiceProvider/Providers/Laravel50.php +++ b/src/Laravel/ServiceProvider/Providers/Laravel50.php @@ -9,31 +9,27 @@ use Illuminate\View\Compilers\BladeCompiler; final class Laravel50 extends Laravel { - /** - * @inheritDoc - */ public function shouldBeUsed() { return $this->app instanceof Application && 0 === strpos(Application::VERSION, '5.0'); } - /** - * @inheritDoc - */ public function boot(FlasherServiceProvider $provider) { - $provider->publishes(array(flasher_path(__DIR__.'/../../Resources/lang') => base_path(flasher_path('resources/lang/vendor/flasher')))); + $provider->publishes(array( + flasher_path(__DIR__ . '/../../Resources/lang') => base_path(flasher_path('resources/lang/vendor/flasher')), + )); $this->registerBladeDirectives(); } protected function registerBladeDirectives() { - $startsWith = function($haystack, $needle) { + $startsWith = function ($haystack, $needle) { return substr_compare($haystack, $needle, 0, strlen($needle)) === 0; }; - $endsWith = function($haystack, $needle) { + $endsWith = function ($haystack, $needle) { return substr_compare($haystack, $needle, -strlen($needle)) === 0; }; @@ -45,15 +41,19 @@ final class Laravel50 extends Laravel $value = $matches[2]; - if (!empty($value) && $startsWith($value, "(") && $endsWith($value, ")")) { + if (!empty($value) && $startsWith($value, '(') && $endsWith($value, ')')) { $value = substr($value, 1, -1); } if (empty($value)) { - $value = "array()"; + $value = 'array()'; } - return str_replace("%criteria%", $value, $matches[1] . "render(%criteria%, 'html'); ?>"); + return str_replace( + '%criteria%', + $value, + $matches[1] . "render(%criteria%, 'html'); ?>" + ); }); } } diff --git a/src/Laravel/ServiceProvider/Providers/Laravel51.php b/src/Laravel/ServiceProvider/Providers/Laravel51.php index b5e69cf3..046a84aa 100644 --- a/src/Laravel/ServiceProvider/Providers/Laravel51.php +++ b/src/Laravel/ServiceProvider/Providers/Laravel51.php @@ -7,20 +7,16 @@ use Illuminate\Foundation\Application; final class Laravel51 extends Laravel { - /** - * @inheritDoc - */ public function shouldBeUsed() { return $this->app instanceof Application && 0 === strpos(Application::VERSION, '5.1'); } - /** - * @inheritDoc - */ public function boot(FlasherServiceProvider $provider) { - $provider->publishes(array(flasher_path(__DIR__.'/../../Resources/lang') => base_path(flasher_path('resources/lang/vendor/flasher')))); + $provider->publishes(array( + flasher_path(__DIR__ . '/../../Resources/lang') => base_path(flasher_path('resources/lang/vendor/flasher')), + )); $this->registerBladeDirectives(); } diff --git a/src/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php b/src/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php index 780b4767..d1d275d0 100644 --- a/src/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php +++ b/src/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php @@ -11,13 +11,7 @@ interface ServiceProviderInterface */ public function shouldBeUsed(); - /** - * @param FlasherServiceProvider $provider - */ public function boot(FlasherServiceProvider $provider); - /** - * @param FlasherServiceProvider $provider - */ public function register(FlasherServiceProvider $provider); } diff --git a/src/Laravel/ServiceProvider/ResourceManagerHelper.php b/src/Laravel/ServiceProvider/ResourceManagerHelper.php index 62f5212a..65459507 100644 --- a/src/Laravel/ServiceProvider/ResourceManagerHelper.php +++ b/src/Laravel/ServiceProvider/ResourceManagerHelper.php @@ -9,7 +9,6 @@ final class ResourceManagerHelper /** * @param string $alias * @param array $config - * @param ResourceManager $responseManager */ public static function process(ResourceManager $responseManager, $alias, $config = null) { @@ -51,4 +50,4 @@ final class ResourceManagerHelper { return isset($config['options']) ? $config['options'] : array(); } -} \ No newline at end of file +} diff --git a/src/Laravel/Storage/Storage.php b/src/Laravel/Storage/Storage.php index c9764e34..149f9df2 100644 --- a/src/Laravel/Storage/Storage.php +++ b/src/Laravel/Storage/Storage.php @@ -25,17 +25,11 @@ final class Storage implements StorageInterface $this->session = $session; } - /** - * @inheritDoc - */ public function all() { return $this->session->get(self::ENVELOPES_NAMESPACE, array()); } - /** - * @inheritDoc - */ public function add($envelopes) { $envelopes = is_array($envelopes) ? $envelopes : func_get_args(); @@ -43,9 +37,6 @@ final class Storage implements StorageInterface $this->session->put(self::ENVELOPES_NAMESPACE, array_merge($this->all(), $envelopes)); } - /** - * @inheritDoc - */ public function update($envelopes) { $envelopes = is_array($envelopes) ? $envelopes : func_get_args(); @@ -65,9 +56,6 @@ final class Storage implements StorageInterface $this->session->put(self::ENVELOPES_NAMESPACE, $store); } - /** - * @inheritDoc - */ public function remove($envelopes) { $envelopes = is_array($envelopes) ? $envelopes : func_get_args(); @@ -83,9 +71,6 @@ final class Storage implements StorageInterface $this->session->put(self::ENVELOPES_NAMESPACE, $store); } - /** - * @inheritDoc - */ public function clear() { $this->session->put(self::ENVELOPES_NAMESPACE, array()); diff --git a/src/Laravel/Template/BladeEngine.php b/src/Laravel/Template/BladeEngine.php index 8c4ec61d..d5c39aa6 100644 --- a/src/Laravel/Template/BladeEngine.php +++ b/src/Laravel/Template/BladeEngine.php @@ -19,9 +19,6 @@ final class BladeEngine implements EngineInterface $this->engine = $engine; } - /** - * @inheritDoc - */ public function render($name, array $context = array()) { return (string) $this->engine->make($name, $context); diff --git a/src/Laravel/Tests/Config/ConfigTest.php b/src/Laravel/Tests/Config/ConfigTest.php index 61c6370d..5e90c763 100644 --- a/src/Laravel/Tests/Config/ConfigTest.php +++ b/src/Laravel/Tests/Config/ConfigTest.php @@ -13,7 +13,7 @@ final class ConfigTest extends TestCase $separator = $this->isLaravel4() ? '::' : '.'; $config = new Config($this->app->make('config'), $separator); - $this->assertEquals('template', $config->get('default')); + $this->assertSame('template', $config->get('default')); } private function isLaravel4() diff --git a/src/Laravel/Tests/FlasherServiceProviderTest.php b/src/Laravel/Tests/FlasherServiceProviderTest.php index ca058c4d..a9f87fe0 100644 --- a/src/Laravel/Tests/FlasherServiceProviderTest.php +++ b/src/Laravel/Tests/FlasherServiceProviderTest.php @@ -11,10 +11,16 @@ final class FlasherServiceProviderTest extends TestCase $this->assertInstanceOf('Flasher\Laravel\Config\Config', $this->app->make('flasher.config')); $this->assertInstanceOf('Flasher\Prime\Flasher', $this->app->make('flasher')); $this->assertInstanceOf('Flasher\Prime\Response\ResponseManager', $this->app->make('flasher.response_manager')); - $this->assertInstanceOf('Flasher\Prime\Response\Resource\ResourceManager', $this->app->make('flasher.resource_manager')); + $this->assertInstanceOf( + 'Flasher\Prime\Response\Resource\ResourceManager', + $this->app->make('flasher.resource_manager') + ); $this->assertInstanceOf('Flasher\Laravel\Storage\Storage', $this->app->make('flasher.storage')); $this->assertInstanceOf('Flasher\Prime\Storage\StorageManager', $this->app->make('flasher.storage_manager')); - $this->assertInstanceOf('Flasher\Prime\EventDispatcher\EventDispatcher', $this->app->make('flasher.event_dispatcher')); + $this->assertInstanceOf( + 'Flasher\Prime\EventDispatcher\EventDispatcher', + $this->app->make('flasher.event_dispatcher') + ); $this->assertInstanceOf('Flasher\Prime\Filter\Filter', $this->app->make('flasher.filter')); } @@ -23,9 +29,21 @@ final class FlasherServiceProviderTest extends TestCase /** @var BladeCompiler $blade */ $blade = $this->app->make('view')->getEngineResolver()->resolve('blade')->getCompiler(); - $this->assertEquals("render(array(), 'html'); ?>", $blade->compileString('@flasher_render')); - $this->assertEquals("render(array(), 'html'); ?>", $blade->compileString('@flasher_render()')); - $this->assertEquals("render(array(), 'html'); ?>", $blade->compileString('@flasher_render(array())')); - $this->assertEquals("render(array(\"priority\" => array(\"min\" => 4, \"max\" => 5)), 'html'); ?>", $blade->compileString('@flasher_render(array("priority" => array("min" => 4, "max" => 5)))')); + $this->assertSame( + "render(array(), 'html'); ?>", + $blade->compileString('@flasher_render') + ); + $this->assertSame( + "render(array(), 'html'); ?>", + $blade->compileString('@flasher_render()') + ); + $this->assertSame( + "render(array(), 'html'); ?>", + $blade->compileString('@flasher_render(array())') + ); + $this->assertSame( + "render(array(\"priority\" => array(\"min\" => 4, \"max\" => 5)), 'html'); ?>", + $blade->compileString('@flasher_render(array("priority" => array("min" => 4, "max" => 5)))') + ); } } diff --git a/src/Laravel/Tests/Storage/StorageTest.php b/src/Laravel/Tests/Storage/StorageTest.php index e39d633a..9fc12a48 100644 --- a/src/Laravel/Tests/Storage/StorageTest.php +++ b/src/Laravel/Tests/Storage/StorageTest.php @@ -57,8 +57,10 @@ final class StorageTest extends TestCase $storage->update($envelopes[1]); $this->assertSame($envelopes, $storage->all()); - $this->assertInstanceOf('Flasher\Prime\Stamp\PriorityStamp', - $envelopes[1]->get('Flasher\Prime\Stamp\PriorityStamp')); + $this->assertInstanceOf( + 'Flasher\Prime\Stamp\PriorityStamp', + $envelopes[1]->get('Flasher\Prime\Stamp\PriorityStamp') + ); } public function testRemoveEnvelopes() diff --git a/src/Laravel/helpers.php b/src/Laravel/helpers.php index b61789ae..6ed1f4dc 100644 --- a/src/Laravel/helpers.php +++ b/src/Laravel/helpers.php @@ -5,14 +5,12 @@ if (!function_exists('flasher')) { * @param string $message * @param string $type * @param string $title - * @param array $options - * @param array $stamps * * @return \Flasher\Prime\Flasher */ function flasher($message = null, $type = 'success', $title = '', array $options = array(), array $stamps = array()) { - if (is_null($message) && 0 === func_num_args()) { + if (null === $message && 0 === func_num_args()) { return app('flasher.factory'); } diff --git a/src/Noty/Laravel/.phpcs.xml.dist b/src/Noty/Laravel/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/src/Noty/Laravel/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Noty/Laravel/Facade/Noty.php b/src/Noty/Laravel/Facade/Noty.php index 3ba2177d..d8730282 100644 --- a/src/Noty/Laravel/Facade/Noty.php +++ b/src/Noty/Laravel/Facade/Noty.php @@ -6,11 +6,8 @@ use Illuminate\Support\Facades\Facade; class Noty extends Facade { - /** - * @inheritdoc - */ protected static function getFacadeAccessor() { return 'flasher.noty'; } -} \ No newline at end of file +} diff --git a/src/Noty/Laravel/FlasherNotyServiceProvider.php b/src/Noty/Laravel/FlasherNotyServiceProvider.php index 0a3ba574..b8158c83 100644 --- a/src/Noty/Laravel/FlasherNotyServiceProvider.php +++ b/src/Noty/Laravel/FlasherNotyServiceProvider.php @@ -2,9 +2,9 @@ namespace Flasher\Noty\Laravel; +use Flasher\Noty\Laravel\ServiceProvider\ServiceProviderManager; use Illuminate\Container\Container; use Illuminate\Support\ServiceProvider; -use Flasher\Noty\Laravel\ServiceProvider\ServiceProviderManager; final class FlasherNotyServiceProvider extends ServiceProvider { @@ -43,17 +43,11 @@ final class FlasherNotyServiceProvider extends ServiceProvider return $this->app; } - /** - * {@inheritdoc} - */ public function mergeConfigFrom($path, $key) { parent::mergeConfigFrom($path, $key); } - /** - * {@inheritdoc} - */ public function publishes(array $paths, $groups = null) { parent::publishes($paths, $groups); diff --git a/src/Noty/Laravel/Resources/config/config.php b/src/Noty/Laravel/Resources/config/config.php index 9eb97bf4..9dd622cc 100644 --- a/src/Noty/Laravel/Resources/config/config.php +++ b/src/Noty/Laravel/Resources/config/config.php @@ -4,7 +4,7 @@ return array( 'scripts' => array( 'https://cdn.jsdelivr.net/npm/@flasher/flasher-noty@0.1.3/dist/flasher-noty.min.js', ), - 'styles' => array(), + 'styles' => array(), 'options' => array( 'timeout' => 5000, ), diff --git a/src/Noty/Laravel/Resources/functions/noty.php b/src/Noty/Laravel/Resources/functions/noty.php index 0b196323..3b727333 100644 --- a/src/Noty/Laravel/Resources/functions/noty.php +++ b/src/Noty/Laravel/Resources/functions/noty.php @@ -3,11 +3,10 @@ use Flasher\Prime\Notification\NotificationInterface; use Illuminate\Support\Facades\App; -if (! function_exists('noty')) { +if (!function_exists('noty')) { /** * @param string $message * @param string $type - * @param array $options * * @return \Flasher\Noty\Prime\NotyFactory */ @@ -19,4 +18,4 @@ if (! function_exists('noty')) { return App::make('flasher.noty')->addFlash($type, $message, $options); } -} \ No newline at end of file +} diff --git a/src/Noty/Laravel/ServiceProvider/Providers/Laravel.php b/src/Noty/Laravel/ServiceProvider/Providers/Laravel.php index 8e7a252c..45f8d052 100644 --- a/src/Noty/Laravel/ServiceProvider/Providers/Laravel.php +++ b/src/Noty/Laravel/ServiceProvider/Providers/Laravel.php @@ -3,9 +3,9 @@ namespace Flasher\Noty\Laravel\ServiceProvider\Providers; use Flasher\Laravel\ServiceProvider\ResourceManagerHelper; -use Flasher\Prime\Flasher; use Flasher\Noty\Laravel\FlasherNotyServiceProvider; use Flasher\Noty\Prime\NotyFactory; +use Flasher\Prime\Flasher; use Flasher\Prime\Response\Resource\ResourceManager; use Illuminate\Container\Container; use Illuminate\Foundation\Application; @@ -17,36 +17,26 @@ class Laravel implements ServiceProviderInterface */ protected $app; - /** - * @param Container $app - */ public function __construct(Container $app) { $this->app = $app; } - /** - * @inheritDoc - */ public function shouldBeUsed() { return $this->app instanceof Application; } - /** - * @inheritDoc - */ public function boot(FlasherNotyServiceProvider $provider) { - $provider->publishes(array(flasher_path(__DIR__.'/../../Resources/config/config.php') => config_path('flasher_noty.php')), 'flasher-config'); + $provider->publishes(array( + flasher_path(__DIR__ . '/../../Resources/config/config.php') => config_path('flasher_noty.php'), + ), 'flasher-config'); } - /** - * @inheritDoc - */ public function register(FlasherNotyServiceProvider $provider) { - $provider->mergeConfigFrom(flasher_path(__DIR__.'/../../Resources/config/config.php'), 'flasher_noty'); + $provider->mergeConfigFrom(flasher_path(__DIR__ . '/../../Resources/config/config.php'), 'flasher_noty'); $this->appendToFlasherConfig(); $this->registerServices(); diff --git a/src/Noty/Laravel/ServiceProvider/Providers/Laravel4.php b/src/Noty/Laravel/ServiceProvider/Providers/Laravel4.php index 4ab5934a..2b937345 100644 --- a/src/Noty/Laravel/ServiceProvider/Providers/Laravel4.php +++ b/src/Noty/Laravel/ServiceProvider/Providers/Laravel4.php @@ -7,26 +7,21 @@ use Illuminate\Foundation\Application; final class Laravel4 extends Laravel { - /** - * @inheritDoc - */ public function shouldBeUsed() { return $this->app instanceof Application && 0 === strpos(Application::VERSION, '4.'); } - /** - * @inheritDoc - */ public function boot(FlasherNotyServiceProvider $provider) { - $provider->package('php-flasher/flasher-noty-laravel', 'flasher_noty', flasher_path(__DIR__.'/../../Resources')); + $provider->package( + 'php-flasher/flasher-noty-laravel', + 'flasher_noty', + flasher_path(__DIR__ . '/../../Resources') + ); $this->appendToFlasherConfig(); } - /** - * @inheritDoc - */ public function register(FlasherNotyServiceProvider $provider) { $this->registerServices(); diff --git a/src/Noty/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php b/src/Noty/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php index 10cfcfac..740dc308 100644 --- a/src/Noty/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php +++ b/src/Noty/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php @@ -11,13 +11,7 @@ interface ServiceProviderInterface */ public function shouldBeUsed(); - /** - * @param FlasherNotyServiceProvider $provider - */ public function boot(FlasherNotyServiceProvider $provider); - /** - * @param FlasherNotyServiceProvider $provider - */ public function register(FlasherNotyServiceProvider $provider); } diff --git a/src/Noty/Laravel/Tests/TestCase.php b/src/Noty/Laravel/Tests/TestCase.php index e3b50cd2..c7148259 100644 --- a/src/Noty/Laravel/Tests/TestCase.php +++ b/src/Noty/Laravel/Tests/TestCase.php @@ -11,6 +11,52 @@ use Orchestra\Testbench\TestCase as Orchestra; class TestCase extends Orchestra { + public function createApplication() + { + if (0 !== strpos(Application::VERSION, '4.0')) { + return parent::createApplication(); + } + + $app = new Application(); + + $app->detectEnvironment(array( + 'local' => array('your-machine-name'), + )); + + $app->bindInstallPaths($this->getApplicationPaths()); + + $app['env'] = 'testing'; + + $app->instance('app', $app); + + Facade::clearResolvedInstances(); + Facade::setFacadeApplication($app); + + $config = new Config($app->getConfigLoader(), $app['env']); + $app->instance('config', $config); + $app->startExceptionHandling(); + + if ($app->runningInConsole()) { + $app->setRequestForConsoleEnvironment(); + } + + date_default_timezone_set($this->getApplicationTimezone()); + + $aliases = array_merge($this->getApplicationAliases(), $this->getPackageAliases()); + AliasLoader::getInstance($aliases)->register(); + + Request::enableHttpMethodParameterOverride(); + + $providers = array_merge($this->getApplicationProviders(), $this->getPackageProviders()); + $app->getProviderRepository()->load($app, $providers); + + $this->getEnvironmentSetUp($app); + + $app->boot(); + + return $app; + } + /** * @param Application $app * @@ -31,61 +77,11 @@ class TestCase extends Orchestra { $separator = $this->isLaravel4() ? '::config' : ''; - $app['config']->set('session'.$separator.'.driver', 'array'); + $app['config']->set('session' . $separator . '.driver', 'array'); } private function isLaravel4() { return 0 === strpos(Application::VERSION, '4.'); } - - /** - * {@inheritdoc} - */ - public function createApplication() - { - if (0 !== strpos(Application::VERSION, '4.0')) { - return parent::createApplication(); - } - - $app = new Application; - - $app->detectEnvironment(array( - 'local' => array('your-machine-name'), - )); - - $app->bindInstallPaths($this->getApplicationPaths()); - - $app['env'] = 'testing'; - - $app->instance('app', $app); - - Facade::clearResolvedInstances(); - Facade::setFacadeApplication($app); - - $config = new Config($app->getConfigLoader(), $app['env']); - $app->instance('config', $config); - $app->startExceptionHandling(); - - if ($app->runningInConsole()) - { - $app->setRequestForConsoleEnvironment(); - } - - date_default_timezone_set($this->getApplicationTimezone()); - - $aliases = array_merge($this->getApplicationAliases(), $this->getPackageAliases()); - AliasLoader::getInstance($aliases)->register(); - - Request::enableHttpMethodParameterOverride(); - - $providers = array_merge($this->getApplicationProviders(), $this->getPackageProviders()); - $app->getProviderRepository()->load($app, $providers); - - $this->getEnvironmentSetUp($app); - - $app->boot(); - - return $app; - } } diff --git a/src/Noty/Prime/.phpcs.xml.dist b/src/Noty/Prime/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/src/Noty/Prime/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Noty/Prime/NotyBuilder.php b/src/Noty/Prime/NotyBuilder.php index 4ee8a8fa..9b741d0c 100644 --- a/src/Noty/Prime/NotyBuilder.php +++ b/src/Noty/Prime/NotyBuilder.php @@ -20,7 +20,6 @@ final class NotyBuilder extends NotificationBuilder /** * @param string $message - * @param array $options * * @return NotyBuilder */ @@ -30,8 +29,8 @@ final class NotyBuilder extends NotificationBuilder } /** - * top, topLeft, topCenter, topRight, center, centerLeft, centerRight, bottom, bottomLeft, bottomCenter, - * bottomRight - ClassName generator uses this value → noty_layout__${layout} + * top, topLeft, topCenter, topRight, center, centerLeft, centerRight, bottom, bottomLeft, bottomCenter, bottomRight + * - ClassName generator uses this value → noty_layout__${layout} * * @param string $layout * @@ -111,7 +110,7 @@ final class NotyBuilder extends NotificationBuilder */ public function animation($animation, $effect) { - $this->option('animation.'.$animation, $effect); + $this->option('animation.' . $animation, $effect); return $this; } @@ -124,7 +123,7 @@ final class NotyBuilder extends NotificationBuilder */ public function sounds($option, $value) { - $this->option('sounds.'.$option, $value); + $this->option('sounds.' . $option, $value); return $this; } @@ -137,7 +136,7 @@ final class NotyBuilder extends NotificationBuilder */ public function docTitle($option, $docTitle) { - $this->option('docTitle'.$option, $docTitle); + $this->option('docTitle' . $option, $docTitle); return $this; } @@ -195,7 +194,8 @@ final class NotyBuilder extends NotificationBuilder } /** - * If true closes all visible notifications and shows itself. If string(queueName) closes all visible notification on this queue and shows itself. + * If true closes all visible notifications and shows itself. If string(queueName) closes all visible notification + * on this queue and shows itself. * * @param string|bool $killer * diff --git a/src/Noty/Prime/NotyFactory.php b/src/Noty/Prime/NotyFactory.php index 7c931ebf..36793c89 100644 --- a/src/Noty/Prime/NotyFactory.php +++ b/src/Noty/Prime/NotyFactory.php @@ -9,9 +9,6 @@ use Flasher\Prime\Factory\NotificationFactory; */ final class NotyFactory extends NotificationFactory { - /** - * @inheritDoc - */ public function createNotificationBuilder() { return new NotyBuilder($this->getStorageManager(), new Noty(), 'noty'); diff --git a/src/Noty/Symfony/.phpcs.xml.dist b/src/Noty/Symfony/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/src/Noty/Symfony/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Noty/Symfony/DependencyInjection/Configuration.php b/src/Noty/Symfony/DependencyInjection/Configuration.php index 69b0088c..460444a4 100755 --- a/src/Noty/Symfony/DependencyInjection/Configuration.php +++ b/src/Noty/Symfony/DependencyInjection/Configuration.php @@ -7,9 +7,6 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; final class Configuration implements ConfigurationInterface { - /** - * {@inheritdoc} - */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('flasher_noty'); @@ -26,7 +23,7 @@ final class Configuration implements ConfigurationInterface ->arrayNode('scripts') ->prototype('scalar')->end() ->defaultValue(array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher-noty@0.1.3/dist/flasher-noty.min.js', + 'https://cdn.jsdelivr.net/npm/@flasher/flasher-noty@0.1.3/dist/flasher-noty.min.js', )) ->end() ->arrayNode('styles') @@ -37,7 +34,7 @@ final class Configuration implements ConfigurationInterface ->prototype('variable')->end() ->ignoreExtraKeys(false) ->defaultValue(array( - 'timeout' => 5000, + 'timeout' => 5000, )) ->end() ->end() diff --git a/src/Noty/Symfony/DependencyInjection/FlasherNotyExtension.php b/src/Noty/Symfony/DependencyInjection/FlasherNotyExtension.php index 65797391..9d04f4df 100644 --- a/src/Noty/Symfony/DependencyInjection/FlasherNotyExtension.php +++ b/src/Noty/Symfony/DependencyInjection/FlasherNotyExtension.php @@ -7,17 +7,11 @@ use Symfony\Component\Config\FileLocator; final class FlasherNotyExtension extends Extension { - /** - * @inheritDoc - */ protected function getConfigFileLocator() { - return new FileLocator(__DIR__.'/../Resources/config'); + return new FileLocator(__DIR__ . '/../Resources/config'); } - /** - * @inheritDoc - */ protected function getConfigClass() { return new Configuration(); diff --git a/src/Noty/Symfony/Tests/DependencyInjection/ConfigurationTest.php b/src/Noty/Symfony/Tests/DependencyInjection/ConfigurationTest.php index e06e53a6..70ff26f7 100644 --- a/src/Noty/Symfony/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Noty/Symfony/Tests/DependencyInjection/ConfigurationTest.php @@ -16,7 +16,7 @@ class ConfigurationTest extends TestCase 'scripts' => array( 'https://cdn.jsdelivr.net/npm/@flasher/flasher-noty@0.1.3/dist/flasher-noty.min.js', ), - 'styles' => array(), + 'styles' => array(), 'options' => array( 'timeout' => 5000, ), diff --git a/src/Noty/Symfony/Tests/DependencyInjection/FlasherNotyExtensionTest.php b/src/Noty/Symfony/Tests/DependencyInjection/FlasherNotyExtensionTest.php index cdc65a81..11ec7668 100644 --- a/src/Noty/Symfony/Tests/DependencyInjection/FlasherNotyExtensionTest.php +++ b/src/Noty/Symfony/Tests/DependencyInjection/FlasherNotyExtensionTest.php @@ -2,11 +2,11 @@ namespace Flasher\Noty\Symfony\Tests\DependencyInjection; +use Flasher\Noty\Symfony\DependencyInjection\FlasherNotyExtension; +use Flasher\Noty\Symfony\FlasherNotySymfonyBundle; use Flasher\Prime\Tests\TestCase; use Flasher\Symfony\DependencyInjection\FlasherExtension; use Flasher\Symfony\FlasherSymfonyBundle; -use Flasher\Noty\Symfony\DependencyInjection\FlasherNotyExtension; -use Flasher\Noty\Symfony\FlasherNotySymfonyBundle; use Symfony\Component\DependencyInjection\ContainerBuilder; class FlasherNotyExtensionTest extends TestCase diff --git a/src/Notyf/Laravel/.phpcs.xml.dist b/src/Notyf/Laravel/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/src/Notyf/Laravel/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Notyf/Laravel/Facade/Notyf.php b/src/Notyf/Laravel/Facade/Notyf.php index f17a5902..f79b9e46 100644 --- a/src/Notyf/Laravel/Facade/Notyf.php +++ b/src/Notyf/Laravel/Facade/Notyf.php @@ -6,11 +6,8 @@ use Illuminate\Support\Facades\Facade; class Notyf extends Facade { - /** - * @inheritdoc - */ protected static function getFacadeAccessor() { return 'flasher.notyf'; } -} \ No newline at end of file +} diff --git a/src/Notyf/Laravel/FlasherNotyfServiceProvider.php b/src/Notyf/Laravel/FlasherNotyfServiceProvider.php index 004fd94b..570698b0 100644 --- a/src/Notyf/Laravel/FlasherNotyfServiceProvider.php +++ b/src/Notyf/Laravel/FlasherNotyfServiceProvider.php @@ -2,9 +2,9 @@ namespace Flasher\Notyf\Laravel; +use Flasher\Notyf\Laravel\ServiceProvider\ServiceProviderManager; use Illuminate\Container\Container; use Illuminate\Support\ServiceProvider; -use Flasher\Notyf\Laravel\ServiceProvider\ServiceProviderManager; class FlasherNotyfServiceProvider extends ServiceProvider { @@ -43,17 +43,11 @@ class FlasherNotyfServiceProvider extends ServiceProvider return $this->app; } - /** - * {@inheritdoc} - */ public function mergeConfigFrom($path, $key) { parent::mergeConfigFrom($path, $key); } - /** - * {@inheritdoc} - */ public function publishes(array $paths, $groups = null) { parent::publishes($paths, $groups); diff --git a/src/Notyf/Laravel/Resources/functions/notyf.php b/src/Notyf/Laravel/Resources/functions/notyf.php index a646054e..bcd04bc1 100644 --- a/src/Notyf/Laravel/Resources/functions/notyf.php +++ b/src/Notyf/Laravel/Resources/functions/notyf.php @@ -3,11 +3,10 @@ use Flasher\Prime\Notification\NotificationInterface; use Illuminate\Support\Facades\App; -if (! function_exists('notyf')) { +if (!function_exists('notyf')) { /** * @param string $message * @param string $type - * @param array $options * * @return \Flasher\Notyf\Prime\NotyfFactory */ @@ -19,4 +18,4 @@ if (! function_exists('notyf')) { return App::make('flasher.notyf')->addFlash($type, $message, $options); } -} \ No newline at end of file +} diff --git a/src/Notyf/Laravel/ServiceProvider/Providers/Laravel.php b/src/Notyf/Laravel/ServiceProvider/Providers/Laravel.php index a5f5a8b3..11baddc1 100644 --- a/src/Notyf/Laravel/ServiceProvider/Providers/Laravel.php +++ b/src/Notyf/Laravel/ServiceProvider/Providers/Laravel.php @@ -17,36 +17,26 @@ class Laravel implements ServiceProviderInterface */ protected $app; - /** - * @param Container $app - */ public function __construct(Container $app) { $this->app = $app; } - /** - * @inheritDoc - */ public function shouldBeUsed() { return $this->app instanceof Application; } - /** - * @inheritDoc - */ public function boot(FlasherNotyfServiceProvider $provider) { - $provider->publishes(array(flasher_path(__DIR__.'/../../Resources/config/config.php') => config_path('flasher_notyf.php')), 'flasher-config'); + $provider->publishes(array( + flasher_path(__DIR__ . '/../../Resources/config/config.php') => config_path('flasher_notyf.php'), + ), 'flasher-config'); } - /** - * @inheritDoc - */ public function register(FlasherNotyfServiceProvider $provider) { - $provider->mergeConfigFrom(flasher_path(__DIR__.'/../../Resources/config/config.php'), 'flasher_notyf'); + $provider->mergeConfigFrom(flasher_path(__DIR__ . '/../../Resources/config/config.php'), 'flasher_notyf'); $this->appendToFlasherConfig(); $this->registerServices(); diff --git a/src/Notyf/Laravel/ServiceProvider/Providers/Laravel4.php b/src/Notyf/Laravel/ServiceProvider/Providers/Laravel4.php index 83003e32..7c25cb74 100644 --- a/src/Notyf/Laravel/ServiceProvider/Providers/Laravel4.php +++ b/src/Notyf/Laravel/ServiceProvider/Providers/Laravel4.php @@ -7,27 +7,22 @@ use Illuminate\Foundation\Application; final class Laravel4 extends Laravel { - /** - * @inheritDoc - */ public function shouldBeUsed() { return $this->app instanceof Application && 0 === strpos(Application::VERSION, '4.'); } - /** - * @inheritDoc - */ public function boot(FlasherNotyfServiceProvider $provider) { - $provider->package('php-flasher/flasher-notyf-laravel', 'flasher_notyf', flasher_path(__DIR__.'/../../Resources')); + $provider->package( + 'php-flasher/flasher-notyf-laravel', + 'flasher_notyf', + flasher_path(__DIR__ . '/../../Resources') + ); $this->appendToFlasherConfig(); } - /** - * @inheritDoc - */ public function register(FlasherNotyfServiceProvider $provider) { $this->registerServices(); diff --git a/src/Notyf/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php b/src/Notyf/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php index dd04df28..29c67d3b 100644 --- a/src/Notyf/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php +++ b/src/Notyf/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php @@ -11,13 +11,7 @@ interface ServiceProviderInterface */ public function shouldBeUsed(); - /** - * @param FlasherNotyfServiceProvider $provider - */ public function boot(FlasherNotyfServiceProvider $provider); - /** - * @param FlasherNotyfServiceProvider $provider - */ public function register(FlasherNotyfServiceProvider $provider); } diff --git a/src/Notyf/Laravel/ServiceProvider/ServiceProviderManager.php b/src/Notyf/Laravel/ServiceProvider/ServiceProviderManager.php index bba23a7e..88e9a781 100644 --- a/src/Notyf/Laravel/ServiceProvider/ServiceProviderManager.php +++ b/src/Notyf/Laravel/ServiceProvider/ServiceProviderManager.php @@ -26,9 +26,6 @@ final class ServiceProviderManager */ private $notifyServiceProvider; - /** - * @param FlasherNotyfServiceProvider $notifyServiceProvider - */ public function __construct(FlasherNotyfServiceProvider $notifyServiceProvider) { $this->notifyServiceProvider = $notifyServiceProvider; diff --git a/src/Notyf/Laravel/Tests/TestCase.php b/src/Notyf/Laravel/Tests/TestCase.php index 80e0114e..15b2af65 100644 --- a/src/Notyf/Laravel/Tests/TestCase.php +++ b/src/Notyf/Laravel/Tests/TestCase.php @@ -11,6 +11,52 @@ use Orchestra\Testbench\TestCase as Orchestra; class TestCase extends Orchestra { + public function createApplication() + { + if (0 !== strpos(Application::VERSION, '4.0')) { + return parent::createApplication(); + } + + $app = new Application(); + + $app->detectEnvironment(array( + 'local' => array('your-machine-name'), + )); + + $app->bindInstallPaths($this->getApplicationPaths()); + + $app['env'] = 'testing'; + + $app->instance('app', $app); + + Facade::clearResolvedInstances(); + Facade::setFacadeApplication($app); + + $config = new Config($app->getConfigLoader(), $app['env']); + $app->instance('config', $config); + $app->startExceptionHandling(); + + if ($app->runningInConsole()) { + $app->setRequestForConsoleEnvironment(); + } + + date_default_timezone_set($this->getApplicationTimezone()); + + $aliases = array_merge($this->getApplicationAliases(), $this->getPackageAliases()); + AliasLoader::getInstance($aliases)->register(); + + Request::enableHttpMethodParameterOverride(); + + $providers = array_merge($this->getApplicationProviders(), $this->getPackageProviders()); + $app->getProviderRepository()->load($app, $providers); + + $this->getEnvironmentSetUp($app); + + $app->boot(); + + return $app; + } + /** * @param Application $app * @@ -31,61 +77,11 @@ class TestCase extends Orchestra { $separator = $this->isLaravel4() ? '::config' : ''; - $app['config']->set('session'.$separator.'.driver', 'array'); + $app['config']->set('session' . $separator . '.driver', 'array'); } private function isLaravel4() { return 0 === strpos(Application::VERSION, '4.'); } - - /** - * {@inheritdoc} - */ - public function createApplication() - { - if (0 !== strpos(Application::VERSION, '4.0')) { - return parent::createApplication(); - } - - $app = new Application; - - $app->detectEnvironment(array( - 'local' => array('your-machine-name'), - )); - - $app->bindInstallPaths($this->getApplicationPaths()); - - $app['env'] = 'testing'; - - $app->instance('app', $app); - - Facade::clearResolvedInstances(); - Facade::setFacadeApplication($app); - - $config = new Config($app->getConfigLoader(), $app['env']); - $app->instance('config', $config); - $app->startExceptionHandling(); - - if ($app->runningInConsole()) - { - $app->setRequestForConsoleEnvironment(); - } - - date_default_timezone_set($this->getApplicationTimezone()); - - $aliases = array_merge($this->getApplicationAliases(), $this->getPackageAliases()); - AliasLoader::getInstance($aliases)->register(); - - Request::enableHttpMethodParameterOverride(); - - $providers = array_merge($this->getApplicationProviders(), $this->getPackageProviders()); - $app->getProviderRepository()->load($app, $providers); - - $this->getEnvironmentSetUp($app); - - $app->boot(); - - return $app; - } } diff --git a/src/Notyf/Prime/.phpcs.xml.dist b/src/Notyf/Prime/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/src/Notyf/Prime/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Notyf/Prime/NotyfFactory.php b/src/Notyf/Prime/NotyfFactory.php index e5499c3f..8bc3fdef 100644 --- a/src/Notyf/Prime/NotyfFactory.php +++ b/src/Notyf/Prime/NotyfFactory.php @@ -9,9 +9,6 @@ use Flasher\Prime\Factory\NotificationFactory; */ final class NotyfFactory extends NotificationFactory { - /** - * @inheritDoc - */ public function createNotificationBuilder() { return new NotyfBuilder($this->getStorageManager(), new Notyf(), 'notyf'); diff --git a/src/Notyf/Symfony/.phpcs.xml.dist b/src/Notyf/Symfony/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/src/Notyf/Symfony/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Notyf/Symfony/DependencyInjection/Configuration.php b/src/Notyf/Symfony/DependencyInjection/Configuration.php index 23f03905..e0ed9168 100644 --- a/src/Notyf/Symfony/DependencyInjection/Configuration.php +++ b/src/Notyf/Symfony/DependencyInjection/Configuration.php @@ -7,9 +7,6 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; final class Configuration implements ConfigurationInterface { - /** - * {@inheritdoc} - */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('flasher_notyf'); diff --git a/src/Notyf/Symfony/DependencyInjection/FlasherNotyfExtension.php b/src/Notyf/Symfony/DependencyInjection/FlasherNotyfExtension.php index 84b98597..756902fc 100644 --- a/src/Notyf/Symfony/DependencyInjection/FlasherNotyfExtension.php +++ b/src/Notyf/Symfony/DependencyInjection/FlasherNotyfExtension.php @@ -7,17 +7,11 @@ use Symfony\Component\Config\FileLocator; final class FlasherNotyfExtension extends Extension { - /** - * @inheritDoc - */ protected function getConfigFileLocator() { - return new FileLocator(__DIR__.'/../Resources/config'); + return new FileLocator(__DIR__ . '/../Resources/config'); } - /** - * @inheritDoc - */ protected function getConfigClass() { return new Configuration(); diff --git a/src/Notyf/Symfony/Tests/DependencyInjection/FlasherNotyfExtensionTest.php b/src/Notyf/Symfony/Tests/DependencyInjection/FlasherNotyfExtensionTest.php index 160e2f8a..99f90a68 100644 --- a/src/Notyf/Symfony/Tests/DependencyInjection/FlasherNotyfExtensionTest.php +++ b/src/Notyf/Symfony/Tests/DependencyInjection/FlasherNotyfExtensionTest.php @@ -2,11 +2,11 @@ namespace Flasher\Notyf\Symfony\Tests\DependencyInjection; +use Flasher\Notyf\Symfony\DependencyInjection\FlasherNotyfExtension; +use Flasher\Notyf\Symfony\FlasherNotyfSymfonyBundle; use Flasher\Prime\Tests\TestCase; use Flasher\Symfony\DependencyInjection\FlasherExtension; use Flasher\Symfony\FlasherSymfonyBundle; -use Flasher\Notyf\Symfony\DependencyInjection\FlasherNotyfExtension; -use Flasher\Notyf\Symfony\FlasherNotyfSymfonyBundle; use Symfony\Component\DependencyInjection\ContainerBuilder; class FlasherNotyfExtensionTest extends TestCase diff --git a/src/Pnotify/Laravel/.phpcs.xml.dist b/src/Pnotify/Laravel/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/src/Pnotify/Laravel/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Pnotify/Laravel/Facade/Pnotify.php b/src/Pnotify/Laravel/Facade/Pnotify.php index 7ea74c51..945c6b85 100644 --- a/src/Pnotify/Laravel/Facade/Pnotify.php +++ b/src/Pnotify/Laravel/Facade/Pnotify.php @@ -6,11 +6,8 @@ use Illuminate\Support\Facades\Facade; class Pnotify extends Facade { - /** - * @inheritdoc - */ protected static function getFacadeAccessor() { return 'flasher.pnotify'; } -} \ No newline at end of file +} diff --git a/src/Pnotify/Laravel/FlasherPnotifyServiceProvider.php b/src/Pnotify/Laravel/FlasherPnotifyServiceProvider.php index 3912a282..13566d4e 100644 --- a/src/Pnotify/Laravel/FlasherPnotifyServiceProvider.php +++ b/src/Pnotify/Laravel/FlasherPnotifyServiceProvider.php @@ -2,9 +2,9 @@ namespace Flasher\Pnotify\Laravel; +use Flasher\Pnotify\Laravel\ServiceProvider\ServiceProviderManager; use Illuminate\Container\Container; use Illuminate\Support\ServiceProvider; -use Flasher\Pnotify\Laravel\ServiceProvider\ServiceProviderManager; final class FlasherPnotifyServiceProvider extends ServiceProvider { @@ -43,17 +43,11 @@ final class FlasherPnotifyServiceProvider extends ServiceProvider return $this->app; } - /** - * {@inheritdoc} - */ public function mergeConfigFrom($path, $key) { parent::mergeConfigFrom($path, $key); } - /** - * {@inheritdoc} - */ public function publishes(array $paths, $groups = null) { parent::publishes($paths, $groups); diff --git a/src/Pnotify/Laravel/Resources/config/config.php b/src/Pnotify/Laravel/Resources/config/config.php index 1114f60d..d57f7db2 100644 --- a/src/Pnotify/Laravel/Resources/config/config.php +++ b/src/Pnotify/Laravel/Resources/config/config.php @@ -5,7 +5,7 @@ return array( 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js', 'https://cdn.jsdelivr.net/npm/@flasher/flasher-pnotify@0.1.1/dist/flasher-pnotify.min.js', ), - 'styles' => array(), + 'styles' => array(), 'options' => array( 'delay' => 1000, ), diff --git a/src/Pnotify/Laravel/Resources/functions/pnotify.php b/src/Pnotify/Laravel/Resources/functions/pnotify.php index baada2ce..120ddcc7 100644 --- a/src/Pnotify/Laravel/Resources/functions/pnotify.php +++ b/src/Pnotify/Laravel/Resources/functions/pnotify.php @@ -3,11 +3,10 @@ use Flasher\Prime\Notification\NotificationInterface; use Illuminate\Support\Facades\App; -if (! function_exists('pnotify')) { +if (!function_exists('pnotify')) { /** * @param string $message * @param string $type - * @param array $options * * @return \Flasher\Pnotify\Prime\PnotifyFactory */ @@ -19,4 +18,4 @@ if (! function_exists('pnotify')) { return App::make('flasher.pnotify')->addFlash($type, $message, $options); } -} \ No newline at end of file +} diff --git a/src/Pnotify/Laravel/ServiceProvider/Providers/Laravel.php b/src/Pnotify/Laravel/ServiceProvider/Providers/Laravel.php index d4976cf5..6934c19d 100644 --- a/src/Pnotify/Laravel/ServiceProvider/Providers/Laravel.php +++ b/src/Pnotify/Laravel/ServiceProvider/Providers/Laravel.php @@ -17,36 +17,26 @@ class Laravel implements ServiceProviderInterface */ protected $app; - /** - * @param Container $app - */ public function __construct(Container $app) { $this->app = $app; } - /** - * @inheritDoc - */ public function shouldBeUsed() { return $this->app instanceof Application; } - /** - * @inheritDoc - */ public function boot(FlasherPnotifyServiceProvider $provider) { - $provider->publishes(array(flasher_path(__DIR__.'/../../Resources/config/config.php') => config_path('flasher_pnotify.php')), 'flasher-config'); + $provider->publishes(array( + flasher_path(__DIR__ . '/../../Resources/config/config.php') => config_path('flasher_pnotify.php'), + ), 'flasher-config'); } - /** - * @inheritDoc - */ public function register(FlasherPnotifyServiceProvider $provider) { - $provider->mergeConfigFrom(flasher_path(__DIR__.'/../../Resources/config/config.php'), 'flasher_pnotify'); + $provider->mergeConfigFrom(flasher_path(__DIR__ . '/../../Resources/config/config.php'), 'flasher_pnotify'); $this->appendToFlasherConfig(); $this->registerServices(); diff --git a/src/Pnotify/Laravel/ServiceProvider/Providers/Laravel4.php b/src/Pnotify/Laravel/ServiceProvider/Providers/Laravel4.php index e2bcff80..7ae1b337 100644 --- a/src/Pnotify/Laravel/ServiceProvider/Providers/Laravel4.php +++ b/src/Pnotify/Laravel/ServiceProvider/Providers/Laravel4.php @@ -7,27 +7,22 @@ use Illuminate\Foundation\Application; final class Laravel4 extends Laravel { - /** - * @inheritDoc - */ public function shouldBeUsed() { return $this->app instanceof Application && 0 === strpos(Application::VERSION, '4.'); } - /** - * @inheritDoc - */ public function boot(FlasherPnotifyServiceProvider $provider) { - $provider->package('php-flasher/flasher-pnotify-laravel', 'flasher_pnotify', flasher_path(__DIR__.'/../../Resources')); + $provider->package( + 'php-flasher/flasher-pnotify-laravel', + 'flasher_pnotify', + flasher_path(__DIR__ . '/../../Resources') + ); $this->appendToFlasherConfig(); } - /** - * @inheritDoc - */ public function register(FlasherPnotifyServiceProvider $provider) { $this->registerServices(); diff --git a/src/Pnotify/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php b/src/Pnotify/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php index d98d9189..752db25e 100644 --- a/src/Pnotify/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php +++ b/src/Pnotify/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php @@ -11,13 +11,7 @@ interface ServiceProviderInterface */ public function shouldBeUsed(); - /** - * @param FlasherPnotifyServiceProvider $provider - */ public function boot(FlasherPnotifyServiceProvider $provider); - /** - * @param FlasherPnotifyServiceProvider $provider - */ public function register(FlasherPnotifyServiceProvider $provider); } diff --git a/src/Pnotify/Laravel/ServiceProvider/ServiceProviderManager.php b/src/Pnotify/Laravel/ServiceProvider/ServiceProviderManager.php index 6d27d789..d3e317af 100644 --- a/src/Pnotify/Laravel/ServiceProvider/ServiceProviderManager.php +++ b/src/Pnotify/Laravel/ServiceProvider/ServiceProviderManager.php @@ -25,9 +25,6 @@ final class ServiceProviderManager */ private $notifyServiceProvider; - /** - * @param FlasherPnotifyServiceProvider $notifyServiceProvider - */ public function __construct(FlasherPnotifyServiceProvider $notifyServiceProvider) { $this->notifyServiceProvider = $notifyServiceProvider; diff --git a/src/Pnotify/Laravel/Tests/TestCase.php b/src/Pnotify/Laravel/Tests/TestCase.php index fa7fc194..6a014714 100644 --- a/src/Pnotify/Laravel/Tests/TestCase.php +++ b/src/Pnotify/Laravel/Tests/TestCase.php @@ -2,15 +2,61 @@ namespace Flasher\Pnotify\Laravel\Tests; +use Illuminate\Config\Repository as Config; use Illuminate\Foundation\AliasLoader; use Illuminate\Foundation\Application; use Illuminate\Http\Request; use Illuminate\Support\Facades\Facade; use Orchestra\Testbench\TestCase as Orchestra; -use Illuminate\Config\Repository as Config; class TestCase extends Orchestra { + public function createApplication() + { + if (0 !== strpos(Application::VERSION, '4.0')) { + return parent::createApplication(); + } + + $app = new Application(); + + $app->detectEnvironment(array( + 'local' => array('your-machine-name'), + )); + + $app->bindInstallPaths($this->getApplicationPaths()); + + $app['env'] = 'testing'; + + $app->instance('app', $app); + + Facade::clearResolvedInstances(); + Facade::setFacadeApplication($app); + + $config = new Config($app->getConfigLoader(), $app['env']); + $app->instance('config', $config); + $app->startExceptionHandling(); + + if ($app->runningInConsole()) { + $app->setRequestForConsoleEnvironment(); + } + + date_default_timezone_set($this->getApplicationTimezone()); + + $aliases = array_merge($this->getApplicationAliases(), $this->getPackageAliases()); + AliasLoader::getInstance($aliases)->register(); + + Request::enableHttpMethodParameterOverride(); + + $providers = array_merge($this->getApplicationProviders(), $this->getPackageProviders()); + $app->getProviderRepository()->load($app, $providers); + + $this->getEnvironmentSetUp($app); + + $app->boot(); + + return $app; + } + /** * @param Application $app * @@ -31,61 +77,11 @@ class TestCase extends Orchestra { $separator = $this->isLaravel4() ? '::config' : ''; - $app['config']->set('session'.$separator.'.driver', 'array'); + $app['config']->set('session' . $separator . '.driver', 'array'); } private function isLaravel4() { return 0 === strpos(Application::VERSION, '4.'); } - - /** - * {@inheritdoc} - */ - public function createApplication() - { - if (0 !== strpos(Application::VERSION, '4.0')) { - return parent::createApplication(); - } - - $app = new Application; - - $app->detectEnvironment(array( - 'local' => array('your-machine-name'), - )); - - $app->bindInstallPaths($this->getApplicationPaths()); - - $app['env'] = 'testing'; - - $app->instance('app', $app); - - Facade::clearResolvedInstances(); - Facade::setFacadeApplication($app); - - $config = new Config($app->getConfigLoader(), $app['env']); - $app->instance('config', $config); - $app->startExceptionHandling(); - - if ($app->runningInConsole()) - { - $app->setRequestForConsoleEnvironment(); - } - - date_default_timezone_set($this->getApplicationTimezone()); - - $aliases = array_merge($this->getApplicationAliases(), $this->getPackageAliases()); - AliasLoader::getInstance($aliases)->register(); - - Request::enableHttpMethodParameterOverride(); - - $providers = array_merge($this->getApplicationProviders(), $this->getPackageProviders()); - $app->getProviderRepository()->load($app, $providers); - - $this->getEnvironmentSetUp($app); - - $app->boot(); - - return $app; - } } diff --git a/src/Pnotify/Prime/.phpcs.xml.dist b/src/Pnotify/Prime/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/src/Pnotify/Prime/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Pnotify/Prime/PnotifyBuilder.php b/src/Pnotify/Prime/PnotifyBuilder.php index b30eb327..d2ff7c43 100644 --- a/src/Pnotify/Prime/PnotifyBuilder.php +++ b/src/Pnotify/Prime/PnotifyBuilder.php @@ -6,9 +6,6 @@ use Flasher\Prime\Notification\NotificationBuilder; final class PnotifyBuilder extends NotificationBuilder { - /** - * @inheritDoc - */ public function warning($message = null, array $options = array()) { return $this->type('notice', $message, $options); @@ -56,9 +53,6 @@ final class PnotifyBuilder extends NotificationBuilder return $this; } - /** - * @inheritDoc - */ public function message($message) { parent::message($message); @@ -81,8 +75,8 @@ final class PnotifyBuilder extends NotificationBuilder } /** - * What styling classes to use. (Can be either "brighttheme", "bootstrap3", "fontawesome", or a custom style - * object. See the source in the end of pnotify.js for the properties in a style object.) + * What styling classes to use. (Can be either "brighttheme", "bootstrap3", "fontawesome", or a custom style object. + * See the source in the end of pnotify.js for the properties in a style object.) * * @param string $styling * @@ -166,8 +160,8 @@ final class PnotifyBuilder extends NotificationBuilder } /** - * Set icon to true to use the default icon for the selected style/type, false for no icon, or a string for your - * own icon class. + * Set icon to true to use the default icon for the selected style/type, false for no icon, or a string for your own + * icon class. * * @param bool $icon * diff --git a/src/Pnotify/Prime/PnotifyFactory.php b/src/Pnotify/Prime/PnotifyFactory.php index 70c50dba..5a70e2e5 100644 --- a/src/Pnotify/Prime/PnotifyFactory.php +++ b/src/Pnotify/Prime/PnotifyFactory.php @@ -9,9 +9,6 @@ use Flasher\Prime\Factory\NotificationFactory; */ final class PnotifyFactory extends NotificationFactory { - /** - * @inheritDoc - */ public function createNotificationBuilder() { return new PnotifyBuilder($this->getStorageManager(), new Pnotify(), 'pnotify'); diff --git a/src/Pnotify/Symfony/.phpcs.xml.dist b/src/Pnotify/Symfony/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/src/Pnotify/Symfony/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Pnotify/Symfony/DependencyInjection/Configuration.php b/src/Pnotify/Symfony/DependencyInjection/Configuration.php index beaad7df..4f954e52 100644 --- a/src/Pnotify/Symfony/DependencyInjection/Configuration.php +++ b/src/Pnotify/Symfony/DependencyInjection/Configuration.php @@ -7,9 +7,6 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; final class Configuration implements ConfigurationInterface { - /** - * {@inheritdoc} - */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('flasher_pnotify'); diff --git a/src/Pnotify/Symfony/DependencyInjection/FlasherPnotifyExtension.php b/src/Pnotify/Symfony/DependencyInjection/FlasherPnotifyExtension.php index f61b5e0b..690968dd 100644 --- a/src/Pnotify/Symfony/DependencyInjection/FlasherPnotifyExtension.php +++ b/src/Pnotify/Symfony/DependencyInjection/FlasherPnotifyExtension.php @@ -7,17 +7,11 @@ use Symfony\Component\Config\FileLocator; final class FlasherPnotifyExtension extends Extension { - /** - * @inheritDoc - */ protected function getConfigFileLocator() { - return new FileLocator(__DIR__.'/../Resources/config'); + return new FileLocator(__DIR__ . '/../Resources/config'); } - /** - * @inheritDoc - */ protected function getConfigClass() { return new Configuration(); diff --git a/src/Pnotify/Symfony/Tests/DependencyInjection/ConfigurationTest.php b/src/Pnotify/Symfony/Tests/DependencyInjection/ConfigurationTest.php index 52f6ba03..0887bd8f 100644 --- a/src/Pnotify/Symfony/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Pnotify/Symfony/Tests/DependencyInjection/ConfigurationTest.php @@ -17,7 +17,7 @@ class ConfigurationTest extends TestCase 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js', 'https://cdn.jsdelivr.net/npm/@flasher/flasher-pnotify@0.1.1/dist/flasher-pnotify.min.js', ), - 'styles' => array(), + 'styles' => array(), 'options' => array( 'delay' => 1000, ), diff --git a/src/Pnotify/Symfony/Tests/DependencyInjection/FlasherPnotifyExtensionTest.php b/src/Pnotify/Symfony/Tests/DependencyInjection/FlasherPnotifyExtensionTest.php index 29ad1f25..f98b42e8 100644 --- a/src/Pnotify/Symfony/Tests/DependencyInjection/FlasherPnotifyExtensionTest.php +++ b/src/Pnotify/Symfony/Tests/DependencyInjection/FlasherPnotifyExtensionTest.php @@ -2,11 +2,11 @@ namespace Flasher\Pnotify\Symfony\Tests\DependencyInjection; +use Flasher\Pnotify\Symfony\DependencyInjection\FlasherPnotifyExtension; +use Flasher\Pnotify\Symfony\FlasherPnotifySymfonyBundle; use Flasher\Prime\Tests\TestCase; use Flasher\Symfony\DependencyInjection\FlasherExtension; use Flasher\Symfony\FlasherSymfonyBundle; -use Flasher\Pnotify\Symfony\DependencyInjection\FlasherPnotifyExtension; -use Flasher\Pnotify\Symfony\FlasherPnotifySymfonyBundle; use Symfony\Component\DependencyInjection\ContainerBuilder; class FlasherPnotifyExtensionTest extends TestCase diff --git a/src/Prime/.phpcs.xml.dist b/src/Prime/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/src/Prime/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Prime/Config/Config.php b/src/Prime/Config/Config.php index 79986b51..af35abc8 100644 --- a/src/Prime/Config/Config.php +++ b/src/Prime/Config/Config.php @@ -9,17 +9,11 @@ final class Config implements ConfigInterface */ private $config; - /** - * @param array $config - */ public function __construct(array $config) { $this->config = $config; } - /** - * @inheritDoc - */ public function get($key, $default = null) { $data = $this->config; diff --git a/src/Prime/Envelope.php b/src/Prime/Envelope.php index 4367959e..71590f30 100644 --- a/src/Prime/Envelope.php +++ b/src/Prime/Envelope.php @@ -19,7 +19,6 @@ final class Envelope implements NotificationInterface private $stamps = array(); /** - * @param NotificationInterface $notification * @param StampInterface[] $stamps */ public function __construct(NotificationInterface $notification, $stamps = array()) @@ -31,7 +30,6 @@ final class Envelope implements NotificationInterface /** * Makes sure the notification is in an Envelope and adds the given stamps. * - * @param NotificationInterface $notification * @param StampInterface[] $stamps * * @return Envelope @@ -60,8 +58,6 @@ final class Envelope implements NotificationInterface } /** - * @param StampInterface $stamp - * * @return $this */ public function withStamp(StampInterface $stamp) @@ -105,81 +101,51 @@ final class Envelope implements NotificationInterface return $this->notification; } - /** - * @inheritDoc - */ public function getType() { return $this->notification->getType(); } - /** - * @inheritDoc - */ public function setType($type) { $this->notification->setType($type); } - /** - * @inheritDoc - */ public function getMessage() { return $this->notification->getMessage(); } - /** - * @inheritDoc - */ public function setMessage($message) { $this->notification->setMessage($message); } - /** - * @inheritDoc - */ public function getOptions() { return $this->notification->getOptions(); } - /** - * @inheritDoc - */ public function setOptions(array $options) { $this->notification->setOptions($options); } - /** - * @inheritDoc - */ public function getOption($name, $default = null) { return $this->notification->getOption($name, $default); } - /** - * @inheritDoc - */ public function setOption($name, $value) { $this->notification->setOption($name, $value); } - /** - * @inheritDoc - */ public function unsetOption($name) { $this->notification->unsetOption($name); } - /** - * @inheritDoc - */ public function toArray() { $array = array( diff --git a/src/Prime/EventDispatcher/Event/FilterEvent.php b/src/Prime/EventDispatcher/Event/FilterEvent.php index f3d09970..abbcf253 100644 --- a/src/Prime/EventDispatcher/Event/FilterEvent.php +++ b/src/Prime/EventDispatcher/Event/FilterEvent.php @@ -18,12 +18,11 @@ final class FilterEvent /** * @param Envelope[] $envelopes - * @param array $criteria */ public function __construct(array $envelopes, array $criteria) { $this->envelopes = $envelopes; - $this->criteria = $criteria; + $this->criteria = $criteria; } /** @@ -50,9 +49,6 @@ final class FilterEvent return $this->criteria; } - /** - * @param array $criteria - */ public function setCriteria(array $criteria) { $this->criteria = $criteria; diff --git a/src/Prime/EventDispatcher/EventDispatcher.php b/src/Prime/EventDispatcher/EventDispatcher.php index fe2a6a28..c078017f 100644 --- a/src/Prime/EventDispatcher/EventDispatcher.php +++ b/src/Prime/EventDispatcher/EventDispatcher.php @@ -17,9 +17,6 @@ final class EventDispatcher implements EventDispatcherInterface */ private $sorted = array(); - /** - * @inheritDoc - */ public function dispatch($event) { $listeners = $this->getListeners(get_class($event)); @@ -47,6 +44,35 @@ final class EventDispatcher implements EventDispatcherInterface return $this->sorted[$eventName]; } + public function addListener($eventName, $listener, $priority = 0) + { + $this->listeners[$eventName][$priority][] = $listener; + } + + public function addSubscriber(EventSubscriberInterface $subscriber) + { + foreach ((array) $subscriber->getSubscribedEvents() as $eventName => $params) { + if (is_int($eventName)) { + $eventName = $params; + $params = '__invoke'; + } + + if (is_string($params)) { + $this->addListener($eventName, array($subscriber, $params)); + } elseif (is_string($params[0])) { + $this->addListener($eventName, array($subscriber, $params[0]), isset($params[1]) ? $params[1] : 0); + } else { + foreach ($params as $listener) { + $this->addListener( + $eventName, + array($subscriber, $listener[0]), + isset($listener[1]) ? $listener[1] : 0 + ); + } + } + } + } + /** * @param string $eventName */ @@ -75,35 +101,4 @@ final class EventDispatcher implements EventDispatcherInterface $listener($event, $this); } } - - /** - * @inheritDoc - */ - public function addListener($eventName, $listener, $priority = 0) - { - $this->listeners[$eventName][$priority][] = $listener; - } - - /** - * @inheritdoc - */ - public function addSubscriber(EventSubscriberInterface $subscriber) - { - foreach ((array) $subscriber->getSubscribedEvents() as $eventName => $params) { - if (is_int($eventName)) { - $eventName = $params; - $params = '__invoke'; - } - - if (is_string($params)) { - $this->addListener($eventName, array($subscriber, $params)); - } elseif (is_string($params[0])) { - $this->addListener($eventName, array($subscriber, $params[0]), isset($params[1]) ? $params[1] : 0); - } else { - foreach ($params as $listener) { - $this->addListener($eventName, array($subscriber, $listener[0]), isset($listener[1]) ? $listener[1] : 0); - } - } - } - } } diff --git a/src/Prime/EventDispatcher/EventDispatcherInterface.php b/src/Prime/EventDispatcher/EventDispatcherInterface.php index b0e29d80..163d66d4 100644 --- a/src/Prime/EventDispatcher/EventDispatcherInterface.php +++ b/src/Prime/EventDispatcher/EventDispatcherInterface.php @@ -20,8 +20,5 @@ interface EventDispatcherInterface */ public function addListener($eventName, $listener, $priority = 0); - /** - * @param EventSubscriberInterface $subscriber - */ public function addSubscriber(EventSubscriberInterface $subscriber); } diff --git a/src/Prime/EventDispatcher/EventListener/FilterListener.php b/src/Prime/EventDispatcher/EventListener/FilterListener.php index 3893a962..7667ecd7 100644 --- a/src/Prime/EventDispatcher/EventListener/FilterListener.php +++ b/src/Prime/EventDispatcher/EventListener/FilterListener.php @@ -3,7 +3,6 @@ namespace Flasher\Prime\EventDispatcher\EventListener; use Flasher\Prime\EventDispatcher\Event\FilterEvent; -use Flasher\Prime\Envelope; use Flasher\Prime\Filter\FilterInterface; final class FilterListener implements EventSubscriberInterface @@ -13,17 +12,11 @@ final class FilterListener implements EventSubscriberInterface */ private $filter; - /** - * @param FilterInterface $filter - */ public function __construct(FilterInterface $filter) { $this->filter = $filter; } - /** - * @param FilterEvent $event - */ public function __invoke(FilterEvent $event) { $criteria = $event->getCriteria(); @@ -35,9 +28,6 @@ final class FilterListener implements EventSubscriberInterface $event->setEnvelopes($envelopes); } - /** - * @inheritDoc - */ public static function getSubscribedEvents() { return 'Flasher\Prime\EventDispatcher\Event\FilterEvent'; diff --git a/src/Prime/EventDispatcher/EventListener/RemoveListener.php b/src/Prime/EventDispatcher/EventListener/RemoveListener.php index 78355b1b..9965bd6f 100644 --- a/src/Prime/EventDispatcher/EventListener/RemoveListener.php +++ b/src/Prime/EventDispatcher/EventListener/RemoveListener.php @@ -7,9 +7,6 @@ use Flasher\Prime\Stamp\HopsStamp; final class RemoveListener implements EventSubscriberInterface { - /** - * @param RemoveEvent $event - */ public function __invoke(RemoveEvent $event) { $envelopesToKeep = $event->getEnvelopesToKeep(); @@ -31,9 +28,6 @@ final class RemoveListener implements EventSubscriberInterface $event->setEnvelopesToRemove($envelopesToRemove); } - /** - * @inheritDoc - */ public static function getSubscribedEvents() { return 'Flasher\Prime\EventDispatcher\Event\RemoveEvent'; diff --git a/src/Prime/EventDispatcher/EventListener/ResponseListener.php b/src/Prime/EventDispatcher/EventListener/ResponseListener.php index 95e58a59..793e78ce 100644 --- a/src/Prime/EventDispatcher/EventListener/ResponseListener.php +++ b/src/Prime/EventDispatcher/EventListener/ResponseListener.php @@ -12,17 +12,11 @@ final class ResponseListener implements EventSubscriberInterface */ private $filter; - /** - * @param FilterInterface $filter - */ public function __construct(FilterInterface $filter) { $this->filter = $filter; } - /** - * @param FilterEvent $event - */ public function __invoke(FilterEvent $event) { $criteria = $event->getCriteria(); @@ -34,9 +28,6 @@ final class ResponseListener implements EventSubscriberInterface $event->setEnvelopes($envelopes); } - /** - * @inheritDoc - */ public static function getSubscribedEvents() { return 'Flasher\Prime\EventDispatcher\Event\FilterEvent'; diff --git a/src/Prime/EventDispatcher/EventListener/StampsListener.php b/src/Prime/EventDispatcher/EventListener/StampsListener.php index 6d115fd0..90f4913a 100644 --- a/src/Prime/EventDispatcher/EventListener/StampsListener.php +++ b/src/Prime/EventDispatcher/EventListener/StampsListener.php @@ -23,9 +23,14 @@ final class StampsListener implements EventSubscriberInterface } } - /** - * @param Envelope $envelope - */ + public static function getSubscribedEvents() + { + return array( + 'Flasher\Prime\EventDispatcher\Event\PersistEvent', + 'Flasher\Prime\EventDispatcher\Event\UpdateEvent', + ); + } + private function attachStamps(Envelope $envelope) { if (null === $envelope->get('Flasher\Prime\Stamp\CreatedAtStamp')) { @@ -48,15 +53,4 @@ final class StampsListener implements EventSubscriberInterface $envelope->withStamp(new PriorityStamp(0)); } } - - /** - * @inheritDoc - */ - public static function getSubscribedEvents() - { - return array( - 'Flasher\Prime\EventDispatcher\Event\PersistEvent', - 'Flasher\Prime\EventDispatcher\Event\UpdateEvent', - ); - } } diff --git a/src/Prime/Factory/NotificationFactory.php b/src/Prime/Factory/NotificationFactory.php index 8fbf9745..7e2b7f41 100644 --- a/src/Prime/Factory/NotificationFactory.php +++ b/src/Prime/Factory/NotificationFactory.php @@ -13,27 +13,15 @@ class NotificationFactory implements NotificationFactoryInterface */ protected $storageManager; - /** - * @param StorageManagerInterface $storageManager - */ public function __construct(StorageManagerInterface $storageManager) { $this->storageManager = $storageManager; } - /** - * {@inheritdoc} - */ - public function createNotificationBuilder() - { - return new NotificationBuilder($this->getStorageManager(), new Notification(), 'template'); - } - /** * Dynamically call the default driver instance. * * @param string $method - * @param array $parameters * * @return mixed */ @@ -42,6 +30,11 @@ class NotificationFactory implements NotificationFactoryInterface return call_user_func_array(array($this->createNotificationBuilder(), $method), $parameters); } + public function createNotificationBuilder() + { + return new NotificationBuilder($this->getStorageManager(), new Notification(), 'template'); + } + /** * @return StorageManagerInterface */ diff --git a/src/Prime/Filter/CriteriaBuilder.php b/src/Prime/Filter/CriteriaBuilder.php index 928c8f19..3a890f86 100644 --- a/src/Prime/Filter/CriteriaBuilder.php +++ b/src/Prime/Filter/CriteriaBuilder.php @@ -18,10 +18,6 @@ final class CriteriaBuilder */ private $criteria; - /** - * @param FilterBuilder $filterBuilder - * @param array $criteria - */ public function __construct(FilterBuilder $filterBuilder, array $criteria) { $this->filterBuilder = $filterBuilder; @@ -49,7 +45,9 @@ final class CriteriaBuilder $priority = $this->criteria['priority']; if (!is_array($priority)) { - $priority = array('min' => $priority); + $priority = array( + 'min' => $priority, + ); } $min = isset($priority['min']) ? $priority['min'] : null; @@ -67,7 +65,9 @@ final class CriteriaBuilder $hops = $this->criteria['hops']; if (!is_array($hops)) { - $hops = array('min' => $hops); + $hops = array( + 'min' => $hops, + ); } $min = isset($hops['min']) ? $hops['min'] : null; @@ -85,7 +85,9 @@ final class CriteriaBuilder $delay = $this->criteria['delay']; if (!is_array($delay)) { - $delay = array('min' => $delay); + $delay = array( + 'min' => $delay, + ); } $min = isset($delay['min']) ? $delay['min'] : null; @@ -103,7 +105,9 @@ final class CriteriaBuilder $life = $this->criteria['life']; if (!is_array($life)) { - $life = array('min' => $life); + $life = array( + 'min' => $life, + ); } $min = isset($life['min']) ? $life['min'] : null; @@ -130,7 +134,9 @@ final class CriteriaBuilder $orderings = $this->criteria['order_by']; if (!is_array($orderings)) { - $orderings = array($orderings => FilterBuilder::ASC); + $orderings = array( + $orderings => FilterBuilder::ASC, + ); } $this->filterBuilder->orderBy($orderings); diff --git a/src/Prime/Filter/Filter.php b/src/Prime/Filter/Filter.php index d8e2024e..57019c7a 100644 --- a/src/Prime/Filter/Filter.php +++ b/src/Prime/Filter/Filter.php @@ -17,9 +17,6 @@ final class Filter implements FilterInterface $this->filterBuilder = $filterBuilder ?: new FilterBuilder(); } - /** - * @inheritDoc - */ public function filter(array $envelopes, array $criteria) { return $this->filterBuilder->withCriteria($criteria)->filter($envelopes); diff --git a/src/Prime/Filter/FilterBuilder.php b/src/Prime/Filter/FilterBuilder.php index c1cd290b..ce1c4193 100644 --- a/src/Prime/Filter/FilterBuilder.php +++ b/src/Prime/Filter/FilterBuilder.php @@ -10,7 +10,8 @@ use Flasher\Prime\Stamp\OrderableStampInterface; final class FilterBuilder { - const ASC = 'ASC'; + const ASC = 'ASC'; + const DESC = 'DESC'; /** @@ -36,7 +37,7 @@ final class FilterBuilder public function orderBy(array $orderings) { $this->orderings = array_map(static function ($ordering) { - return strtoupper($ordering) === FilterBuilder::ASC ? FilterBuilder::ASC : FilterBuilder::DESC; + return strtoupper($ordering) === self::ASC ? self::ASC : self::DESC; }, $orderings); return $this; @@ -51,8 +52,6 @@ final class FilterBuilder } /** - * @param array $criteria - * * @return $this */ public function withCriteria(array $criteria) @@ -83,7 +82,7 @@ final class FilterBuilder if (null !== $orderings) { usort($envelopes, static function (Envelope $a, Envelope $b) use ($orderings) { foreach ($orderings as $field => $ordering) { - if (FilterBuilder::ASC !== $ordering) { + if (self::ASC !== $ordering) { list($a, $b) = array($b, $a); } @@ -143,8 +142,6 @@ final class FilterBuilder } /** - * @param SpecificationInterface $specification - * * @return $this */ public function andWhere(SpecificationInterface $specification) @@ -159,8 +156,6 @@ final class FilterBuilder } /** - * @param SpecificationInterface $specification - * * @return $this */ public function where(SpecificationInterface $specification) @@ -171,8 +166,6 @@ final class FilterBuilder } /** - * @param SpecificationInterface $specification - * * @return $this */ public function orWhere(SpecificationInterface $specification) diff --git a/src/Prime/Filter/FilterInterface.php b/src/Prime/Filter/FilterInterface.php index 06758382..e51323d4 100644 --- a/src/Prime/Filter/FilterInterface.php +++ b/src/Prime/Filter/FilterInterface.php @@ -8,7 +8,6 @@ interface FilterInterface { /** * @param Envelope[] $envelopes - * @param array $criteria * * @return array */ diff --git a/src/Prime/Filter/Specification/AndSpecification.php b/src/Prime/Filter/Specification/AndSpecification.php index ff35e718..ca53d28d 100644 --- a/src/Prime/Filter/Specification/AndSpecification.php +++ b/src/Prime/Filter/Specification/AndSpecification.php @@ -21,9 +21,6 @@ final class AndSpecification implements SpecificationInterface $this->specifications = $specifications; } - /** - * @inheritDoc - */ public function isSatisfiedBy(Envelope $envelope) { foreach ($this->specifications as $specification) { diff --git a/src/Prime/Filter/Specification/DelaySpecification.php b/src/Prime/Filter/Specification/DelaySpecification.php index 0fd935e3..3ffbe332 100644 --- a/src/Prime/Filter/Specification/DelaySpecification.php +++ b/src/Prime/Filter/Specification/DelaySpecification.php @@ -26,9 +26,6 @@ final class DelaySpecification implements SpecificationInterface $this->maxDelay = $maxDelay; } - /** - * @inheritDoc - */ public function isSatisfiedBy(Envelope $envelope) { $stamp = $envelope->get('Flasher\Prime\Stamp\DelayStamp'); diff --git a/src/Prime/Filter/Specification/HopsSpecification.php b/src/Prime/Filter/Specification/HopsSpecification.php index f0741f67..3e84acc8 100644 --- a/src/Prime/Filter/Specification/HopsSpecification.php +++ b/src/Prime/Filter/Specification/HopsSpecification.php @@ -26,9 +26,6 @@ final class HopsSpecification implements SpecificationInterface $this->maxAmount = $maxAmount; } - /** - * @inheritDoc - */ public function isSatisfiedBy(Envelope $envelope) { $stamp = $envelope->get('Flasher\Prime\Stamp\HopsStamp'); diff --git a/src/Prime/Filter/Specification/NotSpecification.php b/src/Prime/Filter/Specification/NotSpecification.php index ab0cb653..80e2deca 100644 --- a/src/Prime/Filter/Specification/NotSpecification.php +++ b/src/Prime/Filter/Specification/NotSpecification.php @@ -11,17 +11,11 @@ final class NotSpecification implements SpecificationInterface */ private $specification; - /** - * @param SpecificationInterface $specification - */ public function __construct(SpecificationInterface $specification) { $this->specification = $specification; } - /** - * @inheritDoc - */ public function isSatisfiedBy(Envelope $envelope) { return !$this->specification->isSatisfiedBy($envelope); diff --git a/src/Prime/Filter/Specification/OrSpecification.php b/src/Prime/Filter/Specification/OrSpecification.php index 33a647ce..3aff92a1 100644 --- a/src/Prime/Filter/Specification/OrSpecification.php +++ b/src/Prime/Filter/Specification/OrSpecification.php @@ -21,9 +21,6 @@ final class OrSpecification implements SpecificationInterface $this->specifications = $specifications; } - /** - * @inheritDoc - */ public function isSatisfiedBy(Envelope $envelope) { foreach ($this->specifications as $specification) { diff --git a/src/Prime/Filter/Specification/PrioritySpecification.php b/src/Prime/Filter/Specification/PrioritySpecification.php index 537b6851..5d8c065c 100644 --- a/src/Prime/Filter/Specification/PrioritySpecification.php +++ b/src/Prime/Filter/Specification/PrioritySpecification.php @@ -26,9 +26,6 @@ final class PrioritySpecification implements SpecificationInterface $this->maxPriority = $maxPriority; } - /** - * @inheritDoc - */ public function isSatisfiedBy(Envelope $envelope) { $stamp = $envelope->get('Flasher\Prime\Stamp\PriorityStamp'); diff --git a/src/Prime/Filter/Specification/SpecificationInterface.php b/src/Prime/Filter/Specification/SpecificationInterface.php index 84046cc9..8ae261e5 100644 --- a/src/Prime/Filter/Specification/SpecificationInterface.php +++ b/src/Prime/Filter/Specification/SpecificationInterface.php @@ -7,8 +7,6 @@ use Flasher\Prime\Envelope; interface SpecificationInterface { /** - * @param Envelope $envelope - * * @return bool */ public function isSatisfiedBy(Envelope $envelope); diff --git a/src/Prime/Filter/Specification/TimeSpecification.php b/src/Prime/Filter/Specification/TimeSpecification.php index ef43f1c6..2c4a633b 100644 --- a/src/Prime/Filter/Specification/TimeSpecification.php +++ b/src/Prime/Filter/Specification/TimeSpecification.php @@ -17,19 +17,12 @@ final class TimeSpecification implements SpecificationInterface */ private $maxTime; - /** - * @param DateTime $minTime - * @param DateTime|null $maxTime - */ public function __construct(DateTime $minTime, DateTime $maxTime = null) { $this->minTime = $minTime; $this->maxTime = $maxTime; } - /** - * @inheritDoc - */ public function isSatisfiedBy(Envelope $envelope) { $stamp = $envelope->get('Flasher\Prime\Stamp\CreatedAtStamp'); diff --git a/src/Prime/Flasher.php b/src/Prime/Flasher.php index 9119c3c6..344d768d 100644 --- a/src/Prime/Flasher.php +++ b/src/Prime/Flasher.php @@ -19,17 +19,23 @@ final class Flasher implements FlasherInterface */ private $config; - /** - * @param ConfigInterface $config - */ public function __construct(ConfigInterface $config) { $this->config = $config; } /** - * @inheritDoc + * Dynamically call the default factory instance. + * + * @param string $method + * + * @return mixed */ + public function __call($method, array $parameters) + { + return call_user_func_array(array($this->create(), $method), $parameters); + } + public function create($alias = null) { $alias = $alias ?: $this->getDefaultFactory(); @@ -41,9 +47,6 @@ final class Flasher implements FlasherInterface return $this->factories[$alias]; } - /** - * @inheritDoc - */ public function addFactory($alias, NotificationFactoryInterface $factory) { $this->factories[$alias] = $factory; @@ -58,17 +61,4 @@ final class Flasher implements FlasherInterface { return $this->config->get('default'); } - - /** - * Dynamically call the default factory instance. - * - * @param string $method - * @param array $parameters - * - * @return mixed - */ - public function __call($method, array $parameters) - { - return call_user_func_array(array($this->create(), $method), $parameters); - } } diff --git a/src/Prime/FlasherInterface.php b/src/Prime/FlasherInterface.php index fb7780f9..89692ed8 100644 --- a/src/Prime/FlasherInterface.php +++ b/src/Prime/FlasherInterface.php @@ -25,7 +25,6 @@ interface FlasherInterface * Register a custom driver creator. * * @param string $alias - * @param NotificationFactoryInterface $factory * * @return $this */ diff --git a/src/Prime/Notification/Notification.php b/src/Prime/Notification/Notification.php index b87e7d03..b6a75654 100644 --- a/src/Prime/Notification/Notification.php +++ b/src/Prime/Notification/Notification.php @@ -19,57 +19,36 @@ class Notification implements NotificationInterface */ protected $options = array(); - /** - * @inheritDoc - */ public function getType() { return $this->type; } - /** - * @inheritDoc - */ public function setType($type) { $this->type = $type; } - /** - * @inheritDoc - */ public function getMessage() { return $this->message; } - /** - * @inheritDoc - */ public function setMessage($message) { $this->message = $message; } - /** - * @inheritDoc - */ public function getOptions() { return $this->options; } - /** - * @inheritDoc - */ public function setOptions(array $options) { $this->options = $options; } - /** - * @inheritDoc - */ public function getOption($name, $default = null) { if (!isset($this->options[$name])) { @@ -79,29 +58,20 @@ class Notification implements NotificationInterface return $this->options[$name]; } - /** - * @inheritDoc - */ public function setOption($name, $value) { $this->options[$name] = $value; } - /** - * @inheritDoc - */ public function unsetOption($name) { unset($this->options[$name]); } - /** - * @inheritDoc - */ public function toArray() { return array( - 'type' => $this->getType(), + 'type' => $this->getType(), 'message' => $this->getMessage(), 'options' => $this->getOptions(), ); diff --git a/src/Prime/Notification/NotificationBuilder.php b/src/Prime/Notification/NotificationBuilder.php index 415fa448..51aa98d4 100644 --- a/src/Prime/Notification/NotificationBuilder.php +++ b/src/Prime/Notification/NotificationBuilder.php @@ -9,7 +9,6 @@ use Flasher\Prime\Stamp\HopsStamp; use Flasher\Prime\Stamp\PriorityStamp; use Flasher\Prime\Stamp\StampInterface; use Flasher\Prime\Storage\StorageManagerInterface; -use Flasher\Toastr\Prime\ToastrBuilder; class NotificationBuilder implements NotificationBuilderInterface { @@ -24,8 +23,6 @@ class NotificationBuilder implements NotificationBuilderInterface protected $storageManager; /** - * @param StorageManagerInterface $storageManager - * @param NotificationInterface $notification * @param string $handler */ public function __construct(StorageManagerInterface $storageManager, NotificationInterface $notification, $handler) @@ -37,7 +34,6 @@ class NotificationBuilder implements NotificationBuilderInterface /** * @param string $message - * @param array $options * * @return Envelope */ @@ -48,7 +44,6 @@ class NotificationBuilder implements NotificationBuilderInterface /** * @param string $message - * @param array $options * * @return Envelope */ @@ -59,7 +54,6 @@ class NotificationBuilder implements NotificationBuilderInterface /** * @param string $message - * @param array $options * * @return Envelope */ @@ -70,7 +64,6 @@ class NotificationBuilder implements NotificationBuilderInterface /** * @param string $message - * @param array $options * * @return Envelope */ @@ -79,9 +72,6 @@ class NotificationBuilder implements NotificationBuilderInterface return $this->addFlash(NotificationInterface::TYPE_INFO, $message, $options); } - /** - * @inheritDoc - */ public function addFlash($type, $message = null, array $options = array()) { if ($type instanceof NotificationInterface) { @@ -94,9 +84,6 @@ class NotificationBuilder implements NotificationBuilderInterface return $this->flash(); } - /** - * @inheritDoc - */ public function flash($stamps = array()) { if (!empty($stamps)) { @@ -108,9 +95,6 @@ class NotificationBuilder implements NotificationBuilderInterface return $this->getEnvelope(); } - /** - * @inheritDoc - */ public function type($type, $message = null, array $options = array()) { $this->envelope->setType($type); @@ -126,9 +110,6 @@ class NotificationBuilder implements NotificationBuilderInterface return $this; } - /** - * @inheritDoc - */ public function message($message) { $this->envelope->setMessage(addslashes($message)); @@ -136,9 +117,6 @@ class NotificationBuilder implements NotificationBuilderInterface return $this; } - /** - * @inheritDoc - */ public function options($options, $merge = true) { if (true === $merge) { @@ -150,9 +128,6 @@ class NotificationBuilder implements NotificationBuilderInterface return $this; } - /** - * @inheritDoc - */ public function option($name, $value) { $this->envelope->setOption($name, $value); @@ -160,41 +135,26 @@ class NotificationBuilder implements NotificationBuilderInterface return $this; } - /** - * @inheritDoc - */ public function success($message = null, array $options = array()) { return $this->type(NotificationInterface::TYPE_SUCCESS, $message, $options); } - /** - * @inheritDoc - */ public function error($message = null, array $options = array()) { return $this->type(NotificationInterface::TYPE_ERROR, $message, $options); } - /** - * @inheritDoc - */ public function info($message = null, array $options = array()) { return $this->type(NotificationInterface::TYPE_INFO, $message, $options); } - /** - * @inheritDoc - */ public function warning($message = null, array $options = array()) { return $this->type(NotificationInterface::TYPE_WARNING, $message, $options); } - /** - * @inheritDoc - */ public function priority($priority) { $this->envelope->withStamp(new PriorityStamp($priority)); @@ -202,9 +162,6 @@ class NotificationBuilder implements NotificationBuilderInterface return $this; } - /** - * @inheritDoc - */ public function hops($amount) { $this->envelope->withStamp(new HopsStamp($amount)); @@ -212,9 +169,6 @@ class NotificationBuilder implements NotificationBuilderInterface return $this; } - /** - * @inheritDoc - */ public function keep() { $hopsStamp = $this->envelope->get('Flasher\Prime\Stamp\HopsStamp'); @@ -225,9 +179,6 @@ class NotificationBuilder implements NotificationBuilderInterface return $this; } - /** - * @inheritDoc - */ public function delay($delay) { $this->envelope->withStamp(new DelayStamp($delay)); @@ -235,17 +186,11 @@ class NotificationBuilder implements NotificationBuilderInterface return $this; } - /** - * @inheritDoc - */ public function now() { return $this->delay(0); } - /** - * @inheritDoc - */ public function with(array $stamps = array()) { $this->envelope->with($stamps); @@ -253,9 +198,6 @@ class NotificationBuilder implements NotificationBuilderInterface return $this; } - /** - * @inheritDoc - */ public function withStamp(StampInterface $stamp) { $this->envelope->withStamp($stamp); @@ -263,17 +205,11 @@ class NotificationBuilder implements NotificationBuilderInterface return $this; } - /** - * @inheritDoc - */ public function getEnvelope() { return $this->envelope; } - /** - * @inheritDoc - */ public function handler($handler) { $this->envelope->withStamp(new HandlerStamp($handler)); diff --git a/src/Prime/Notification/NotificationBuilderInterface.php b/src/Prime/Notification/NotificationBuilderInterface.php index 25be373e..2cba1f02 100644 --- a/src/Prime/Notification/NotificationBuilderInterface.php +++ b/src/Prime/Notification/NotificationBuilderInterface.php @@ -9,7 +9,6 @@ interface NotificationBuilderInterface { /** * @param string $message - * @param array $options * * @return Envelope */ @@ -17,7 +16,6 @@ interface NotificationBuilderInterface /** * @param string $message - * @param array $options * * @return Envelope */ @@ -25,7 +23,6 @@ interface NotificationBuilderInterface /** * @param string $message - * @param array $options * * @return Envelope */ @@ -33,7 +30,6 @@ interface NotificationBuilderInterface /** * @param string $message - * @param array $options * * @return Envelope */ @@ -42,7 +38,6 @@ interface NotificationBuilderInterface /** * @param string|NotificationInterface $type * @param string $message - * @param array $options * * @return Envelope|mixed */ @@ -51,7 +46,6 @@ interface NotificationBuilderInterface /** * @param string $type * @param string|null $message - * @param array $options * * @return self */ @@ -82,7 +76,6 @@ interface NotificationBuilderInterface /** * @param string|null $message - * @param array $options * * @return self */ @@ -90,16 +83,13 @@ interface NotificationBuilderInterface /** * @param string|null $message - * @param array $options * * @return self */ public function error($message = null, array $options = array()); - /** * @param string|null $message - * @param array $options * * @return self */ @@ -107,7 +97,6 @@ interface NotificationBuilderInterface /** * @param string|null $message - * @param array $options * * @return self */ @@ -140,8 +129,6 @@ interface NotificationBuilderInterface public function handler($handler); /** - * @param StampInterface $stamp - * * @return self */ public function withStamp(StampInterface $stamp); diff --git a/src/Prime/Notification/NotificationInterface.php b/src/Prime/Notification/NotificationInterface.php index 688fc363..502133bd 100644 --- a/src/Prime/Notification/NotificationInterface.php +++ b/src/Prime/Notification/NotificationInterface.php @@ -5,8 +5,11 @@ namespace Flasher\Prime\Notification; interface NotificationInterface { const TYPE_SUCCESS = 'success'; - const TYPE_ERROR = 'error'; - const TYPE_INFO = 'info'; + + const TYPE_ERROR = 'error'; + + const TYPE_INFO = 'info'; + const TYPE_WARNING = 'warning'; /** diff --git a/src/Prime/Response/Presenter/ArrayPresenter.php b/src/Prime/Response/Presenter/ArrayPresenter.php index 7c56d23c..4dd91426 100755 --- a/src/Prime/Response/Presenter/ArrayPresenter.php +++ b/src/Prime/Response/Presenter/ArrayPresenter.php @@ -6,9 +6,6 @@ use Flasher\Prime\Response\Response; final class ArrayPresenter implements PresenterInterface { - /** - * @inheritDoc - */ public function render(Response $response) { return $response->toArray(); diff --git a/src/Prime/Response/Presenter/HtmlPresenter.php b/src/Prime/Response/Presenter/HtmlPresenter.php index 07f8dd16..1629c2c6 100755 --- a/src/Prime/Response/Presenter/HtmlPresenter.php +++ b/src/Prime/Response/Presenter/HtmlPresenter.php @@ -6,9 +6,6 @@ use Flasher\Prime\Response\Response; final class HtmlPresenter implements PresenterInterface { - /** - * @inheritDoc - */ public function render(Response $response) { if (0 === count($response->getEnvelopes())) { @@ -18,17 +15,16 @@ final class HtmlPresenter implements PresenterInterface $scripts = $this->renderScripts($response->getScripts(), $response->getContext()); $options = json_encode($response->toArray()); - return << Flasher.getInstance().render({$options}); -HTML; +CODE_SAMPLE; } /** * @param string[] $scripts - * @param array $context * * @return string */ @@ -38,7 +34,7 @@ HTML; foreach ($scripts as $file) { if (empty($context['content']) || false === strpos($context['content'], $file)) { - $html .= sprintf('', $file).PHP_EOL; + $html .= sprintf('', $file) . PHP_EOL; } } diff --git a/src/Prime/Response/Presenter/PresenterInterface.php b/src/Prime/Response/Presenter/PresenterInterface.php index 43e766ef..1ad05cf5 100755 --- a/src/Prime/Response/Presenter/PresenterInterface.php +++ b/src/Prime/Response/Presenter/PresenterInterface.php @@ -7,8 +7,6 @@ use Flasher\Prime\Response\Response; interface PresenterInterface { /** - * @param Response $response - * * @return mixed */ public function render(Response $response); diff --git a/src/Prime/Response/Resource/ResourceManager.php b/src/Prime/Response/Resource/ResourceManager.php index 81756dce..31c2da5f 100644 --- a/src/Prime/Response/Resource/ResourceManager.php +++ b/src/Prime/Response/Resource/ResourceManager.php @@ -20,16 +20,6 @@ final class ResourceManager implements ResourceManagerInterface */ private $templateEngine; - /** - * @param ConfigInterface $config - * @param EngineInterface $templateEngine - */ - public function __construct(ConfigInterface $config, EngineInterface $templateEngine) - { - $this->config = $config; - $this->templateEngine = $templateEngine; - } - /** * @var array */ @@ -45,9 +35,12 @@ final class ResourceManager implements ResourceManagerInterface */ private $options = array(); - /** - * @inheritDoc - */ + public function __construct(ConfigInterface $config, EngineInterface $templateEngine) + { + $this->config = $config; + $this->templateEngine = $templateEngine; + } + public function filterResponse(Response $response) { $response->addScripts($this->config->get('root_scripts', array())); @@ -61,7 +54,7 @@ final class ResourceManager implements ResourceManagerInterface $handler = $this->handleTemplateStamp($envelope); } - if (in_array($handler, $handlers)) { + if (in_array($handler, $handlers, true)) { continue; } @@ -83,44 +76,21 @@ final class ResourceManager implements ResourceManagerInterface return $response; } - /** - * @inheritDoc - */ public function addScripts($alias, array $scripts) { $this->scripts[$alias] = $scripts; } - /** - * @inheritDoc - */ public function addStyles($alias, array $styles) { $this->styles[$alias] = $styles; } - /** - * @inheritDoc - */ public function addOptions($alias, array $options) { $this->options[$alias] = $options; } - private function handleTemplateStamp(Envelope $envelope) - { - $view = $this->config->get('template_factory.default'); - $template = $this->config->get('template_factory.templates.'.$view.'.view'); - - $compiled = $this->templateEngine->render($template, array( - 'envelope' => $envelope, - )); - - $envelope->withStamp(new TemplateStamp($compiled)); - - return 'template_' . $view; - } - /** * @return ConfigInterface */ @@ -128,4 +98,18 @@ final class ResourceManager implements ResourceManagerInterface { return $this->config; } + + private function handleTemplateStamp(Envelope $envelope) + { + $view = $this->config->get('template_factory.default'); + $template = $this->config->get('template_factory.templates.' . $view . '.view'); + + $compiled = $this->templateEngine->render($template, array( + 'envelope' => $envelope, + )); + + $envelope->withStamp(new TemplateStamp($compiled)); + + return 'template_' . $view; + } } diff --git a/src/Prime/Response/Resource/ResourceManagerInterface.php b/src/Prime/Response/Resource/ResourceManagerInterface.php index 91ffec6a..75185923 100644 --- a/src/Prime/Response/Resource/ResourceManagerInterface.php +++ b/src/Prime/Response/Resource/ResourceManagerInterface.php @@ -7,8 +7,6 @@ use Flasher\Prime\Response\Response; interface ResourceManagerInterface { /** - * @param Response $response - * * @return Response */ public function filterResponse(Response $response); @@ -27,7 +25,6 @@ interface ResourceManagerInterface /** * @param string $alias - * @param array $options */ public function addOptions($alias, array $options); } diff --git a/src/Prime/Response/Response.php b/src/Prime/Response/Response.php index 0a232be2..8efd1061 100755 --- a/src/Prime/Response/Response.php +++ b/src/Prime/Response/Response.php @@ -31,10 +31,6 @@ final class Response */ private $context; - /** - * @param array $envelopes - * @param array $context - */ public function __construct(array $envelopes, array $context) { $this->envelopes = $envelopes; @@ -59,7 +55,6 @@ final class Response /** * @param string $alias - * @param array $options */ public function addOptions($alias, array $options) { @@ -119,7 +114,7 @@ final class Response $this->getEnvelopes() ), 'scripts' => $this->getScripts(), - 'styles' => $this->getStyles(), + 'styles' => $this->getStyles(), 'options' => $this->getOptions(), ); } diff --git a/src/Prime/Response/ResponseManager.php b/src/Prime/Response/ResponseManager.php index a8035e13..ac4fae24 100755 --- a/src/Prime/Response/ResponseManager.php +++ b/src/Prime/Response/ResponseManager.php @@ -5,8 +5,8 @@ namespace Flasher\Prime\Response; use Flasher\Prime\Envelope; use Flasher\Prime\EventDispatcher\Event\FilterEvent; use Flasher\Prime\EventDispatcher\EventDispatcherInterface; -use Flasher\Prime\Response\Resource\ResourceManagerInterface; use Flasher\Prime\Response\Presenter\PresenterInterface; +use Flasher\Prime\Response\Resource\ResourceManagerInterface; use Flasher\Prime\Storage\StorageManagerInterface; final class ResponseManager implements ResponseManagerInterface @@ -31,11 +31,6 @@ final class ResponseManager implements ResponseManagerInterface */ private $resourceManager; - /** - * @param StorageManagerInterface $storageManager - * @param EventDispatcherInterface $eventDispatcher - * @param ResourceManagerInterface $resourceManager - */ public function __construct( StorageManagerInterface $storageManager, EventDispatcherInterface $eventDispatcher, @@ -46,9 +41,6 @@ final class ResponseManager implements ResponseManagerInterface $this->resourceManager = $resourceManager; } - /** - * @inheritDoc - */ public function render(array $criteria = array(), $format = 'html', array $context = array()) { $envelopes = $this->getEnvelopes($criteria); @@ -62,19 +54,6 @@ final class ResponseManager implements ResponseManagerInterface return $presenter->render($response); } - /** - * @param Envelope[] $envelopes - * @param array $context - * - * @return Response - */ - private function filterResponse($envelopes, $context) - { - $response = new Response($envelopes, $context); - - return $this->resourceManager->filterResponse($response); - } - /** * @param $alias * @@ -91,7 +70,6 @@ final class ResponseManager implements ResponseManagerInterface /** * @param string $alias - * @param PresenterInterface $presenter */ public function addPresenter($alias, PresenterInterface $presenter) { @@ -99,8 +77,19 @@ final class ResponseManager implements ResponseManagerInterface } /** - * @param array $criteria + * @param Envelope[] $envelopes + * @param array $context * + * @return Response + */ + private function filterResponse($envelopes, $context) + { + $response = new Response($envelopes, $context); + + return $this->resourceManager->filterResponse($response); + } + + /** * @return Envelope[] */ private function getEnvelopes(array $criteria) diff --git a/src/Prime/Response/ResponseManagerInterface.php b/src/Prime/Response/ResponseManagerInterface.php index 79ef0b1e..33dd2bf3 100755 --- a/src/Prime/Response/ResponseManagerInterface.php +++ b/src/Prime/Response/ResponseManagerInterface.php @@ -5,9 +5,7 @@ namespace Flasher\Prime\Response; interface ResponseManagerInterface { /** - * @param array $criteria * @param string $format - * @param array $context * * @return mixed */ diff --git a/src/Prime/Stamp/CreatedAtStamp.php b/src/Prime/Stamp/CreatedAtStamp.php index 37953002..087b8567 100644 --- a/src/Prime/Stamp/CreatedAtStamp.php +++ b/src/Prime/Stamp/CreatedAtStamp.php @@ -19,7 +19,6 @@ final class CreatedAtStamp implements StampInterface, OrderableStampInterface, P private $format; /** - * @param DateTime|null $createdAt * @param string|null $format * * @throws Exception @@ -45,16 +44,13 @@ final class CreatedAtStamp implements StampInterface, OrderableStampInterface, P */ public function compare($orderable) { - if (!$orderable instanceof CreatedAtStamp) { + if (!$orderable instanceof self) { return 1; } return $this->createdAt->getTimestamp() - $orderable->createdAt->getTimestamp(); } - /** - * @inheritDoc - */ public function toArray() { return array( diff --git a/src/Prime/Stamp/HandlerStamp.php b/src/Prime/Stamp/HandlerStamp.php index de42bbe4..227c2e9e 100644 --- a/src/Prime/Stamp/HandlerStamp.php +++ b/src/Prime/Stamp/HandlerStamp.php @@ -25,9 +25,6 @@ final class HandlerStamp implements StampInterface, PresentableStampInterface return $this->handler; } - /** - * @inheritDoc - */ public function toArray() { return array( diff --git a/src/Prime/Stamp/PriorityStamp.php b/src/Prime/Stamp/PriorityStamp.php index cd5439dc..63117298 100644 --- a/src/Prime/Stamp/PriorityStamp.php +++ b/src/Prime/Stamp/PriorityStamp.php @@ -32,16 +32,13 @@ final class PriorityStamp implements StampInterface, OrderableStampInterface, Pr */ public function compare($orderable) { - if (!$orderable instanceof PriorityStamp) { + if (!$orderable instanceof self) { return 1; } return $this->priority - $orderable->priority; } - /** - * @inheritDoc - */ public function toArray() { return array( diff --git a/src/Prime/Stamp/TemplateStamp.php b/src/Prime/Stamp/TemplateStamp.php index 185ce85b..04eed1d7 100644 --- a/src/Prime/Stamp/TemplateStamp.php +++ b/src/Prime/Stamp/TemplateStamp.php @@ -25,9 +25,6 @@ final class TemplateStamp implements StampInterface, PresentableStampInterface return $this->template; } - /** - * @inheritDoc - */ public function toArray() { return array( diff --git a/src/Prime/Storage/ArrayStorage.php b/src/Prime/Storage/ArrayStorage.php index 26cbbb58..f308acbd 100644 --- a/src/Prime/Storage/ArrayStorage.php +++ b/src/Prime/Storage/ArrayStorage.php @@ -12,26 +12,17 @@ final class ArrayStorage implements StorageInterface */ private $envelopes = array(); - /** - * @inheritDoc - */ public function all() { return $this->envelopes; } - /** - * @inheritDoc - */ public function add($envelopes) { $envelopes = is_array($envelopes) ? $envelopes : func_get_args(); $this->envelopes = array_merge($this->envelopes, $envelopes); } - /** - * @inheritDoc - */ public function update($envelopes) { $envelopes = is_array($envelopes) ? $envelopes : func_get_args(); @@ -48,9 +39,6 @@ final class ArrayStorage implements StorageInterface } } - /** - * @inheritDoc - */ public function remove($envelopes) { $envelopes = is_array($envelopes) ? $envelopes : func_get_args(); @@ -63,9 +51,6 @@ final class ArrayStorage implements StorageInterface }); } - /** - * @inheritDoc - */ public function clear() { $this->envelopes = array(); diff --git a/src/Prime/Storage/StorageManager.php b/src/Prime/Storage/StorageManager.php index 51c21faa..0ac28164 100644 --- a/src/Prime/Storage/StorageManager.php +++ b/src/Prime/Storage/StorageManager.php @@ -19,27 +19,17 @@ final class StorageManager implements StorageManagerInterface */ private $eventDispatcher; - /** - * @param StorageInterface $storage - * @param EventDispatcherInterface $eventDispatcher - */ public function __construct(StorageInterface $storage, EventDispatcherInterface $eventDispatcher) { $this->storage = $storage; $this->eventDispatcher = $eventDispatcher; } - /** - * @inheritDoc - */ public function all() { return $this->storage->all(); } - /** - * @inheritDoc - */ public function add($envelopes) { $envelopes = is_array($envelopes) ? $envelopes : func_get_args(); @@ -50,9 +40,6 @@ final class StorageManager implements StorageManagerInterface $this->storage->add($event->getEnvelopes()); } - /** - * @inheritDoc - */ public function update($envelopes) { $envelopes = is_array($envelopes) ? $envelopes : func_get_args(); @@ -63,9 +50,6 @@ final class StorageManager implements StorageManagerInterface $this->storage->update($event->getEnvelopes()); } - /** - * @inheritDoc - */ public function remove($envelopes) { $envelopes = is_array($envelopes) ? $envelopes : func_get_args(); @@ -77,9 +61,6 @@ final class StorageManager implements StorageManagerInterface $this->storage->remove($event->getEnvelopesToRemove()); } - /** - * @inheritDoc - */ public function clear() { $this->storage->clear(); diff --git a/src/Prime/Template/Engine.php b/src/Prime/Template/Engine.php index 04e924ff..3feae12d 100644 --- a/src/Prime/Template/Engine.php +++ b/src/Prime/Template/Engine.php @@ -11,7 +11,7 @@ final class Engine implements EngineInterface extract($context, \EXTR_SKIP); if (!file_exists($name)) { - $name = __DIR__.'/views/'.$name; + $name = __DIR__ . '/views/' . $name; if (!file_exists($name)) { throw new \Exception(sprintf('Cannot find template "%s"', $name)); diff --git a/src/Prime/Template/EngineInterface.php b/src/Prime/Template/EngineInterface.php index 3edb8845..5c7fe123 100644 --- a/src/Prime/Template/EngineInterface.php +++ b/src/Prime/Template/EngineInterface.php @@ -6,7 +6,6 @@ interface EngineInterface { /** * @param string $name - * @param array $context * * @return string */ diff --git a/src/Prime/Tests/Config/ConfigTest.php b/src/Prime/Tests/Config/ConfigTest.php index c35dfaaa..f637bbb1 100644 --- a/src/Prime/Tests/Config/ConfigTest.php +++ b/src/Prime/Tests/Config/ConfigTest.php @@ -15,25 +15,25 @@ final class ConfigTest extends TestCase 'drivers' => array( 'toastr' => array( 'scripts' => array('script.js'), - 'styles' => array('styles.css'), - 'options' => array() - ) + 'styles' => array('styles.css'), + 'options' => array(), + ), ), ) ); - $this->assertEquals('default_flasher', $config->get('default')); - $this->assertEquals( + $this->assertSame('default_flasher', $config->get('default')); + $this->assertSame( array( 'scripts' => array('script.js'), - 'styles' => array('styles.css'), - 'options' => array() + 'styles' => array('styles.css'), + 'options' => array(), ), $config->get('drivers.toastr') ); - $this->assertEquals(array('styles.css'), $config->get('drivers.toastr.styles')); - $this->assertEquals(array(), $config->get('drivers.toastr.options')); - $this->assertEquals(null, $config->get('drivers.not_exists.options')); - $this->assertEquals('now_it_exists', $config->get('drivers.not_exists.options', 'now_it_exists')); + $this->assertSame(array('styles.css'), $config->get('drivers.toastr.styles')); + $this->assertSame(array(), $config->get('drivers.toastr.options')); + $this->assertSame(null, $config->get('drivers.not_exists.options')); + $this->assertSame('now_it_exists', $config->get('drivers.not_exists.options', 'now_it_exists')); } } diff --git a/src/Prime/Tests/Envelope/EnvelopeTest.php b/src/Prime/Tests/Envelope/EnvelopeTest.php index 80910194..868fb863 100644 --- a/src/Prime/Tests/Envelope/EnvelopeTest.php +++ b/src/Prime/Tests/Envelope/EnvelopeTest.php @@ -10,42 +10,49 @@ final class EnvelopeTest extends TestCase public function testConstruct() { $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); - $stamp = $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(); + $stamp = $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(); $envelope = new Envelope($notification, array($stamp)); $this->assertSame($notification, $envelope->getNotification()); - $this->assertSame(array(get_class($stamp) => $stamp), $envelope->all()); + $this->assertSame(array( + get_class($stamp) => $stamp, + ), $envelope->all()); } public function testWith() { $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); - $stamp1 = $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(); - $stamp2 = $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(); + $stamp1 = $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(); + $stamp2 = $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(); $envelope = new Envelope($notification); $envelope->with($stamp1, $stamp2); $this->assertSame($notification, $envelope->getNotification()); - $this->assertSame(array(get_class($stamp1) => $stamp1, get_class($stamp2) => $stamp2), $envelope->all()); + $this->assertSame(array( + get_class($stamp1) => $stamp1, + get_class($stamp2) => $stamp2, + ), $envelope->all()); } public function testWrap() { $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); - $stamp = $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(); + $stamp = $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(); $envelope = Envelope::wrap($notification, array($stamp)); $this->assertSame($notification, $envelope->getNotification()); - $this->assertSame(array(get_class($stamp) => $stamp), $envelope->all()); + $this->assertSame(array( + get_class($stamp) => $stamp, + ), $envelope->all()); } public function testAll() { $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); - $stamps = array( + $stamps = array( $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(), $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(), $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(), @@ -55,13 +62,15 @@ final class EnvelopeTest extends TestCase $envelope = new Envelope($notification, $stamps); $this->assertSame($notification, $envelope->getNotification()); - $this->assertSame(array(get_class($stamps[0]) => $stamps[3]), $envelope->all()); + $this->assertSame(array( + get_class($stamps[0]) => $stamps[3], + ), $envelope->all()); } public function testGet() { $notification = $this->getMockBuilder('\Flasher\Prime\Notification\NotificationInterface')->getMock(); - $stamps = array( + $stamps = array( $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(), $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(), $this->getMockBuilder('Flasher\Prime\Stamp\StampInterface')->getMock(), diff --git a/src/Prime/Tests/Envelope/Stamp/CreatedAtStampTest.php b/src/Prime/Tests/Envelope/Stamp/CreatedAtStampTest.php index 7c7f319f..40200efa 100644 --- a/src/Prime/Tests/Envelope/Stamp/CreatedAtStampTest.php +++ b/src/Prime/Tests/Envelope/Stamp/CreatedAtStampTest.php @@ -12,7 +12,7 @@ final class CreatedAtStampTest extends TestCase public function testConstruct() { $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); - $stamp = new CreatedAtStamp(); + $stamp = new CreatedAtStamp(); $envelop = new Envelope($notification, array($stamp)); diff --git a/src/Prime/Tests/Envelope/Stamp/HandlerStampTest.php b/src/Prime/Tests/Envelope/Stamp/HandlerStampTest.php index 0616ec96..2cb13ef2 100644 --- a/src/Prime/Tests/Envelope/Stamp/HandlerStampTest.php +++ b/src/Prime/Tests/Envelope/Stamp/HandlerStampTest.php @@ -11,7 +11,7 @@ final class HandlerStampTest extends TestCase public function testConstruct() { $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); - $stamp = new HandlerStamp('toastr'); + $stamp = new HandlerStamp('toastr'); $envelop = new Envelope($notification, array($stamp)); diff --git a/src/Prime/Tests/Envelope/Stamp/HopsStampTest.php b/src/Prime/Tests/Envelope/Stamp/HopsStampTest.php index 86dcd6d8..53164ee8 100644 --- a/src/Prime/Tests/Envelope/Stamp/HopsStampTest.php +++ b/src/Prime/Tests/Envelope/Stamp/HopsStampTest.php @@ -11,7 +11,7 @@ final class HopsStampTest extends TestCase public function testConstruct() { $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); - $stamp = new HopsStamp(5); + $stamp = new HopsStamp(5); $envelop = new Envelope($notification, array($stamp)); diff --git a/src/Prime/Tests/Envelope/Stamp/PriorityStampTest.php b/src/Prime/Tests/Envelope/Stamp/PriorityStampTest.php index ef6eb69e..d92f3a86 100644 --- a/src/Prime/Tests/Envelope/Stamp/PriorityStampTest.php +++ b/src/Prime/Tests/Envelope/Stamp/PriorityStampTest.php @@ -12,7 +12,7 @@ final class PriorityStampTest extends TestCase public function testConstruct() { $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); - $stamp = new PriorityStamp(5); + $stamp = new PriorityStamp(5); $envelop = new Envelope($notification, array($stamp)); diff --git a/src/Prime/Tests/Envelope/Stamp/UuidStampTest.php b/src/Prime/Tests/Envelope/Stamp/UuidStampTest.php index 92fb432d..7929b5c0 100644 --- a/src/Prime/Tests/Envelope/Stamp/UuidStampTest.php +++ b/src/Prime/Tests/Envelope/Stamp/UuidStampTest.php @@ -11,7 +11,7 @@ final class UuidStampTest extends TestCase public function testConstruct() { $notification = $this->getMockBuilder('Flasher\Prime\Notification\NotificationInterface')->getMock(); - $stamp = new UuidStamp(); + $stamp = new UuidStamp(); $envelop = new Envelope($notification, array($stamp)); diff --git a/src/Prime/Tests/EventDispatcher/EventDispatcherTest.php b/src/Prime/Tests/EventDispatcher/EventDispatcherTest.php index 61186f79..b0d30220 100644 --- a/src/Prime/Tests/EventDispatcher/EventDispatcherTest.php +++ b/src/Prime/Tests/EventDispatcher/EventDispatcherTest.php @@ -10,9 +10,12 @@ use Flasher\Prime\Tests\TestCase; class EventDispatcherTest extends TestCase { /* Some pseudo events */ - const preFoo = 'pre.foo'; + const preFoo = 'pre.foo'; + const postFoo = 'post.foo'; - const preBar = 'pre.bar'; + + const preBar = 'pre.bar'; + const postBar = 'post.bar'; public function testInitialState() @@ -87,7 +90,7 @@ class EventDispatcherTest extends TestCase $dispatcher->addListener('Flasher\Prime\Tests\EventDispatcher\Event', $listener); $dispatcher->addListener('AnotherEvent', $listener); $dispatcher->dispatch($event); - $this->assertEquals(1, $invoked); + $this->assertSame(1, $invoked); } public function testStopEventPropagation() @@ -128,7 +131,7 @@ class EventDispatcherTest extends TestCase $dispatcher->addListener('Flasher\Prime\Tests\EventDispatcher\Event', $listener2); $dispatcher->addListener('Flasher\Prime\Tests\EventDispatcher\Event', $listener3, 10); $dispatcher->dispatch($event); - $this->assertEquals(array('3', '2', '1'), $invoked); + $this->assertSame(array('3', '2', '1'), $invoked); } } @@ -184,7 +187,10 @@ class TestEventSubscriber implements EventSubscriberInterface { public static function getSubscribedEvents() { - return array('pre.foo' => 'preFoo', 'post.foo' => 'postFoo'); + return array( + 'pre.foo' => 'preFoo', + 'post.foo' => 'postFoo', + ); } } @@ -193,7 +199,7 @@ class TestEventSubscriberWithPriorities implements EventSubscriberInterface public static function getSubscribedEvents() { return array( - 'pre.foo' => array('preFoo', 10), + 'pre.foo' => array('preFoo', 10), 'post.foo' => array('postFoo'), ); } diff --git a/src/Prime/Tests/Filter/CriteriaBuilderTest.php b/src/Prime/Tests/Filter/CriteriaBuilderTest.php index ecd2d94b..4e1c8d23 100644 --- a/src/Prime/Tests/Filter/CriteriaBuilderTest.php +++ b/src/Prime/Tests/Filter/CriteriaBuilderTest.php @@ -12,8 +12,8 @@ final class CriteriaBuilderTest extends TestCase { $criteria = new CriteriaBuilder(new FilterBuilder(), array( 'priority' => 1, - 'life' => 2, - 'limit' => 2, + 'life' => 2, + 'limit' => 2, 'order_by' => 'Flasher\Prime\Stamp\HopsStamp', )); diff --git a/src/Prime/Tests/Filter/FilterBuilderTest.php b/src/Prime/Tests/Filter/FilterBuilderTest.php index 5b1d8e58..bef2d6c4 100644 --- a/src/Prime/Tests/Filter/FilterBuilderTest.php +++ b/src/Prime/Tests/Filter/FilterBuilderTest.php @@ -24,7 +24,7 @@ final class FilterBuilderTest extends TestCase $filtered = $builder->filter($envelopes); $expected = $envelopes; - $this->assertEquals($expected, $filtered); + $this->assertSame($expected, $filtered); } public function testMaxResults() @@ -41,7 +41,7 @@ final class FilterBuilderTest extends TestCase $filtered = $builder->filter($envelopes); $expected = array_slice($envelopes, 0, 2); - $this->assertEquals($expected, $filtered); + $this->assertSame($expected, $filtered); } public function testOrderingByPriority() @@ -87,6 +87,6 @@ final class FilterBuilderTest extends TestCase $envelopes[4], ); - $this->assertEquals($expected, $filtered); + $this->assertSame($expected, $filtered); } } diff --git a/src/Prime/Tests/Storage/ArrayStorageTest.php b/src/Prime/Tests/Storage/ArrayStorageTest.php index fe89bc72..619ac145 100644 --- a/src/Prime/Tests/Storage/ArrayStorageTest.php +++ b/src/Prime/Tests/Storage/ArrayStorageTest.php @@ -12,7 +12,7 @@ final class ArrayStorageTest extends TestCase { public function testAdd() { - $storage = new ArrayStorage(); + $storage = new ArrayStorage(); $envelopes = array(); foreach (range(0, 4) as $index) { @@ -38,7 +38,7 @@ final class ArrayStorageTest extends TestCase public function testClear() { - $storage = new ArrayStorage(); + $storage = new ArrayStorage(); $envelopes = array(); foreach (range(0, 4) as $index) { @@ -53,7 +53,7 @@ final class ArrayStorageTest extends TestCase public function testRemove() { - $storage = new ArrayStorage(); + $storage = new ArrayStorage(); $envelopes = array(); foreach (range(0, 4) as $index) { @@ -63,7 +63,7 @@ final class ArrayStorageTest extends TestCase $storage->remove($envelopes[0], $envelopes[2]); - $actual = UuidStamp::indexByUuid($storage->all()); + $actual = UuidStamp::indexByUuid($storage->all()); $expected = UuidStamp::indexByUuid($envelopes[1], $envelopes[3], $envelopes[4]); $this->assertSame(array(), array_diff_key($actual, $expected)); diff --git a/src/Prime/Tests/Storage/StorageManagerTest.php b/src/Prime/Tests/Storage/StorageManagerTest.php index 26378437..8a4bf1e0 100644 --- a/src/Prime/Tests/Storage/StorageManagerTest.php +++ b/src/Prime/Tests/Storage/StorageManagerTest.php @@ -14,7 +14,7 @@ class StorageManagerTest extends TestCase public function testAll() { $storageManager = new StorageManager(new ArrayStorage(), new EventDispatcher()); - $envelopes = array(); + $envelopes = array(); foreach (range(0, 4) as $index) { $envelopes[$index] = new Envelope(new Notification()); @@ -27,7 +27,7 @@ class StorageManagerTest extends TestCase public function testClear() { $storageManager = new StorageManager(new ArrayStorage(), new EventDispatcher()); - $envelopes = array(); + $envelopes = array(); foreach (range(0, 4) as $index) { $envelopes[$index] = new Envelope(new Notification()); @@ -41,7 +41,7 @@ class StorageManagerTest extends TestCase public function testAdd() { - $storageManager = new StorageManager(new ArrayStorage(),new EventDispatcher()); + $storageManager = new StorageManager(new ArrayStorage(), new EventDispatcher()); $storageManager->add(new Envelope(new Notification())); $envelopes = $storageManager->all(); diff --git a/src/Prime/Tests/TestCase.php b/src/Prime/Tests/TestCase.php index ed5e10f4..d5b4f95c 100644 --- a/src/Prime/Tests/TestCase.php +++ b/src/Prime/Tests/TestCase.php @@ -30,7 +30,7 @@ class TestCase extends \PHPUnit\Framework\TestCase protected function callMethod(&$object, $methodName, $parameters = array()) { $reflection = new ReflectionClass(get_class($object)); - $method = $reflection->getMethod($methodName); + $method = $reflection->getMethod($methodName); $method->setAccessible(true); $parameters = is_array($parameters) ? $parameters : array_slice(func_get_args(), 2); diff --git a/src/SweetAlert/Laravel/.phpcs.xml.dist b/src/SweetAlert/Laravel/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/src/SweetAlert/Laravel/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/SweetAlert/Laravel/Facade/SweetAlert.php b/src/SweetAlert/Laravel/Facade/SweetAlert.php index b456b27f..a74953bd 100644 --- a/src/SweetAlert/Laravel/Facade/SweetAlert.php +++ b/src/SweetAlert/Laravel/Facade/SweetAlert.php @@ -6,11 +6,8 @@ use Illuminate\Support\Facades\Facade; class SweetAlert extends Facade { - /** - * @inheritdoc - */ protected static function getFacadeAccessor() { return 'flasher.sweet_alert'; } -} \ No newline at end of file +} diff --git a/src/SweetAlert/Laravel/FlasherSweetAlertServiceProvider.php b/src/SweetAlert/Laravel/FlasherSweetAlertServiceProvider.php index ea57f694..ca747523 100644 --- a/src/SweetAlert/Laravel/FlasherSweetAlertServiceProvider.php +++ b/src/SweetAlert/Laravel/FlasherSweetAlertServiceProvider.php @@ -2,9 +2,9 @@ namespace Flasher\SweetAlert\Laravel; +use Flasher\SweetAlert\Laravel\ServiceProvider\ServiceProviderManager; use Illuminate\Container\Container; use Illuminate\Support\ServiceProvider; -use Flasher\SweetAlert\Laravel\ServiceProvider\ServiceProviderManager; final class FlasherSweetAlertServiceProvider extends ServiceProvider { @@ -43,17 +43,11 @@ final class FlasherSweetAlertServiceProvider extends ServiceProvider return $this->app; } - /** - * {@inheritdoc} - */ public function mergeConfigFrom($path, $key) { parent::mergeConfigFrom($path, $key); } - /** - * {@inheritdoc} - */ public function publishes(array $paths, $groups = null) { parent::publishes($paths, $groups); diff --git a/src/SweetAlert/Laravel/Resources/config/config.php b/src/SweetAlert/Laravel/Resources/config/config.php index 55441f6f..842b1b7d 100644 --- a/src/SweetAlert/Laravel/Resources/config/config.php +++ b/src/SweetAlert/Laravel/Resources/config/config.php @@ -5,7 +5,7 @@ return array( 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js', 'https://cdn.jsdelivr.net/npm/@flasher/flasher-sweet-alert@0.1.3/dist/flasher-sweet-alert.min.js', ), - 'styles' => array(), + 'styles' => array(), 'options' => array( 'timer' => 5000, 'timerProgressBar' => true, diff --git a/src/SweetAlert/Laravel/Resources/functions/sweetAlert.php b/src/SweetAlert/Laravel/Resources/functions/sweetAlert.php index 1a51361f..b0137db2 100644 --- a/src/SweetAlert/Laravel/Resources/functions/sweetAlert.php +++ b/src/SweetAlert/Laravel/Resources/functions/sweetAlert.php @@ -3,11 +3,10 @@ use Flasher\Prime\Notification\NotificationInterface; use Illuminate\Support\Facades\App; -if (! function_exists('sweetAlert')) { +if (!function_exists('sweetAlert')) { /** * @param string $message * @param string $type - * @param array $options * * @return \Flasher\SweetAlert\Prime\SweetAlertFactory */ @@ -19,4 +18,4 @@ if (! function_exists('sweetAlert')) { return App::make('flasher.sweet_alert')->addFlash($type, $message, $options); } -} \ No newline at end of file +} diff --git a/src/SweetAlert/Laravel/ServiceProvider/Providers/Laravel.php b/src/SweetAlert/Laravel/ServiceProvider/Providers/Laravel.php index fa547fe9..bf7e2a88 100644 --- a/src/SweetAlert/Laravel/ServiceProvider/Providers/Laravel.php +++ b/src/SweetAlert/Laravel/ServiceProvider/Providers/Laravel.php @@ -17,36 +17,26 @@ class Laravel implements ServiceProviderInterface */ protected $app; - /** - * @param Container $app - */ public function __construct(Container $app) { $this->app = $app; } - /** - * @inheritDoc - */ public function shouldBeUsed() { return $this->app instanceof Application; } - /** - * @inheritDoc - */ public function boot(FlasherSweetAlertServiceProvider $provider) { - $provider->publishes(array(flasher_path(__DIR__.'/../../Resources/config/config.php') => config_path('flasher_sweet_alert.php')), 'flasher-config'); + $provider->publishes(array( + flasher_path(__DIR__ . '/../../Resources/config/config.php') => config_path('flasher_sweet_alert.php'), + ), 'flasher-config'); } - /** - * @inheritDoc - */ public function register(FlasherSweetAlertServiceProvider $provider) { - $provider->mergeConfigFrom(flasher_path(__DIR__.'/../../Resources/config/config.php'), 'flasher_sweet_alert'); + $provider->mergeConfigFrom(flasher_path(__DIR__ . '/../../Resources/config/config.php'), 'flasher_sweet_alert'); $this->appendToFlasherConfig(); $this->registerServices(); diff --git a/src/SweetAlert/Laravel/ServiceProvider/Providers/Laravel4.php b/src/SweetAlert/Laravel/ServiceProvider/Providers/Laravel4.php index db223a67..92a59800 100644 --- a/src/SweetAlert/Laravel/ServiceProvider/Providers/Laravel4.php +++ b/src/SweetAlert/Laravel/ServiceProvider/Providers/Laravel4.php @@ -7,26 +7,21 @@ use Illuminate\Foundation\Application; final class Laravel4 extends Laravel { - /** - * @inheritDoc - */ public function shouldBeUsed() { return $this->app instanceof Application && 0 === strpos(Application::VERSION, '4.'); } - /** - * @inheritDoc - */ public function boot(FlasherSweetAlertServiceProvider $provider) { - $provider->package('php-flasher/flasher-sweet_alert-laravel', 'flasher_sweet_alert', flasher_path(__DIR__.'/../../Resources')); + $provider->package( + 'php-flasher/flasher-sweet_alert-laravel', + 'flasher_sweet_alert', + flasher_path(__DIR__ . '/../../Resources') + ); $this->appendToFlasherConfig(); } - /** - * @inheritDoc - */ public function register(FlasherSweetAlertServiceProvider $provider) { $this->registerServices(); @@ -38,6 +33,9 @@ final class Laravel4 extends Laravel $sweetAlertConfig = $this->app['config']->get('flasher_sweet_alert::config', array()); - $this->app['config']->set('flasher::config.adapters.sweet_alert', array_merge($sweetAlertConfig, $flasherConfig)); + $this->app['config']->set( + 'flasher::config.adapters.sweet_alert', + array_merge($sweetAlertConfig, $flasherConfig) + ); } } diff --git a/src/SweetAlert/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php b/src/SweetAlert/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php index c325f590..bb1998a4 100644 --- a/src/SweetAlert/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php +++ b/src/SweetAlert/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php @@ -11,13 +11,7 @@ interface ServiceProviderInterface */ public function shouldBeUsed(); - /** - * @param FlasherSweetAlertServiceProvider $provider - */ public function boot(FlasherSweetAlertServiceProvider $provider); - /** - * @param FlasherSweetAlertServiceProvider $provider - */ public function register(FlasherSweetAlertServiceProvider $provider); } diff --git a/src/SweetAlert/Laravel/Tests/TestCase.php b/src/SweetAlert/Laravel/Tests/TestCase.php index e6c06fcb..294683f9 100644 --- a/src/SweetAlert/Laravel/Tests/TestCase.php +++ b/src/SweetAlert/Laravel/Tests/TestCase.php @@ -11,6 +11,52 @@ use Orchestra\Testbench\TestCase as Orchestra; class TestCase extends Orchestra { + public function createApplication() + { + if (0 !== strpos(Application::VERSION, '4.0')) { + return parent::createApplication(); + } + + $app = new Application(); + + $app->detectEnvironment(array( + 'local' => array('your-machine-name'), + )); + + $app->bindInstallPaths($this->getApplicationPaths()); + + $app['env'] = 'testing'; + + $app->instance('app', $app); + + Facade::clearResolvedInstances(); + Facade::setFacadeApplication($app); + + $config = new Config($app->getConfigLoader(), $app['env']); + $app->instance('config', $config); + $app->startExceptionHandling(); + + if ($app->runningInConsole()) { + $app->setRequestForConsoleEnvironment(); + } + + date_default_timezone_set($this->getApplicationTimezone()); + + $aliases = array_merge($this->getApplicationAliases(), $this->getPackageAliases()); + AliasLoader::getInstance($aliases)->register(); + + Request::enableHttpMethodParameterOverride(); + + $providers = array_merge($this->getApplicationProviders(), $this->getPackageProviders()); + $app->getProviderRepository()->load($app, $providers); + + $this->getEnvironmentSetUp($app); + + $app->boot(); + + return $app; + } + /** * @param Application $app * @@ -31,61 +77,11 @@ class TestCase extends Orchestra { $separator = $this->isLaravel4() ? '::config' : ''; - $app['config']->set('session'.$separator.'.driver', 'array'); + $app['config']->set('session' . $separator . '.driver', 'array'); } private function isLaravel4() { return 0 === strpos(Application::VERSION, '4.'); } - - /** - * {@inheritdoc} - */ - public function createApplication() - { - if (0 !== strpos(Application::VERSION, '4.0')) { - return parent::createApplication(); - } - - $app = new Application; - - $app->detectEnvironment(array( - 'local' => array('your-machine-name'), - )); - - $app->bindInstallPaths($this->getApplicationPaths()); - - $app['env'] = 'testing'; - - $app->instance('app', $app); - - Facade::clearResolvedInstances(); - Facade::setFacadeApplication($app); - - $config = new Config($app->getConfigLoader(), $app['env']); - $app->instance('config', $config); - $app->startExceptionHandling(); - - if ($app->runningInConsole()) - { - $app->setRequestForConsoleEnvironment(); - } - - date_default_timezone_set($this->getApplicationTimezone()); - - $aliases = array_merge($this->getApplicationAliases(), $this->getPackageAliases()); - AliasLoader::getInstance($aliases)->register(); - - Request::enableHttpMethodParameterOverride(); - - $providers = array_merge($this->getApplicationProviders(), $this->getPackageProviders()); - $app->getProviderRepository()->load($app, $providers); - - $this->getEnvironmentSetUp($app); - - $app->boot(); - - return $app; - } } diff --git a/src/SweetAlert/Prime/.phpcs.xml.dist b/src/SweetAlert/Prime/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/src/SweetAlert/Prime/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/SweetAlert/Prime/SweetAlertBuilder.php b/src/SweetAlert/Prime/SweetAlertBuilder.php index 44245265..91200688 100644 --- a/src/SweetAlert/Prime/SweetAlertBuilder.php +++ b/src/SweetAlert/Prime/SweetAlertBuilder.php @@ -6,9 +6,6 @@ use Flasher\Prime\Notification\NotificationBuilder; final class SweetAlertBuilder extends NotificationBuilder { - /** - * @inheritDoc - */ public function type($type, $message = null, array $options = array()) { $this->icon($type); @@ -20,7 +17,6 @@ final class SweetAlertBuilder extends NotificationBuilder * Display a question typed alert message * * @param string $message - * @param array $options * * @return SweetAlertBuilder */ @@ -88,9 +84,6 @@ final class SweetAlertBuilder extends NotificationBuilder return $this; } - /** - * @inheritDoc - */ public function message($message) { parent::message($message); @@ -394,9 +387,8 @@ final class SweetAlertBuilder extends NotificationBuilder } /** - * If set to false, the user can't dismiss the popup by clicking outside it. - * You can also pass a custom function returning a boolean value, e.g. if you want to disable outside clicks for - * the loading state of a popup. + * If set to false, the user can't dismiss the popup by clicking outside it. You can also pass a custom function + * returning a boolean value, e.g. if you want to disable outside clicks for the loading state of a popup. * * @param bool|string $allowOutsideClick * @@ -425,8 +417,8 @@ final class SweetAlertBuilder extends NotificationBuilder } /** - * If set to false, the user can't confirm the popup by pressing the Enter or Space keys, unless they manually - * focus the confirm button. You can also pass a custom function returning a boolean value. + * If set to false, the user can't confirm the popup by pressing the Enter or Space keys, unless they manually focus + * the confirm button. You can also pass a custom function returning a boolean value. * * @param bool|string $allowEnterKey * @@ -479,8 +471,12 @@ final class SweetAlertBuilder extends NotificationBuilder * * @return $this */ - public function showConfirmButton($showConfirmButton = true, $confirmButtonText = null, $confirmButtonColor = null, $confirmButtonAriaLabel = null) - { + public function showConfirmButton( + $showConfirmButton = true, + $confirmButtonText = null, + $confirmButtonColor = null, + $confirmButtonAriaLabel = null + ) { $this->option('showConfirmButton', $showConfirmButton); if (null !== $confirmButtonText) { @@ -508,8 +504,12 @@ final class SweetAlertBuilder extends NotificationBuilder * * @return $this */ - public function showDenyButton($showDenyButton = true, $denyButtonText = null, $denyButtonColor = null, $denyButtonAriaLabel = null) - { + public function showDenyButton( + $showDenyButton = true, + $denyButtonText = null, + $denyButtonColor = null, + $denyButtonAriaLabel = null + ) { $this->option('showDenyButton', $showDenyButton); if (null !== $denyButtonText) { @@ -537,8 +537,12 @@ final class SweetAlertBuilder extends NotificationBuilder * * @return $this */ - public function showCancelButton($showCancelButton = true, $cancelButtonText = null, $cancelButtonColor = null, $cancelButtonAriaLabel = null) - { + public function showCancelButton( + $showCancelButton = true, + $cancelButtonText = null, + $cancelButtonColor = null, + $cancelButtonAriaLabel = null + ) { $this->option('showCancelButton', $showCancelButton); if (null !== $cancelButtonText) { @@ -713,8 +717,8 @@ final class SweetAlertBuilder extends NotificationBuilder } /** - * Apply default styling to buttons. If you want to use your own classes (e.g. Bootstrap classes) set this - * parameter to false. + * Apply default styling to buttons. If you want to use your own classes (e.g. Bootstrap classes) set this parameter + * to false. * * @param bool $buttonsStyling * @@ -905,8 +909,8 @@ final class SweetAlertBuilder extends NotificationBuilder } /** - * If you want to return the input value as result.value when denying the popup, set to true. Otherwise, the - * denying will set result.value to false. + * If you want to return the input value as result.value when denying the popup, set to true. Otherwise, the denying + * will set result.value to false. * * @param bool $returnInputValueOnDeny * @@ -1083,9 +1087,9 @@ final class SweetAlertBuilder extends NotificationBuilder /** * If input parameter is set to "select" or "radio", you can provide options. Can be a Map or a plain object, with - * keys that represent option values and values that represent option text. You can also provide plain object or - * Map as values that will represented a group of options, being the label of this the key. Finally, you - * can also provide a Promise that resolves with one of those types. + * keys that represent option values and values that represent option text. You can also provide plain object or Map + * as values that will represented a group of options, being the label of this the key. Finally, you can + * also provide a Promise that resolves with one of those types. * * @param string $inputOptions * diff --git a/src/SweetAlert/Prime/SweetAlertFactory.php b/src/SweetAlert/Prime/SweetAlertFactory.php index b20ad7f7..a75cebf4 100644 --- a/src/SweetAlert/Prime/SweetAlertFactory.php +++ b/src/SweetAlert/Prime/SweetAlertFactory.php @@ -9,9 +9,6 @@ use Flasher\Prime\Factory\NotificationFactory; */ final class SweetAlertFactory extends NotificationFactory { - /** - * @inheritDoc - */ public function createNotificationBuilder() { return new SweetAlertBuilder($this->getStorageManager(), new SweetAlert(), 'sweet_alert'); diff --git a/src/SweetAlert/Symfony/.phpcs.xml.dist b/src/SweetAlert/Symfony/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/src/SweetAlert/Symfony/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/SweetAlert/Symfony/DependencyInjection/Configuration.php b/src/SweetAlert/Symfony/DependencyInjection/Configuration.php index 34ae9a63..a3d7e5ee 100644 --- a/src/SweetAlert/Symfony/DependencyInjection/Configuration.php +++ b/src/SweetAlert/Symfony/DependencyInjection/Configuration.php @@ -7,9 +7,6 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; final class Configuration implements ConfigurationInterface { - /** - * {@inheritdoc} - */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('flasher_sweet_alert'); diff --git a/src/SweetAlert/Symfony/DependencyInjection/FlasherSweetAlertExtension.php b/src/SweetAlert/Symfony/DependencyInjection/FlasherSweetAlertExtension.php index d3262aae..bbf31382 100644 --- a/src/SweetAlert/Symfony/DependencyInjection/FlasherSweetAlertExtension.php +++ b/src/SweetAlert/Symfony/DependencyInjection/FlasherSweetAlertExtension.php @@ -7,17 +7,11 @@ use Symfony\Component\Config\FileLocator; final class FlasherSweetAlertExtension extends Extension { - /** - * @inheritDoc - */ protected function getConfigFileLocator() { - return new FileLocator(__DIR__.'/../Resources/config'); + return new FileLocator(__DIR__ . '/../Resources/config'); } - /** - * @inheritDoc - */ protected function getConfigClass() { return new Configuration(); diff --git a/src/SweetAlert/Symfony/Tests/DependencyInjection/ConfigurationTest.php b/src/SweetAlert/Symfony/Tests/DependencyInjection/ConfigurationTest.php index b3d3b881..4756e43a 100644 --- a/src/SweetAlert/Symfony/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/SweetAlert/Symfony/Tests/DependencyInjection/ConfigurationTest.php @@ -17,7 +17,7 @@ class ConfigurationTest extends TestCase 'https://cdnjs.cloudflare.com/ajax/libs/jquery/3.6.0/jquery.min.js', 'https://cdn.jsdelivr.net/npm/@flasher/flasher-sweet-alert@0.1.3/dist/flasher-sweet-alert.min.js', ), - 'styles' => array(), + 'styles' => array(), 'options' => array( 'timer' => 50000, 'timerProgressBar' => true, diff --git a/src/SweetAlert/Symfony/Tests/DependencyInjection/FlasherSweetAlertExtensionTest.php b/src/SweetAlert/Symfony/Tests/DependencyInjection/FlasherSweetAlertExtensionTest.php index c7d665b2..6f285646 100644 --- a/src/SweetAlert/Symfony/Tests/DependencyInjection/FlasherSweetAlertExtensionTest.php +++ b/src/SweetAlert/Symfony/Tests/DependencyInjection/FlasherSweetAlertExtensionTest.php @@ -3,10 +3,10 @@ namespace Flasher\SweetAlert\Symfony\Tests\DependencyInjection; use Flasher\Prime\Tests\TestCase; -use Flasher\Symfony\DependencyInjection\FlasherExtension; -use Flasher\Symfony\FlasherSymfonyBundle; use Flasher\SweetAlert\Symfony\DependencyInjection\FlasherSweetAlertExtension; use Flasher\SweetAlert\Symfony\FlasherSweetAlertSymfonyBundle; +use Flasher\Symfony\DependencyInjection\FlasherExtension; +use Flasher\Symfony\FlasherSymfonyBundle; use Symfony\Component\DependencyInjection\ContainerBuilder; class FlasherSweetAlertExtensionTest extends TestCase diff --git a/src/Symfony/.phpcs.xml.dist b/src/Symfony/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/src/Symfony/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Symfony/DependencyInjection/Compiler/EventSubscriberCompilerPass.php b/src/Symfony/DependencyInjection/Compiler/EventSubscriberCompilerPass.php index 7632a88b..96715381 100644 --- a/src/Symfony/DependencyInjection/Compiler/EventSubscriberCompilerPass.php +++ b/src/Symfony/DependencyInjection/Compiler/EventSubscriberCompilerPass.php @@ -9,9 +9,6 @@ use Symfony\Component\DependencyInjection\Reference; final class EventSubscriberCompilerPass implements CompilerPassInterface { - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container) { if (!$container->has('flasher.event_dispatcher')) { diff --git a/src/Symfony/DependencyInjection/Compiler/FactoryCompilerPass.php b/src/Symfony/DependencyInjection/Compiler/FactoryCompilerPass.php index 354e2d75..748ecf0a 100644 --- a/src/Symfony/DependencyInjection/Compiler/FactoryCompilerPass.php +++ b/src/Symfony/DependencyInjection/Compiler/FactoryCompilerPass.php @@ -9,9 +9,6 @@ use Symfony\Component\DependencyInjection\Reference; final class FactoryCompilerPass implements CompilerPassInterface { - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container) { if (!$container->has('flasher')) { diff --git a/src/Symfony/DependencyInjection/Compiler/PresenterCompilerPass.php b/src/Symfony/DependencyInjection/Compiler/PresenterCompilerPass.php index 3b7b92a8..d04d8bd4 100755 --- a/src/Symfony/DependencyInjection/Compiler/PresenterCompilerPass.php +++ b/src/Symfony/DependencyInjection/Compiler/PresenterCompilerPass.php @@ -9,9 +9,6 @@ use Symfony\Component\DependencyInjection\Reference; final class PresenterCompilerPass implements CompilerPassInterface { - /** - * {@inheritdoc} - */ public function process(ContainerBuilder $container) { if (!$container->has('flasher.response_manager')) { diff --git a/src/Symfony/DependencyInjection/Configuration.php b/src/Symfony/DependencyInjection/Configuration.php index 3253a980..53c7fd9e 100755 --- a/src/Symfony/DependencyInjection/Configuration.php +++ b/src/Symfony/DependencyInjection/Configuration.php @@ -7,9 +7,6 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; final class Configuration implements ConfigurationInterface { - /** - * {@inheritdoc} - */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('flasher'); @@ -30,8 +27,8 @@ final class Configuration implements ConfigurationInterface ->arrayNode('root_scripts') ->prototype('scalar')->end() ->defaultValue(array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher@0.1.3/dist/flasher.min.js', - )) + 'https://cdn.jsdelivr.net/npm/@flasher/flasher@0.1.3/dist/flasher.min.js', + )) ->end() ->arrayNode('template_factory') ->addDefaultsIfNotSet() @@ -54,22 +51,22 @@ final class Configuration implements ConfigurationInterface ->arrayNode('options')->end() ->end() ->defaultValue(array( - 'tailwindcss' => array( - 'view' => '@FlasherSymfony/tailwindcss.html.twig', + 'tailwindcss' => array( + 'view' => '@FlasherSymfony/tailwindcss.html.twig', 'styles' => array( 'https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.1/base.min.css', 'https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.1/utilities.css', ), ), 'tailwindcss_bg' => array( - 'view' => '@FlasherSymfony/tailwindcss_bg.html.twig', + 'view' => '@FlasherSymfony/tailwindcss_bg.html.twig', 'styles' => array( 'https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.1/base.min.css', 'https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.1/utilities.css', ), ), - 'bootstrap' => array( - 'view' => '@FlasherSymfony/bootstrap.html.twig', + 'bootstrap' => array( + 'view' => '@FlasherSymfony/bootstrap.html.twig', 'styles' => array( 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.3/css/bootstrap.min.css', ), @@ -84,11 +81,11 @@ final class Configuration implements ConfigurationInterface ->arrayNode('types_mapping') ->prototype('variable')->end() ->defaultValue(array( - 'success' => array('success'), - 'error' => array('error', 'danger'), - 'warning' => array('warning', 'alarm'), - 'info' => array('info', 'notice', 'alert'), - )) + 'success' => array('success'), + 'error' => array('error', 'danger'), + 'warning' => array('warning', 'alarm'), + 'info' => array('info', 'notice', 'alert'), + )) ->end() ->end() ; diff --git a/src/Symfony/DependencyInjection/Extension.php b/src/Symfony/DependencyInjection/Extension.php index 83ab80b9..91f5ff56 100755 --- a/src/Symfony/DependencyInjection/Extension.php +++ b/src/Symfony/DependencyInjection/Extension.php @@ -2,15 +2,35 @@ namespace Flasher\Symfony\DependencyInjection; +use Symfony\Component\Config\Definition\ConfigurationInterface; use Symfony\Component\Config\FileLocatorInterface; use Symfony\Component\DependencyInjection\Compiler\CompilerPassInterface; use Symfony\Component\DependencyInjection\ContainerBuilder; use Symfony\Component\DependencyInjection\Loader; use Symfony\Component\HttpKernel\DependencyInjection\Extension as SymfonyExtension; -use Symfony\Component\Config\Definition\ConfigurationInterface; abstract class Extension extends SymfonyExtension implements CompilerPassInterface { + /** + * @throws \Exception + */ + public function load(array $configs, ContainerBuilder $container) + { + $loader = new Loader\YamlFileLoader($container, $this->getConfigFileLocator()); + $loader->load('config.yaml'); + } + + public function process(ContainerBuilder $container) + { + $configs = $container->getExtensionConfig($this->getAlias()); + $config = $this->processConfiguration($this->getConfigClass(), $configs); + + $responseManager = $container->getDefinition('flasher.resource_manager'); + $responseManager->addMethodCall('addScripts', array($this->getHandlerAlias(), $this->getScripts($config))); + $responseManager->addMethodCall('addStyles', array($this->getHandlerAlias(), $this->getStyles($config))); + $responseManager->addMethodCall('addOptions', array($this->getHandlerAlias(), $this->getOptions($config))); + } + /** * @return FileLocatorInterface */ @@ -29,20 +49,6 @@ abstract class Extension extends SymfonyExtension implements CompilerPassInterfa return str_replace('flasher_', '', $this->getAlias()); } - /** - * {@inheritdoc} - * - * @throws \Exception - */ - public function load(array $configs, ContainerBuilder $container) - { - $loader = new Loader\YamlFileLoader( - $container, - $this->getConfigFileLocator() - ); - $loader->load('config.yaml'); - } - /** * @param array $config * @@ -72,18 +78,4 @@ abstract class Extension extends SymfonyExtension implements CompilerPassInterfa { return isset($config['options']) ? $config['options'] : array(); } - - /** - * @param ContainerBuilder $container - */ - public function process(ContainerBuilder $container) - { - $configs = $container->getExtensionConfig($this->getAlias()); - $config = $this->processConfiguration($this->getConfigClass(), $configs); - - $responseManager = $container->getDefinition('flasher.resource_manager'); - $responseManager->addMethodCall('addScripts', array($this->getHandlerAlias(), $this->getScripts($config))); - $responseManager->addMethodCall('addStyles', array($this->getHandlerAlias(), $this->getStyles($config))); - $responseManager->addMethodCall('addOptions', array($this->getHandlerAlias(), $this->getOptions($config))); - } } diff --git a/src/Symfony/DependencyInjection/FlasherExtension.php b/src/Symfony/DependencyInjection/FlasherExtension.php index ae9b5c8b..9f33b3d7 100644 --- a/src/Symfony/DependencyInjection/FlasherExtension.php +++ b/src/Symfony/DependencyInjection/FlasherExtension.php @@ -9,15 +9,9 @@ use Symfony\Component\HttpKernel\DependencyInjection\Extension; final class FlasherExtension extends Extension { - /** - * {@inheritdoc} - */ public function load(array $configs, ContainerBuilder $container) { - $loader = new Loader\YamlFileLoader( - $container, - new FileLocator(__DIR__.'/../Resources/config') - ); + $loader = new Loader\YamlFileLoader($container, new FileLocator(__DIR__ . '/../Resources/config')); $loader->load('config.yaml'); $configration = $this->processConfiguration(new Configuration(), $configs); @@ -28,13 +22,13 @@ final class FlasherExtension extends Extension $responseManager = $container->getDefinition('flasher.resource_manager'); foreach ($configration['template_factory']['templates'] as $template => $factory) { if (isset($factory['scripts'])) { - $responseManager->addMethodCall('addScripts', array('template_'.$template, $factory['scripts'])); + $responseManager->addMethodCall('addScripts', array('template_' . $template, $factory['scripts'])); } if (isset($factory['styles'])) { - $responseManager->addMethodCall('addStyles', array('template_'.$template, $factory['styles'])); + $responseManager->addMethodCall('addStyles', array('template_' . $template, $factory['styles'])); } if (isset($factory['options'])) { - $responseManager->addMethodCall('addOptions', array('template_'.$template, $factory['options'])); + $responseManager->addMethodCall('addOptions', array('template_' . $template, $factory['options'])); } } } diff --git a/src/Symfony/EventListener/SessionListener.php b/src/Symfony/EventListener/SessionListener.php index fa811052..a9fb87fe 100755 --- a/src/Symfony/EventListener/SessionListener.php +++ b/src/Symfony/EventListener/SessionListener.php @@ -25,13 +25,11 @@ final class SessionListener implements EventSubscriberInterface */ private $responseManager; - /** - * @param ConfigInterface $config - * @param FlasherInterface $flasher - * @param ResponseManagerInterface $responseManager - */ - public function __construct(ConfigInterface $config, FlasherInterface $flasher, ResponseManagerInterface $responseManager) - { + public function __construct( + ConfigInterface $config, + FlasherInterface $flasher, + ResponseManagerInterface $responseManager + ) { $this->config = $config; $this->flasher = $flasher; $this->responseManager = $responseManager; @@ -41,7 +39,9 @@ final class SessionListener implements EventSubscriberInterface { $request = $event->getRequest(); - if (!$event->isMasterRequest() || $request->isXmlHttpRequest() || true !== $this->config->get('auto_create_from_session')) { + if (!$event->isMasterRequest() || $request->isXmlHttpRequest() || true !== $this->config->get( + 'auto_create_from_session' + )) { return; } @@ -78,7 +78,7 @@ final class SessionListener implements EventSubscriberInterface } $pos = strripos($content, ''); - $content = substr($content, 0, $pos).$htmlResponse.substr($content, $pos); + $content = substr($content, 0, $pos) . $htmlResponse . substr($content, $pos); $response->setContent($content); } @@ -101,7 +101,7 @@ final class SessionListener implements EventSubscriberInterface $type = $aliases; } - foreach ((array)$aliases as $alias) { + foreach ((array) $aliases as $alias) { $mapping[$alias] = $type; } } diff --git a/src/Symfony/FlasherSymfonyBundle.php b/src/Symfony/FlasherSymfonyBundle.php index 52e8b7aa..633e7d8d 100644 --- a/src/Symfony/FlasherSymfonyBundle.php +++ b/src/Symfony/FlasherSymfonyBundle.php @@ -11,9 +11,6 @@ use Symfony\Component\HttpKernel\Bundle\Bundle; class FlasherSymfonyBundle extends Bundle { - /** - * {@inheritdoc} - */ public function build(ContainerBuilder $container) { $container->addCompilerPass(new FactoryCompilerPass()); diff --git a/src/Symfony/Storage/Storage.php b/src/Symfony/Storage/Storage.php index 41e1b0e5..0708424b 100644 --- a/src/Symfony/Storage/Storage.php +++ b/src/Symfony/Storage/Storage.php @@ -16,25 +16,16 @@ final class Storage implements StorageInterface */ private $session; - /** - * @param Session $session - */ public function __construct(Session $session) { $this->session = $session; } - /** - * @inheritDoc - */ public function all() { return $this->session->get(self::ENVELOPES_NAMESPACE, array()); } - /** - * @inheritDoc - */ public function add($envelopes) { $envelopes = is_array($envelopes) ? $envelopes : func_get_args(); @@ -42,9 +33,6 @@ final class Storage implements StorageInterface $this->session->set(self::ENVELOPES_NAMESPACE, array_merge($this->all(), $envelopes)); } - /** - * @inheritDoc - */ public function update($envelopes) { $envelopes = is_array($envelopes) ? $envelopes : func_get_args(); @@ -64,9 +52,6 @@ final class Storage implements StorageInterface $this->session->set(self::ENVELOPES_NAMESPACE, $store); } - /** - * @inheritDoc - */ public function remove($envelopes) { $envelopes = is_array($envelopes) ? $envelopes : func_get_args(); @@ -81,9 +66,6 @@ final class Storage implements StorageInterface $this->session->set(self::ENVELOPES_NAMESPACE, $store); } - /** - * @inheritDoc - */ public function clear() { $this->session->set(self::ENVELOPES_NAMESPACE, array()); diff --git a/src/Symfony/Template/TwigEngine.php b/src/Symfony/Template/TwigEngine.php index d20786f7..2574e1b2 100644 --- a/src/Symfony/Template/TwigEngine.php +++ b/src/Symfony/Template/TwigEngine.php @@ -12,17 +12,11 @@ final class TwigEngine implements EngineInterface */ private $engine; - /** - * @param Environment $engine - */ public function __construct(Environment $engine) { $this->engine = $engine; } - /** - * @inheritDoc - */ public function render($name, array $context = array()) { return $this->engine->render($name, $context); diff --git a/src/Symfony/Tests/DependencyInjection/Compiler/EventSubscriberCompilerPassTest.php b/src/Symfony/Tests/DependencyInjection/Compiler/EventSubscriberCompilerPassTest.php index 6687bc5f..d09eaa58 100644 --- a/src/Symfony/Tests/DependencyInjection/Compiler/EventSubscriberCompilerPassTest.php +++ b/src/Symfony/Tests/DependencyInjection/Compiler/EventSubscriberCompilerPassTest.php @@ -24,17 +24,17 @@ class EventSubscriberCompilerPassTest extends TestCase $this->assertCount(4, $calls); - $this->assertEquals('addSubscriber', $calls[0][0]); - $this->assertEquals('test_subscriber', $calls[0][1][0]); + $this->assertSame('addSubscriber', $calls[0][0]); + $this->assertSame('test_subscriber', $calls[0][1][0]); - $this->assertEquals('addSubscriber', $calls[1][0]); - $this->assertEquals('flasher.event_listener.filter_listener', $calls[1][1][0]); + $this->assertSame('addSubscriber', $calls[1][0]); + $this->assertSame('flasher.event_listener.filter_listener', $calls[1][1][0]); - $this->assertEquals('addSubscriber', $calls[2][0]); - $this->assertEquals('flasher.event_listener.post_flush_listener', $calls[2][1][0]); + $this->assertSame('addSubscriber', $calls[2][0]); + $this->assertSame('flasher.event_listener.post_flush_listener', $calls[2][1][0]); - $this->assertEquals('addSubscriber', $calls[3][0]); - $this->assertEquals('flasher.event_listener.stamps_listener', $calls[3][1][0]); + $this->assertSame('addSubscriber', $calls[3][0]); + $this->assertSame('flasher.event_listener.stamps_listener', $calls[3][1][0]); } private function getContainer() diff --git a/src/Symfony/Tests/DependencyInjection/Compiler/FactoryCompilerPassTest.php b/src/Symfony/Tests/DependencyInjection/Compiler/FactoryCompilerPassTest.php index 1bb9e48c..7d02bd45 100644 --- a/src/Symfony/Tests/DependencyInjection/Compiler/FactoryCompilerPassTest.php +++ b/src/Symfony/Tests/DependencyInjection/Compiler/FactoryCompilerPassTest.php @@ -23,8 +23,8 @@ class FactoryCompilerPassTest extends TestCase $calls = $manager->getMethodCalls(); $this->assertCount(2, $calls); - $this->assertEquals('addFactory', $calls[0][0]); - $this->assertEquals('test_flasher', $calls[0][1][0]); + $this->assertSame('addFactory', $calls[0][0]); + $this->assertSame('test_flasher', $calls[0][1][0]); } private function getContainer() @@ -32,7 +32,9 @@ class FactoryCompilerPassTest extends TestCase $container = new ContainerBuilder(); $flasher = new Definition('test_flasher'); - $flasher->addTag('flasher.factory', array('alias' => 'test_flasher')); + $flasher->addTag('flasher.factory', array( + 'alias' => 'test_flasher', + )); $container->setDefinition('test_flasher', $flasher); $extension = new FlasherExtension(); diff --git a/src/Symfony/Tests/DependencyInjection/ConfigurationTest.php b/src/Symfony/Tests/DependencyInjection/ConfigurationTest.php index a65171ab..1e6e9977 100644 --- a/src/Symfony/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Symfony/Tests/DependencyInjection/ConfigurationTest.php @@ -15,7 +15,7 @@ class ConfigurationTest extends TestCase $expected = array( 'default' => 'template', 'root_scripts' => array( - 'https://cdn.jsdelivr.net/npm/@flasher/flasher@0.1.3/dist/flasher.min.js' + 'https://cdn.jsdelivr.net/npm/@flasher/flasher@0.1.3/dist/flasher.min.js', ), 'template_factory' => array( 'default' => 'tailwindcss', @@ -24,20 +24,20 @@ class ConfigurationTest extends TestCase 'view' => '@FlasherSymfony/tailwindcss.html.twig', 'styles' => array( 'https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.1/base.min.css', - 'https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.1/utilities.css' + 'https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.1/utilities.css', ), ), 'tailwindcss_bg' => array( 'view' => '@FlasherSymfony/tailwindcss_bg.html.twig', - "styles" => array( + 'styles' => array( 'https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.1/base.min.css', 'https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.1.1/utilities.css', ), ), 'bootstrap' => array( - 'view' => "@FlasherSymfony/bootstrap.html.twig", + 'view' => '@FlasherSymfony/bootstrap.html.twig', 'styles' => array( - "https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.3/css/bootstrap.min.css", + 'https://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/4.5.3/css/bootstrap.min.css', ), ), ), @@ -68,8 +68,13 @@ class ConfigurationTest extends TestCase public function testEmptyDefault() { - $this->setExpectedException('\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException', 'The path "flasher.default" cannot contain an empty value, but got "".'); - $this->process(array(array('default' => ''))); + $this->setExpectedException( + '\Symfony\Component\Config\Definition\Exception\InvalidConfigurationException', + 'The path "flasher.default" cannot contain an empty value, but got "".' + ); + $this->process(array(array( + 'default' => '', + ))); } /** diff --git a/src/Symfony/Tests/Storage/StorageTest.php b/src/Symfony/Tests/Storage/StorageTest.php index 9036fbd3..90ed42bf 100644 --- a/src/Symfony/Tests/Storage/StorageTest.php +++ b/src/Symfony/Tests/Storage/StorageTest.php @@ -59,7 +59,10 @@ class StorageTest extends TestCase $storage->update($envelopes[1]); $this->assertSame($envelopes, $storage->all()); - $this->assertInstanceOf('Flasher\Prime\Stamp\PriorityStamp', $envelopes[1]->get('Flasher\Prime\Stamp\PriorityStamp')); + $this->assertInstanceOf( + 'Flasher\Prime\Stamp\PriorityStamp', + $envelopes[1]->get('Flasher\Prime\Stamp\PriorityStamp') + ); } public function testRemoveEnvelopes() diff --git a/src/Symfony/Tests/Twig/FlasherTwigExtensionTest.php b/src/Symfony/Tests/Twig/FlasherTwigExtensionTest.php index e0f0e82e..f02b3c0b 100755 --- a/src/Symfony/Tests/Twig/FlasherTwigExtensionTest.php +++ b/src/Symfony/Tests/Twig/FlasherTwigExtensionTest.php @@ -17,13 +17,18 @@ class FlasherTwigExtensionTest extends TestCase $responseManager = $this->getMockBuilder('Flasher\Prime\Response\ResponseManagerInterface')->getMock(); $responseManager->method('render')->willReturn($expected); - $this->assertEquals($expected, $this->render('{{ flasher_render() }}', $responseManager)); + $this->assertSame($expected, $this->render('{{ flasher_render() }}', $responseManager)); } private function render($template, ResponseManagerInterface $renderer) { - $twig = new Environment(new ArrayLoader(array('template' => $template)), array( - 'debug' => true, 'cache' => false, 'autoescape' => 'html', 'optimizations' => 0, + $twig = new Environment(new ArrayLoader(array( + 'template' => $template, + )), array( + 'debug' => true, + 'cache' => false, + 'autoescape' => 'html', + 'optimizations' => 0, )); $twig->addExtension(new FlasherTwigExtension($renderer)); diff --git a/src/Symfony/Twig/FlasherTwigExtension.php b/src/Symfony/Twig/FlasherTwigExtension.php index 664e5601..70180d4a 100755 --- a/src/Symfony/Twig/FlasherTwigExtension.php +++ b/src/Symfony/Twig/FlasherTwigExtension.php @@ -13,9 +13,6 @@ final class FlasherTwigExtension extends AbstractExtension */ private $responseManager; - /** - * @param ResponseManagerInterface $responseManager - */ public function __construct(ResponseManagerInterface $responseManager) { $this->responseManager = $responseManager; @@ -23,7 +20,9 @@ final class FlasherTwigExtension extends AbstractExtension public function getFunctions() { - $options = array('is_safe' => array('html')); + $options = array( + 'is_safe' => array('html'), + ); return array( new TwigFunction('flasher_render', array($this, 'flasherRender'), $options), @@ -31,8 +30,6 @@ final class FlasherTwigExtension extends AbstractExtension } /** - * @param array $criteria - * * @return string */ public function flasherRender(array $criteria = array()) diff --git a/src/Toastr/Laravel/.phpcs.xml.dist b/src/Toastr/Laravel/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/src/Toastr/Laravel/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Toastr/Laravel/Facade/Toastr.php b/src/Toastr/Laravel/Facade/Toastr.php index a6eca900..6d016e55 100644 --- a/src/Toastr/Laravel/Facade/Toastr.php +++ b/src/Toastr/Laravel/Facade/Toastr.php @@ -6,11 +6,8 @@ use Illuminate\Support\Facades\Facade; class Toastr extends Facade { - /** - * @inheritdoc - */ protected static function getFacadeAccessor() { return 'flasher.toastr'; } -} \ No newline at end of file +} diff --git a/src/Toastr/Laravel/FlasherToastrServiceProvider.php b/src/Toastr/Laravel/FlasherToastrServiceProvider.php index 38e4315e..e9097dde 100644 --- a/src/Toastr/Laravel/FlasherToastrServiceProvider.php +++ b/src/Toastr/Laravel/FlasherToastrServiceProvider.php @@ -2,9 +2,9 @@ namespace Flasher\Toastr\Laravel; +use Flasher\Toastr\Laravel\ServiceProvider\ServiceProviderManager; use Illuminate\Container\Container; use Illuminate\Support\ServiceProvider; -use Flasher\Toastr\Laravel\ServiceProvider\ServiceProviderManager; final class FlasherToastrServiceProvider extends ServiceProvider { @@ -43,17 +43,11 @@ final class FlasherToastrServiceProvider extends ServiceProvider return $this->app; } - /** - * {@inheritdoc} - */ public function mergeConfigFrom($path, $key) { parent::mergeConfigFrom($path, $key); } - /** - * {@inheritdoc} - */ public function publishes(array $paths, $groups = null) { parent::publishes($paths, $groups); diff --git a/src/Toastr/Laravel/Resources/functions/toastr.php b/src/Toastr/Laravel/Resources/functions/toastr.php index 25b0b92a..c7d0496a 100644 --- a/src/Toastr/Laravel/Resources/functions/toastr.php +++ b/src/Toastr/Laravel/Resources/functions/toastr.php @@ -3,12 +3,11 @@ use Flasher\Prime\Notification\NotificationInterface; use Illuminate\Support\Facades\App; -if (! function_exists('toastr')) { +if (!function_exists('toastr')) { /** * @param string $message * @param string $type * @param string $title - * @param array $options * * @return \Flasher\Toastr\Prime\ToastrFactory */ @@ -22,4 +21,4 @@ if (! function_exists('toastr')) { ->title($title) ->addFlash($type, $message, $options); } -} \ No newline at end of file +} diff --git a/src/Toastr/Laravel/ServiceProvider/Providers/Laravel.php b/src/Toastr/Laravel/ServiceProvider/Providers/Laravel.php index be00c0fc..0a615ad0 100644 --- a/src/Toastr/Laravel/ServiceProvider/Providers/Laravel.php +++ b/src/Toastr/Laravel/ServiceProvider/Providers/Laravel.php @@ -17,36 +17,26 @@ class Laravel implements ServiceProviderInterface */ protected $app; - /** - * @param Container $app - */ public function __construct(Container $app) { $this->app = $app; } - /** - * @inheritDoc - */ public function shouldBeUsed() { return $this->app instanceof Application; } - /** - * @inheritDoc - */ public function boot(FlasherToastrServiceProvider $provider) { - $provider->publishes(array(flasher_path(__DIR__.'/../../Resources/config/config.php') => config_path('flasher_toastr.php')), 'flasher-config'); + $provider->publishes(array( + flasher_path(__DIR__ . '/../../Resources/config/config.php') => config_path('flasher_toastr.php'), + ), 'flasher-config'); } - /** - * @inheritDoc - */ public function register(FlasherToastrServiceProvider $provider) { - $provider->mergeConfigFrom(flasher_path(__DIR__.'/../../Resources/config/config.php'), 'flasher_toastr'); + $provider->mergeConfigFrom(flasher_path(__DIR__ . '/../../Resources/config/config.php'), 'flasher_toastr'); $this->appendToFlasherConfig(); $this->registerServices(); diff --git a/src/Toastr/Laravel/ServiceProvider/Providers/Laravel4.php b/src/Toastr/Laravel/ServiceProvider/Providers/Laravel4.php index d7dcac9d..f55bbed2 100644 --- a/src/Toastr/Laravel/ServiceProvider/Providers/Laravel4.php +++ b/src/Toastr/Laravel/ServiceProvider/Providers/Laravel4.php @@ -7,26 +7,21 @@ use Illuminate\Foundation\Application; final class Laravel4 extends Laravel { - /** - * @inheritDoc - */ public function shouldBeUsed() { return $this->app instanceof Application && 0 === strpos(Application::VERSION, '4.'); } - /** - * @inheritDoc - */ public function boot(FlasherToastrServiceProvider $provider) { - $provider->package('php-flasher/flasher-toastr-laravel', 'flasher_toastr', flasher_path(__DIR__.'/../../Resources')); + $provider->package( + 'php-flasher/flasher-toastr-laravel', + 'flasher_toastr', + flasher_path(__DIR__ . '/../../Resources') + ); $this->appendToFlasherConfig(); } - /** - * @inheritDoc - */ public function register(FlasherToastrServiceProvider $provider) { $this->registerServices(); diff --git a/src/Toastr/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php b/src/Toastr/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php index 874cd95c..3d4c6417 100644 --- a/src/Toastr/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php +++ b/src/Toastr/Laravel/ServiceProvider/Providers/ServiceProviderInterface.php @@ -11,13 +11,7 @@ interface ServiceProviderInterface */ public function shouldBeUsed(); - /** - * @param FlasherToastrServiceProvider $provider - */ public function boot(FlasherToastrServiceProvider $provider); - /** - * @param FlasherToastrServiceProvider $provider - */ public function register(FlasherToastrServiceProvider $provider); } diff --git a/src/Toastr/Laravel/ServiceProvider/ServiceProviderManager.php b/src/Toastr/Laravel/ServiceProvider/ServiceProviderManager.php index 008fdfff..7702bb04 100644 --- a/src/Toastr/Laravel/ServiceProvider/ServiceProviderManager.php +++ b/src/Toastr/Laravel/ServiceProvider/ServiceProviderManager.php @@ -25,9 +25,6 @@ final class ServiceProviderManager */ private $notifyServiceProvider; - /** - * @param FlasherToastrServiceProvider $notifyServiceProvider - */ public function __construct(FlasherToastrServiceProvider $notifyServiceProvider) { $this->notifyServiceProvider = $notifyServiceProvider; diff --git a/src/Toastr/Laravel/Tests/TestCase.php b/src/Toastr/Laravel/Tests/TestCase.php index 8c072a59..fd61f12e 100644 --- a/src/Toastr/Laravel/Tests/TestCase.php +++ b/src/Toastr/Laravel/Tests/TestCase.php @@ -11,6 +11,52 @@ use Orchestra\Testbench\TestCase as Orchestra; class TestCase extends Orchestra { + public function createApplication() + { + if (0 !== strpos(Application::VERSION, '4.0')) { + return parent::createApplication(); + } + + $app = new Application(); + + $app->detectEnvironment(array( + 'local' => array('your-machine-name'), + )); + + $app->bindInstallPaths($this->getApplicationPaths()); + + $app['env'] = 'testing'; + + $app->instance('app', $app); + + Facade::clearResolvedInstances(); + Facade::setFacadeApplication($app); + + $config = new Config($app->getConfigLoader(), $app['env']); + $app->instance('config', $config); + $app->startExceptionHandling(); + + if ($app->runningInConsole()) { + $app->setRequestForConsoleEnvironment(); + } + + date_default_timezone_set($this->getApplicationTimezone()); + + $aliases = array_merge($this->getApplicationAliases(), $this->getPackageAliases()); + AliasLoader::getInstance($aliases)->register(); + + Request::enableHttpMethodParameterOverride(); + + $providers = array_merge($this->getApplicationProviders(), $this->getPackageProviders()); + $app->getProviderRepository()->load($app, $providers); + + $this->getEnvironmentSetUp($app); + + $app->boot(); + + return $app; + } + /** * @param Application $app * @@ -31,61 +77,11 @@ class TestCase extends Orchestra { $separator = $this->isLaravel4() ? '::config' : ''; - $app['config']->set('session'.$separator.'.driver', 'array'); + $app['config']->set('session' . $separator . '.driver', 'array'); } private function isLaravel4() { return 0 === strpos(Application::VERSION, '4.'); } - - /** - * {@inheritdoc} - */ - public function createApplication() - { - if (0 !== strpos(Application::VERSION, '4.0')) { - return parent::createApplication(); - } - - $app = new Application; - - $app->detectEnvironment(array( - 'local' => array('your-machine-name'), - )); - - $app->bindInstallPaths($this->getApplicationPaths()); - - $app['env'] = 'testing'; - - $app->instance('app', $app); - - Facade::clearResolvedInstances(); - Facade::setFacadeApplication($app); - - $config = new Config($app->getConfigLoader(), $app['env']); - $app->instance('config', $config); - $app->startExceptionHandling(); - - if ($app->runningInConsole()) - { - $app->setRequestForConsoleEnvironment(); - } - - date_default_timezone_set($this->getApplicationTimezone()); - - $aliases = array_merge($this->getApplicationAliases(), $this->getPackageAliases()); - AliasLoader::getInstance($aliases)->register(); - - Request::enableHttpMethodParameterOverride(); - - $providers = array_merge($this->getApplicationProviders(), $this->getPackageProviders()); - $app->getProviderRepository()->load($app, $providers); - - $this->getEnvironmentSetUp($app); - - $app->boot(); - - return $app; - } } diff --git a/src/Toastr/Prime/.phpcs.xml.dist b/src/Toastr/Prime/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/src/Toastr/Prime/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Toastr/Prime/Toastr.php b/src/Toastr/Prime/Toastr.php index 5edd1889..7ebaf0fb 100644 --- a/src/Toastr/Prime/Toastr.php +++ b/src/Toastr/Prime/Toastr.php @@ -27,9 +27,6 @@ final class Toastr extends Notification $this->title = $title; } - /** - * @inheritDoc - */ public function toArray() { return array_merge(parent::toArray(), array( diff --git a/src/Toastr/Prime/ToastrBuilder.php b/src/Toastr/Prime/ToastrBuilder.php index b02e1fad..7b609551 100644 --- a/src/Toastr/Prime/ToastrBuilder.php +++ b/src/Toastr/Prime/ToastrBuilder.php @@ -270,7 +270,8 @@ final class ToastrBuilder extends NotificationBuilder } /** - * Rather than having identical toasts stack, set the preventDuplicates property to true. Duplicates are matched to the previous toast based on their message content. + * Rather than having identical toasts stack, set the preventDuplicates property to true. Duplicates are matched to + * the previous toast based on their message content. * * @param bool $preventDuplicates * diff --git a/src/Toastr/Prime/ToastrFactory.php b/src/Toastr/Prime/ToastrFactory.php index 0a2d8788..ee17e7ec 100644 --- a/src/Toastr/Prime/ToastrFactory.php +++ b/src/Toastr/Prime/ToastrFactory.php @@ -9,9 +9,6 @@ use Flasher\Prime\Factory\NotificationFactory; */ final class ToastrFactory extends NotificationFactory { - /** - * {@inheritdoc} - */ public function createNotificationBuilder() { return new ToastrBuilder($this->getStorageManager(), new Toastr(), 'toastr'); diff --git a/src/Toastr/Symfony/.phpcs.xml.dist b/src/Toastr/Symfony/.phpcs.xml.dist deleted file mode 100644 index 93d245bc..00000000 --- a/src/Toastr/Symfony/.phpcs.xml.dist +++ /dev/null @@ -1,625 +0,0 @@ - - - - - - - - - - - - - src - tests - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - error - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Variable "%s" not allowed in double quoted string; use sprintf() or concatenation instead - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 5 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/src/Toastr/Symfony/DependencyInjection/Configuration.php b/src/Toastr/Symfony/DependencyInjection/Configuration.php index fb38cda2..9ee6695b 100755 --- a/src/Toastr/Symfony/DependencyInjection/Configuration.php +++ b/src/Toastr/Symfony/DependencyInjection/Configuration.php @@ -7,9 +7,6 @@ use Symfony\Component\Config\Definition\ConfigurationInterface; final class Configuration implements ConfigurationInterface { - /** - * {@inheritdoc} - */ public function getConfigTreeBuilder() { $treeBuilder = new TreeBuilder('flasher_toastr'); @@ -38,8 +35,8 @@ final class Configuration implements ConfigurationInterface ->prototype('variable')->end() ->ignoreExtraKeys(false) ->defaultValue(array( - 'progressBar' => true, - 'timeOut' => 5000, + 'progressBar' => true, + 'timeOut' => 5000, )) ->end() ->end() diff --git a/src/Toastr/Symfony/DependencyInjection/FlasherToastrExtension.php b/src/Toastr/Symfony/DependencyInjection/FlasherToastrExtension.php index 43daf93c..e6948dbb 100644 --- a/src/Toastr/Symfony/DependencyInjection/FlasherToastrExtension.php +++ b/src/Toastr/Symfony/DependencyInjection/FlasherToastrExtension.php @@ -7,17 +7,11 @@ use Symfony\Component\Config\FileLocator; final class FlasherToastrExtension extends Extension { - /** - * @inheritDoc - */ protected function getConfigFileLocator() { - return new FileLocator(__DIR__.'/../Resources/config'); + return new FileLocator(__DIR__ . '/../Resources/config'); } - /** - * @inheritDoc - */ protected function getConfigClass() { return new Configuration(); diff --git a/src/Toastr/Symfony/Tests/DependencyInjection/ConfigurationTest.php b/src/Toastr/Symfony/Tests/DependencyInjection/ConfigurationTest.php index 74139dcd..fcf5de3c 100644 --- a/src/Toastr/Symfony/Tests/DependencyInjection/ConfigurationTest.php +++ b/src/Toastr/Symfony/Tests/DependencyInjection/ConfigurationTest.php @@ -21,7 +21,7 @@ class ConfigurationTest extends TestCase 'options' => array( 'progressBar' => true, 'timeOut' => 5000, - ) + ), ); $this->assertSame($expected, $config);