Shared code to parse an Accept* field & negotiate against server preferences, returns an array of preferences.

@param string $clientField
@param string $serverField
@param string $fromField

@return MatchedPreferenceInterface[]
182348
private function genericAll($clientField, $serverField, $fromField)
    {
        $clientPrefList = $this->parsePreferences(false, $clientField, $fromField);
        $serverPrefList = $this->parsePreferences(true, $serverField, $fromField);

        return $this->negotiator->negotiateAll($clientPrefList, $serverPrefList, $fromField);
    }
939469
public function updateClient(Client $client)
    {
        ValidationUtility::ensureNotNull('$client->getClientId()', $client->getClientId());

        return $this->callServicePostApi(
            '\Authlete\Dto\Client::fromJson',
            self::$CLIENT_UPDATE_API_PATH . $client->getClientId(),
            null, $client);
    }
125396
private function getMappedSettings(array $settings, $fromIndex, $toIndex)
    {
        $mappedSettings = ['sourceOrder' => [], 'sources' => []];

        if (isset($settings['sourceOrder'])) {
            foreach ($settings['sourceOrder'] as $row) {
                if ('key' == $row[0]) {
                    $row[1] = $this->getSource('', $row[1], $fromIndex, $toIndex);
                }
                $mappedSettings['sourceOrder'][] = $row;
            }
        }

        if (isset($settings['sources'])) {
            foreach ($settings['sources'] as $source => $sourceSettings) {
                $mappedSource = $this->getSource('', $source, $fromIndex, $toIndex);
                $mappedSettings['sources'][$mappedSource] = [
                  'tableAttributes' => $this->getSources('', $sourceSettings['tableAttributes'], $fromIndex, $toIndex),
                ];
            }
        }

        return $mappedSettings;
    }
410414
private function getMatchingIndexes($fromField, array $matchingList, PreferenceInterface $clientPref)
    {
        $matchingIndexList = array();

        foreach ($matchingList as $key => $matching) {
            if ($this->partialLangMatches($fromField, $matching, $clientPref)) {
                $matchingIndexList[] = $key;
            }
        }

        return $matchingIndexList;
    }
149273
public function checkboxes(FieldContract $field)
    {
        return $this->form->checkboxes(
                        $field->get('name'), $field->get('options'), $field->get('checked'), $field->get('attributes')
        );
    }
938053
public function mapToField($fromField)
    {
        return array_key_exists($fromField, $this->mapping) ? $this->mapping[$fromField] : null;
    }
106033
protected function processField($field)
    {
        $javaScriptCode = [];
        $fieldName = $field->getName();

        foreach ($field->getValidation() as $validationName => $validationConfiguration) {
            $validatorClassName = $validationConfiguration->getClassName();

            if (in_array(AbstractValidator::class, class_parents($validatorClassName))) {
                $javaScriptCode[] = (string)$this->getInlineJavaScriptValidationCode($field, $validationName, $validationConfiguration);
            }
        }

        $javaScriptCode = implode(CRLF, $javaScriptCode);
        $javaScriptFieldName = GeneralUtility::quoteJSvalue($fieldName);

        return <<<JS
            /***************************
            * Field: "$fieldName"
            ****************************/
            field = form.getFieldByName($javaScriptFieldName);

            if (null !== field) {
$javaScriptCode
            }

JS;
    }
858387
public static List<Object[]> getFieldDebugInfos(final String field, String clientId)
    {
        Map<String, List<Object[]>> debugInfo = getDebugInfoMap(clientId);
        List<Object[]> fieldDebugInfo = debugInfo.get(field);
        if (fieldDebugInfo == null)
        {
            // no field debug-infos yet, create them and store it in the Map
            fieldDebugInfo = new ArrayList<Object[]>();
            debugInfo.put(field, fieldDebugInfo);
        }
        return fieldDebugInfo;
    }
1360261
private function parseField(string $field): array
    {
        $source = static::DEFAULT_SOURCE;
        $type = static::DEFAULT_TYPE;
        $origin = null;

        if (strpos($field, '(') !== false) {
            $source = substr($field, strpos($field, '(') + 1, -1);
            $field = substr($field, 0, strpos($field, '('));

            if (strpos($source, ':') !== false) {
                list($source, $origin) = explode(':', $source);
            }
        }

        if (strpos($field, ':') !== false) {
            list($field, $type) = explode(':', $field);
        }

        return [$field, $type, $source, $origin];
    }
402901
protected function getSelectedValueForMenu(Field $field)
    {
        $valueAccessor = $this->getFieldValueAccessor($field);

        if ($field->isMultipleAnswers()) {
            return $this->getMultipleSelectedValue($field->name, $valueAccessor, $field->htmlValue);
        }

        return $this->getSelectedValue($field->name, $valueAccessor, $field->htmlValue);
    }
995335
public function checkboxes(FieldContract $field): Htmlable
    {
        return $this->form->checkboxes(
            $field->get('name'),
            $this->asArray($field->get('options')),
            $field->get('checked'),
            $field->get('attributes')
        );
    }
421932
public function resolve(MetaSetField $field)
    {
        $type = $field->getType();

        if ($type === 'select') {
            $options = [];
            foreach (explode(',', $field->getOptions()) as $value) {
                $option = [$value];

                $translationIdentifier = $value;
                if ($this->useTitlePrefix) {
                    $translationIdentifier = $field->getMetaSet()->getName().'.'.$translationIdentifier;
                }

                foreach ($this->languages as $language) {
                    $option[] = $this->translator->trans($translationIdentifier, [], $this->domain, $language);
                }

                $options[] = $option;
            }

            return $options;
        } elseif ($type === 'suggest') {
            $dataSourceId = $field->getOptions();
            $options = [
                'source_id' => $dataSourceId,
            ];

            return $options;
        }

        return null;
    }
1006399
def match_client_preferences_with_provider_capabilities(self, client_preferences):
        # type: (oic.message.RegistrationRequest) -> Mapping[str, Union[str, List[str]]]
        
        matched_prefs = client_preferences.to_dict()
        for pref in ['response_types', 'default_acr_values']:
            if pref not in client_preferences:
                continue

            capability = PREFERENCE2PROVIDER[pref]
            # only preserve the common values
            matched_values = find_common_values(client_preferences[pref], self.configuration_information[capability])
            # deal with space separated values
            matched_prefs[pref] = [' '.join(v) for v in matched_values]

        return matched_prefs
624856
public function getFormFieldValueOptions(FieldInterface $field)
    {
        $fieldOptions = $this->getFieldOptions($field);

        $formFieldOptions = [];
        if (isset($fieldOptions['minValue'])) {
            $formFieldOptions['constraints'][] = new GreaterThanOrEqual(['value' => $fieldOptions['minValue']]);
        }
        if (isset($fieldOptions['maxValue'])) {
            $formFieldOptions['constraints'][] = new LessThanOrEqual(['value' => $fieldOptions['maxValue']]);
        }

        return $formFieldOptions;
    }
366608
private function getOrderClause(string $field) : array
    {
        $className = App::shortName(get_class($this->table), 'Model/Table', 'Table');
        $config = (new ModuleConfig(ConfigType::FIELDS(), $className))->parse();

        if (! property_exists($config, $field)) {
            return [];
        }

        if (! property_exists($config->{$field}, 'orderBy')) {
            return [];
        }

        if (! property_exists($config->{$field}, 'orderDir')) {
            return [];
        }

        return [$config->{$field}->orderBy => $config->{$field}->orderDir];
    }
730117
public static List<Object> getFieldValues(Class<? extends Enum<?>> clazz, String fieldName) {
		final Enum<?>[] enums = clazz.getEnumConstants();
		if (null == enums) {
			return null;
		}
		final List<Object> list = new ArrayList<>(enums.length);
		for (Enum<?> e : enums) {
			list.add(ReflectUtil.getFieldValue(e, fieldName));
		}
		return list;
	}
976985
static Optional<AnnotatedValueResolver> ofBeanField(Field field, Set<String> pathParams,
                                                        List<RequestObjectResolver> objectResolvers) {
        // 'Field' is only used for converting a bean.
        // So we always need to pass 'implicitRequestObjectAnnotation' as false.
        return of(field, field, field.getType(), pathParams, objectResolvers, false);
    }