Enchantment: Simplify getEnchantment() with null coalesce

This is made possible by 0e538ee51dc543e97994899bbf7a73f288fb33a6.
This commit is contained in:
Dylan K. Taylor 2017-12-21 13:02:24 +00:00
parent 6490d99ac2
commit c2b0f6af22

View File

@ -107,10 +107,7 @@ class Enchantment{
* @return Enchantment|null * @return Enchantment|null
*/ */
public static function getEnchantment(int $id){ public static function getEnchantment(int $id){
if(isset(self::$enchantments[$id])){ return self::$enchantments[$id] ?? null;
return self::$enchantments[$id];
}
return null;
} }
/** /**