for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace LoginCidadao\BadgesControlBundle\Event;
use Symfony\Component\EventDispatcher\Event;
use LoginCidadao\CoreBundle\Model\PersonInterface;
use LoginCidadao\BadgesControlBundle\Model\BadgeInterface;
class EvaluateBadgesEvent extends Event
{
protected $person;
public function __construct(PersonInterface $person)
$this->person = $person;
}
/**
*
* @return PersonInterface
*/
public function getPerson()
return $this->person;
public function registerBadges(array $badges)
foreach ($badges as $badge) {
$this->registerBadge($badge);
return $this;
public function registerBadge(BadgeInterface $badge)
$this->getPerson()->mergeBadges([$badge]);