Modernize private property declarations in src/permission

This commit is contained in:
Dylan K. Taylor
2022-05-17 21:28:42 +01:00
parent 6eac2ea7a5
commit 22edca610c
6 changed files with 32 additions and 65 deletions

View File

@@ -31,17 +31,7 @@ namespace pocketmine\permission;
* Represents a permission
*/
class Permission{
/** @var string */
private $name;
/** @var string */
private $description;
/**
* @var bool[]
* @phpstan-var array<string, bool>
*/
private $children;
private string $description;
/**
* Creates a new Permission object to be attached to Permissible objects
@@ -49,10 +39,12 @@ class Permission{
* @param bool[] $children
* @phpstan-param array<string, bool> $children
*/
public function __construct(string $name, ?string $description = null, array $children = []){
$this->name = $name;
$this->description = $description ?? "";
$this->children = $children;
public function __construct(
private string $name,
?string $description = null,
private array $children = []
){
$this->description = $description ?? ""; //TODO: wtf ????
$this->recalculatePermissibles();
}