<commit_before><?php

namespace eCampApi;

class ConfigFactory {
    /**
     * params String $name         Content type name is PascalCase
     * params String $namePlural   Specify non-standard plural names.
     * params String $entityName   Specify entity name if it deviates from main name.
     */
    public static function createConfig(string $name, ?String $namePlural = null, ?String $entityName = null) {
        // used in class namespace (PascalCase)
        $namespace = $name;

        // used in folder structure (Prefix + PascalCase)
        $folder = 'eCamp'.$name;

        // route name
        $route = 'e-camp-api.rest.doctrine.'.strtolower($name);

        // URI (lower case) + plural
        $apiEndpoint = !is_null($namePlural) ? $namePlural : $name.'s';
        $apiEndpoint = self::pascalToKebabCase($apiEndpoint);

        // name of entity ($namespace s fallback)
        $entity = !is_null($entityName) ? $entityName : $namespace;

        // property prefix (camelCase)
        $propertyPrefix = lcfirst($entity);

        return [
            'router' => [
                'routes' => [
                    $route => [
                        'type' => 'Segment',
                        'options' => [
                            'route' => "/api/{$apiEndpoint}[/:{$propertyPrefix}Id]",
                            'defaults' => [
                                'controller' => "eCampApi\\V1\\Rest\\{$entity}\\Controller",
                            ],
                        ],
                    ],<commit_msg>corrected route names (kebab case)<commit_after><?php

namespace eCampApi;

class ConfigFactory {
    /**
     * params String $name         Content type name is PascalCase
     * params String $namePlural   Specify non-standard plural names.
     * params String $entityName   Specify entity name if it deviates from main name.
     */
    public static function createConfig(string $name, ?String $namePlural = null, ?String $entityName = null) {
        // used in class namespace (PascalCase)
        $namespace = $name;

        // used in folder structure (Prefix + PascalCase)
        $folder = 'eCamp'.$name;

        // route name
        $route = 'e-camp-api.rest.doctrine.'.self::pascalToKebabCase($name);

        // URI (lower case) + plural
        $apiEndpoint = !is_null($namePlural) ? $namePlural : $name.'s';
        $apiEndpoint = self::pascalToKebabCase($apiEndpoint);

        // name of entity ($namespace s fallback)
        $entity = !is_null($entityName) ? $entityName : $namespace;

        // property prefix (camelCase)
        $propertyPrefix = lcfirst($entity);

        return [
            'router' => [
                'routes' => [
                    $route => [
                        'type' => 'Segment',
                        'options' => [
                            'route' => "/api/{$apiEndpoint}[/:{$propertyPrefix}Id]",
                            'defaults' => [
                                'controller' => "eCampApi\\V1\\Rest\\{$entity}\\Controller",
                            ],
                        ],
                    ],
{'fraction_non_alphanumeric': 0.12699425654116145, 'fraction_numerical': 0.0006381620931716656, 'mean_word_length': 1.6234309623430963, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 19, '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': '6739256', 'n_tokens_mistral': 841, 'n_tokens_neox': 818, 'n_words': 202}