code: public function fileCountValidationCallback()
      {
          if ($this->form && ($object = $this->form->getObject())) {
              if ($this->getMaxFileCount() - 1 < count($object)) {
                  return false;
              }
          }
  
          return true;
      }
docs: Callback for file count validation.
  
  @internal
  This function gets the value passed in as variable,
  but we do not need it.
  @return bool