for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace MyApp;
use MyApp\Event\AppEvents;
use MyApp\Event\UserLoginEvent;
use Symfony\Component\EventDispatcher\EventDispatcherInterface;
class Authenticator
{
/**
* @var EventDispatcherInterface
*/
private $eventDispatcherInterface;
public function __construct(EventDispatcherInterface $eventDispatcherInterface)
$this->eventDispatcherInterface = $eventDispatcherInterface;
}
* @param string $email
* @param string $password
public function login($email, $password)
$password
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.
// some verification code here
$success = '...';
if ($success) {
$userLoginEvent = new UserLoginEvent($email);
$this->eventDispatcherInterface->dispatch(AppEvents::ON_LOGIN, $userLoginEvent);
// That's it! You've just successfully used an event.
This check looks from parameters that have been defined for a function or method, but which are not used in the method body.