*/ private $options; /** * @param array $options */ public function __construct(array $options) { $this->options = $options; } public function initialize(mysqli $connection): void { foreach ($this->options as $option => $value) { if (! mysqli_options($connection, $option, $value)) { throw InvalidOption::fromOption($option, $value); } } } }