code: protected function validateWidget($widget, $value)
      {
          if (null === $value) {
              return;
          }
          $widget->setInputCallback(function () use ($value) {
              return $value;
          });
          $widget->validate();
      }
docs: Validate the widget using the value.
  
  @param Widget      $widget The widget to validate.
  
  @param string|null $value  The value to validate.
  
  @return void
  
  @SuppressWarnings(PHPMD.Superglobals)
  @SuppressWarnings(PHPMD.CamelCaseVariableName)