Code Duplication    Length = 5-5 lines in 2 locations

src/Solr/SolrIndex.php 2 locations

@@ 135-139 (lines=5) @@
132
     */
133
    public static function getClassNameFromIndex($indexName)
134
    {
135
        if (($indexPrefix = Environment::getEnv('SS_SOLR_INDEX_PREFIX'))
136
            && (substr($indexName, 0, strlen($indexPrefix)) === $indexPrefix)
137
        ) {
138
            $indexName = substr($indexName, strlen($indexPrefix));
139
        }
140
141
        if (($indexSuffix = Environment::getEnv('SS_SOLR_INDEX_SUFFIX'))
142
            && (substr($indexName, -strlen($indexSuffix)) === $indexSuffix)
@@ 141-145 (lines=5) @@
138
            $indexName = substr($indexName, strlen($indexPrefix));
139
        }
140
141
        if (($indexSuffix = Environment::getEnv('SS_SOLR_INDEX_SUFFIX'))
142
            && (substr($indexName, -strlen($indexSuffix)) === $indexSuffix)
143
        ) {
144
            $indexName = substr($indexName, 0, -strlen($indexSuffix));
145
        }
146
147
        return str_replace('-', '\\', $indexName);
148
    }