Configure Dice using immutability and addRule()
masterAs of version 4.0, Dice is immutable. Methods that modify the container configuration, such as addRule() and addRules(), do not change the existing instance but instead return a new Dice instance containing the updated rules. You must reassign the result to your variable to persist configuration changes.
// Correct way to add rules in 4.0+
$dice = $dice->addRule('PDO', ['shared' => true]);
$db = $dice->create('PDO');