fix: Strict type RoleScope.

This commit is contained in:
Pol Dellaiera 2021-11-18 14:29:11 +01:00
parent 162db60f59
commit ae79ebc299
No known key found for this signature in database
GPG Key ID: D476DFE9C67467CA

View File

@ -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;