mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-08-29 11:03:50 +00:00
cs: Fix code style (safe rules only).
This commit is contained in:
@@ -1,47 +1,44 @@
|
||||
<?php
|
||||
/*
|
||||
*
|
||||
|
||||
/**
|
||||
* Chill is a software for social workers
|
||||
*
|
||||
* For the full copyright and license information, please view
|
||||
* the LICENSE file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Chill\TaskBundle\Security\Authorization;
|
||||
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Symfony\Component\Security\Core\Authentication\Token\TokenInterface;
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @author Julien Fastré <julien.fastre@champs-libres.coop>
|
||||
*/
|
||||
class AuthorizationEvent extends Event
|
||||
{
|
||||
public const VOTE = 'chill_task.vote';
|
||||
|
||||
/**
|
||||
* @var Chill\TaskBundle\Entity\AbstractTask|\Chill\PersonBundle\Entity\Person|null
|
||||
*/
|
||||
protected $subject;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $attribute;
|
||||
|
||||
|
||||
/**
|
||||
* @var \Chill\PersonBundle\Entity\Person|Chill\TaskBundle\Entity\AbstractTask|null
|
||||
*/
|
||||
protected $subject;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var TokenInterface
|
||||
*/
|
||||
protected $token;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @var bool
|
||||
*/
|
||||
protected $vote;
|
||||
|
||||
const VOTE = 'chill_task.vote';
|
||||
|
||||
|
||||
public function __construct(
|
||||
$subject,
|
||||
$attribute,
|
||||
$subject,
|
||||
$attribute,
|
||||
TokenInterface $token
|
||||
) {
|
||||
$this->subject = $subject;
|
||||
@@ -49,40 +46,40 @@ class AuthorizationEvent extends Event
|
||||
$this->token = $token;
|
||||
}
|
||||
|
||||
public function getSubject()
|
||||
{
|
||||
return $this->subject;
|
||||
}
|
||||
|
||||
public function getAttribute()
|
||||
{
|
||||
return $this->attribute;
|
||||
}
|
||||
|
||||
public function getSubject()
|
||||
{
|
||||
return $this->subject;
|
||||
}
|
||||
|
||||
public function getToken(): TokenInterface
|
||||
{
|
||||
return $this->token;
|
||||
}
|
||||
|
||||
|
||||
public function getVote()
|
||||
{
|
||||
return $this->vote;
|
||||
}
|
||||
|
||||
public function setVote($vote)
|
||||
{
|
||||
$this->vote = $vote;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function hasVote()
|
||||
{
|
||||
return $this->vote !== NULL;
|
||||
return null !== $this->vote;
|
||||
}
|
||||
|
||||
|
||||
public function removeVote()
|
||||
{
|
||||
$this->vote = NULL;
|
||||
$this->vote = null;
|
||||
}
|
||||
|
||||
public function setVote($vote)
|
||||
{
|
||||
$this->vote = $vote;
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user