Code Duplication    Length = 23-23 lines in 2 locations

src/RunOpenCode/Bundle/DoctrineNamingStrategy/DependencyInjection/Extension.php 2 locations

@@ 68-90 (lines=23) @@
65
     * @param array $config
66
     * @return Extension $this
67
     */
68
    private function configureUnderscoredBundlePrefixNamer(ContainerBuilder $container, array $config)
69
    {
70
        if (
71
            $container->hasDefinition('runopencode.doctrine.orm.naming_strategy.underscored_bundle_prefix')
72
            &&
73
            isset($config['underscored_bundle_prefix'])
74
        ) {
75
            $definition = $container->getDefinition('runopencode.doctrine.orm.naming_strategy.underscored_bundle_prefix');
76
77
            if ('uppercase' === $config['underscored_bundle_prefix']['case']) {
78
                $config['underscored_bundle_prefix']['case'] = CASE_UPPER;
79
            } else {
80
                $config['underscored_bundle_prefix']['case'] = CASE_LOWER;
81
            }
82
83
            $args = $definition->getArguments();
84
            $args[1] = $config['underscored_bundle_prefix'];
85
86
            $definition->setArguments($args);
87
        }
88
89
        return $this;
90
    }
91
92
    /**
93
     * Configure 'runopencode.doctrine.orm.naming_strategy.underscored_class_namespace_prefix' naming strategy.
@@ 99-121 (lines=23) @@
96
     * @param array $config
97
     * @return Extension $this
98
     */
99
    private function configureUnderscoredClassNamespacePrefixNamer(ContainerBuilder $container, array $config)
100
    {
101
        if (
102
            $container->hasDefinition('runopencode.doctrine.orm.naming_strategy.underscored_class_namespace_prefix')
103
            &&
104
            isset($config['underscored_class_namespace_prefix'])
105
        ) {
106
            $definition = $container->getDefinition('runopencode.doctrine.orm.naming_strategy.underscored_class_namespace_prefix');
107
108
            if ('uppercase' === $config['underscored_class_namespace_prefix']['case']) {
109
                $config['underscored_class_namespace_prefix']['case'] = CASE_UPPER;
110
            } else {
111
                $config['underscored_class_namespace_prefix']['case'] = CASE_LOWER;
112
            }
113
114
            $args = $definition->getArguments();
115
            $args[0] = $config['underscored_class_namespace_prefix'];
116
117
            $definition->setArguments($args);
118
        }
119
120
        return $this;
121
    }
122
123
    /**
124
     * Configure 'runopencode.doctrine.orm.naming_strategy.namer_collection' naming strategy.