$value) { if (! array_key_exists($key, $this->data)) throw new InvalidContainerDataException( 'Key ' . $key . ' is not valid for this container' ); $this->$key = $value; } } } }