<?php namespace nur\mapper\base\capacitor; use nur\b\IllegalAccessException; trait TCapacitor { function chargeAll(iterable $items, ?string $channel=null): void { foreach ($items as $item) { $this->charge($item, $channel); } } function offsetExists($offset) { throw IllegalAccessException::not_implemented(); } function offsetGet($offset) { throw IllegalAccessException::not_implemented(); } function offsetUnset($offset) { throw IllegalAccessException::not_implemented(); } function offsetSet($offset, $value) { $this->charge($value); } }