public function __construct(Transformable $inner) { parent::__construct($inner); // inner will be defined to the used inner transformable in the get method $this->inner = null; $this->innerCollection = [$inner]; }
public function __construct(Transformable $inner, array $args = []) { parent::__construct($inner, $args); $this->options()->setUnlessExists('key', md5($this->inner()->scent()))->force('cache', function ($item) { return is_a($item, 'Filchos\\Imago\\Cache\\CacheInterface'); })->force('key', function ($item) { return is_string($item) && strlen($item) <= 32; }); }