code: public function setForm($key, $spec, $enabled = true)
      {
          if (is_object($spec)) {
              if (!$spec instanceof Container) {
                  throw new \InvalidArgumentException('Tab container must be of the type \Core\Form\Container');
              }
  
              if (!$spec->getLabel()) {
                  throw new \InvalidArgumentException('Container instances must have a label.');
              }
          }
  
          if (is_array($spec)) {
              if (!isset($spec['type'])) {
                  $spec['type'] = 'Core/Container';
              }
  
              /*
               * For convenience, forms may be specified outside the options array.
               * But in order to be passed through to the form element manager,
               * we must move it to the options.
               */
              if (!isset($spec['options']['forms']) && isset($spec['forms'])) {
                  $spec['options']['forms'] = $spec['forms'];
                  unset($spec['forms']);
              }
          }
  
          return parent::setForm($key, $spec, $enabled);
      }
docs: Sets a form container.
  
  Either pass in an object of type \Core\Form\Container or provide a $spec array.
  Only instances of \Core\Form\Container which have a label are allowed.
  
  @see \Core\Form\Container::setForm
  
  @param string                            $key
  @param array|string|\Core\Form\Container $spec
  @param bool                              $enabled
  
  @return self
  @throws \InvalidArgumentException