code: protected function getSelectedValue($value, $selected)
      {
          if (is_array($selected)) {
              return in_array($value, $selected, true) ? 'selected' : null;
          }
  
          return ((string)$value == (string)$selected) ? 'selected' : null;
      }
docs: Determine if the value is selected.
  
  @param  string $value
  @param  string $selected
  
  @return null|string