mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
fix: Strict type RoleScope.
This commit is contained in:
parent
162db60f59
commit
ae79ebc299
@ -1,5 +1,7 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
namespace Chill\MainBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
@ -18,12 +20,12 @@ class RoleScope
|
||||
* @ORM\Column(name="id", type="integer")
|
||||
* @ORM\GeneratedValue(strategy="AUTO")
|
||||
*/
|
||||
private int $id;
|
||||
private ?int $id = null;
|
||||
|
||||
/**
|
||||
* @ORM\Column(type="string", length=255)
|
||||
*/
|
||||
private string $role;
|
||||
private ?string $role = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(
|
||||
@ -32,7 +34,7 @@ class RoleScope
|
||||
* @ORM\JoinColumn(nullable=true, name="scope_id")
|
||||
* @ORM\Cache(usage="NONSTRICT_READ_WRITE")
|
||||
*/
|
||||
private ?Scope $scope;
|
||||
private ?Scope $scope = null;
|
||||
|
||||
/**
|
||||
* @var Collection
|
||||
@ -43,53 +45,33 @@ class RoleScope
|
||||
*/
|
||||
private $permissionsGroups;
|
||||
|
||||
private bool $new;
|
||||
|
||||
public function __construct() {
|
||||
$this->new = true;
|
||||
$this->permissionsGroups = new ArrayCollection();
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getId()
|
||||
public function getId(): ?int
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getRole()
|
||||
public function getRole(): ?string
|
||||
{
|
||||
return $this->role;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Scope
|
||||
*/
|
||||
public function getScope()
|
||||
public function getScope(): ?Scope
|
||||
{
|
||||
return $this->scope;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param type $role
|
||||
* @return RoleScope
|
||||
*/
|
||||
public function setRole($role)
|
||||
public function setRole(?string $role = null): self
|
||||
{
|
||||
$this->role = $role;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param Scope $scope
|
||||
* @return RoleScope
|
||||
*/
|
||||
public function setScope(Scope $scope = null)
|
||||
public function setScope(?Scope $scope = null): self
|
||||
{
|
||||
$this->scope = $scope;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user