code: public function setMode($mode)
      {
          if (!in_array($mode, $this->acceptedModes)) {
              throw new \InvalidArgumentException(sprintf('Invalid mode: [%s]', $mode));
          }
  
          $this->mode = $mode;
      }
docs: Set the permission mode.
  
  @param string $mode Permission mode
  
  @throws \InvalidArgumentException
  
  @return void