Closed criticalmash closed 10 months ago
$currency type needs an initial value
Under Element Class using the given code example produces an error
Typed property my\plugin\elements\Product::$currency must not be accessed before initialization
This Stqackoverflow answer Updating to Craft 4 breaks plugin settings: must not be accessed before initialization states that Yii 2/Craft 4 uses typed variables must be intitalized.
Good catch, thanks! I've pushed a slight change to agree with our other uses, i.e. craft\models\EntryType::$handle.
craft\models\EntryType::$handle
$currency type needs an initial value
Description
Under Element Class using the given code example produces an error
Typed property my\plugin\elements\Product::$currency must not be accessed before initialization
This Stqackoverflow answer Updating to Craft 4 breaks plugin settings: must not be accessed before initialization states that Yii 2/Craft 4 uses typed variables must be intitalized.