<commit_before><?php
/**
 * Created by PhpStorm.
 * User: antonpauli
 * Date: 27/07/15
 * Time: 18:35
 */

namespace IronShark\Extendable;

use IronShark\Extendable\CustomFieldType;

class CustomFieldConfigProvieder
{
    /**
     * Return config customfield configs for given model
     *
     * @param $modelClass
     * @return mixed
     */
    public static function customFieldConfigs($modelClass){
        $customFieldsConfig = config('custom-fields');
        return array_get($customFieldsConfig, $modelClass);
    }


    /**
     * Return custom field model field name for specified model and fieldtype
     *
     * @param $modelClass
     * @param $fieldName
     * @return string
     */
    public static function fieldType($modelClass, $fieldName){
        $fieldConfigs = self::customFieldConfigs($modelClass);

        switch ($fieldConfigs[$fieldName]['type']) {
            case CustomFieldType::Checkbox:
            case CustomFieldType::Select:
            case CustomFieldType::String:
            case CustomFieldType::Radio:
                return 'stringvalue';
            case CustomFieldType::Text:
                return 'textvalue';
            case CustomFieldType::DateTime:
                return 'datetime';
            default:
                return 'stringvalue';
        }
    }


    /**
     * Return all custom field names for specified model
     *
     * @param $modelClass
     * @return array
     */
    public static function fieldNames($modelClass) {
        $customFieldsConfig = config('custom-fields');
        return array_keys($customFieldsConfig[$modelClass]);
    }
}<commit_msg>fix fieldName list in CustomFieldConfigProvieder<commit_after><?php
/**
 * Created by PhpStorm.
 * User: antonpauli
 * Date: 27/07/15
 * Time: 18:35
 */

namespace IronShark\Extendable;

use IronShark\Extendable\CustomFieldType;

class CustomFieldConfigProvieder
{
    /**
     * Return config customfield configs for given model
     *
     * @param $modelClass
     * @return mixed
     */
    public static function customFieldConfigs($modelClass){
        $customFieldsConfig = config('custom-fields');
        return array_get($customFieldsConfig, $modelClass);
    }


    /**
     * Return custom field model field name for specified model and fieldtype
     *
     * @param $modelClass
     * @param $fieldName
     * @return string
     */
    public static function fieldType($modelClass, $fieldName){
        $fieldConfigs = self::customFieldConfigs($modelClass);

        switch ($fieldConfigs[$fieldName]['type']) {
            case CustomFieldType::Checkbox:
            case CustomFieldType::Select:
            case CustomFieldType::String:
            case CustomFieldType::Radio:
                return 'stringvalue';
            case CustomFieldType::Text:
                return 'textvalue';
            case CustomFieldType::DateTime:
                return 'datetime';
            default:
                return 'stringvalue';
        }
    }


    /**
     * Return all custom field names for specified model
     *
     * @param $modelClass
     * @return array
     */
    public static function fieldNames($modelClass) {
        $customFieldsConfig = config('custom-fields');
        return array_keys(array_get($customFieldsConfig, $modelClass, []));
    }
}
{'fraction_non_alphanumeric': 0.09993979530403371, 'fraction_numerical': 0.006020469596628537, 'mean_word_length': 2.3873598369011213, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5506437', 'n_tokens_mistral': 897, 'n_tokens_neox': 863, 'n_words': 211}