Skip to content
Permalink
Browse files

Drop NAME constant of all events

  • Loading branch information...
mabar authored and f3l1x committed Jul 5, 2019
1 parent aea00dc commit 98349b0fc20547ba5db26df1c9d3738e53094b88
@@ -43,7 +43,6 @@ There are several events on which you can listen to.
**Nette Application events:**

```php
use Contributte\Events\Extra\Event\Application\ApplicationEvents;
use Contributte\Events\Extra\Event\Application\ErrorEvent;
use Contributte\Events\Extra\Event\Application\PresenterEvent;
use Contributte\Events\Extra\Event\Application\PresenterStartupEvent;
@@ -54,36 +53,20 @@ use Contributte\Events\Extra\Event\Application\ShutdownEvent;
use Contributte\Events\Extra\Event\Application\StartupEvent;
```

- `StartupEvent::NAME` && `ApplicationEvents::ON_STARTUP`
- `ShutdownEvent::NAME` && `ApplicationEvents::ON_SHUTDOWN`
- `RequestEvent::NAME` && `ApplicationEvents::ON_REQUEST`
- `PresenterEvent::NAME` && `ApplicationEvents::ON_PRESENTER`
- `PresenterStartupEvent::NAME` && `ApplicationEvents::ON_PRESENTER_STARTUP`
- `PresenterShutdownEvent::NAME` && `ApplicationEvents::ON_PRESENTER_SHUTDOWN`
- `ResponseEvent::NAME` && `ApplicationEvents::ON_RESPONSE`
- `ErrorEvent::NAME` && `ApplicationEvents::ON_ERROR`

**Nette Latte events:**

```php
use Contributte\Events\Extra\Event\Latte\LatteEvents;
use Contributte\Events\Extra\Event\Latte\LatteCompileEvent;
use Contributte\Events\Extra\Event\Latte\TemplateCreateEvent;
```

- `LatteCompileEvent::NAME` && `LatteEvents::ON_LATTE_COMPILE`
- `TemplateCreateEvent::NAME` && `LatteEvents::ON_TEMPLATE_CREATE`

**Nette Security events:**

```php
use Contributte\Events\Extra\Event\Security\LoggedInEvent;
use Contributte\Events\Extra\Event\Security\LoggedOutEvent;
```

- `LoggedInEvent::NAME` && `SecurityEvents::ON_LOGGED_IN`
- `LoggedOutEvent::NAME` && `SecurityEvents::ON_LOGGED_OUT`

## Subscriber

```php

This file was deleted.

@@ -9,8 +9,6 @@
class ErrorEvent extends Event
{
public const NAME = self::class;
/** @var Application */
private $application;
@@ -9,8 +9,6 @@
class PresenterEvent extends Event
{
public const NAME = self::class;
/** @var Application */
private $application;
@@ -9,8 +9,6 @@
class PresenterShutdownEvent extends Event
{
public const NAME = self::class;
/** @var IPresenter */
private $presenter;
@@ -8,8 +8,6 @@
class PresenterStartupEvent extends Event
{
public const NAME = self::class;
/** @var IPresenter */
private $presenter;
@@ -9,8 +9,6 @@
class RequestEvent extends Event
{
public const NAME = self::class;
/** @var Application */
private $application;
@@ -9,8 +9,6 @@
class ResponseEvent extends Event
{
public const NAME = self::class;
/** @var Application */
private $application;
@@ -9,8 +9,6 @@
class ShutdownEvent extends Event
{
public const NAME = self::class;
/** @var Application */
private $application;
@@ -8,8 +8,6 @@
class StartupEvent extends Event
{
public const NAME = self::class;
/** @var Application */
private $application;
@@ -8,8 +8,6 @@
class LatteCompileEvent extends Event
{
public const NAME = self::class;
/** @var Engine */
private $engine;

This file was deleted.

@@ -3,13 +3,11 @@
namespace Contributte\Events\Extra\Event\Latte;
use Nette\Bridges\ApplicationLatte\Template;
use Symfony\Component\EventDispatcher\Event;
class TemplateCreateEvent extends \Symfony\Component\EventDispatcher\Event
class TemplateCreateEvent extends Event
{
public const NAME = self::class;
/** @var Template */
private $template;
@@ -8,8 +8,6 @@
class LoggedInEvent extends Event
{
public const NAME = self::class;
/** @var User */
private $user;
@@ -8,8 +8,6 @@
class LoggedOutEvent extends Event
{
public const NAME = self::class;
/** @var User */
private $user;

This file was deleted.

0 comments on commit 98349b0

Please sign in to comment.
You can’t perform that action at this time.