Modernize private property declarations in src/item

This commit is contained in:
Dylan K. Taylor
2022-05-17 20:59:24 +01:00
parent fb4d332d1a
commit 95ad3f16e1
21 changed files with 44 additions and 100 deletions

View File

@@ -29,21 +29,10 @@ namespace pocketmine\item\enchantment;
* Note: This class is assumed to be immutable. Consider this before making alterations.
*/
final class EnchantmentInstance{
/** @var Enchantment */
private $enchantment;
/** @var int */
private $level;
/**
* EnchantmentInstance constructor.
*
* @param Enchantment $enchantment Enchantment type
* @param int $level Level of enchantment
*/
public function __construct(Enchantment $enchantment, int $level = 1){
$this->enchantment = $enchantment;
$this->level = $level;
}
public function __construct(
private Enchantment $enchantment,
private int $level = 1
){}
/**
* Returns the type of this enchantment.