mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-09-10 00:34:58 +00:00
cs: Fix code style (safe rules only).
This commit is contained in:
@@ -1,5 +1,12 @@
|
||||
<?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\PersonBundle\Privacy;
|
||||
|
||||
/*
|
||||
@@ -22,83 +29,51 @@ namespace Chill\PersonBundle\Privacy;
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
use Chill\PersonBundle\Entity\Person;
|
||||
use Symfony\Component\EventDispatcher\Event;
|
||||
|
||||
/**
|
||||
* Class PrivacyEvent
|
||||
* Class PrivacyEvent.
|
||||
*
|
||||
* Array $args expects arguments with the following keys: 'element_class', 'element_id', 'action'
|
||||
* By default, action is set to 'show'
|
||||
*
|
||||
* @package Chill\PersonBundle\Privacy
|
||||
*/
|
||||
class PrivacyEvent extends Event
|
||||
{
|
||||
const PERSON_PRIVACY_EVENT = 'chill_person.privacy_event';
|
||||
|
||||
/**
|
||||
* @var Person
|
||||
*/
|
||||
private $person;
|
||||
|
||||
public const PERSON_PRIVACY_EVENT = 'chill_person.privacy_event';
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $args;
|
||||
|
||||
|
||||
/**
|
||||
* @var Person
|
||||
*/
|
||||
private $person;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
private $persons;
|
||||
|
||||
|
||||
/**
|
||||
* PrivacyEvent constructor.
|
||||
*
|
||||
* @param Person $person
|
||||
* @param array $args
|
||||
*/
|
||||
public function __construct(Person $person, array $args = array('action' => 'show'))
|
||||
public function __construct(Person $person, array $args = ['action' => 'show'])
|
||||
{
|
||||
$this->person = $person;
|
||||
$this->args = $args;
|
||||
$this->persons = array();
|
||||
$this->persons = [];
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Person
|
||||
*/
|
||||
public function getPerson()
|
||||
{
|
||||
return $this->person;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Person $person
|
||||
*/
|
||||
|
||||
public function addPerson(Person $person)
|
||||
{
|
||||
$this->persons[] = $person;
|
||||
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array $persons
|
||||
*/
|
||||
public function getPersons()
|
||||
{
|
||||
return $this->persons;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasPersons()
|
||||
{
|
||||
return count($this->persons) >= 1;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @return array
|
||||
*/
|
||||
@@ -106,5 +81,28 @@ class PrivacyEvent extends Event
|
||||
{
|
||||
return $this->args;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Person
|
||||
*/
|
||||
public function getPerson()
|
||||
{
|
||||
return $this->person;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return array $persons
|
||||
*/
|
||||
public function getPersons()
|
||||
{
|
||||
return $this->persons;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return bool
|
||||
*/
|
||||
public function hasPersons()
|
||||
{
|
||||
return count($this->persons) >= 1;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user