inner = $inner; $this->defMask = $defaultMask; $this->mask = $mask; } /** * @inheritdoc * * @since [*next-version*] */ public function get($key) { if (!$this->isExposed($key)) { throw new NotFoundException( $this->__('Inner key "%1$s" is not exposed', [$key]), 0, null ); } return $this->inner->get($key); } /** * @inheritdoc * * @since [*next-version*] */ public function has($key) { $key = (string) $key; return $this->isExposed($key) && $this->inner->has($key); } /** * Checks if a key is exposed through the mask. * * @since [*next-version*] * * @param string $key The key to check. * * @return bool True if the key is exposed, false if the key is hidden. */ protected function isExposed(string $key): bool { return array_key_exists($key, $this->mask) ? $this->mask[$key] !== false : $this->defMask; } }