Code Duplication    Length = 8-8 lines in 2 locations

src/Transformations/WordWrapper.php 1 location

@@ 226-233 (lines=8) @@
223
     * @param string $str
224
     * @return int
225
     */
226
    protected static function longestWordLength($str)
227
    {
228
        $words = preg_split('/[ -]/', $str);
229
        $lengths = array_map(function ($s) {
230
            return strlen($s);
231
        }, $words);
232
        return max($lengths);
233
    }
234
}
235

src/Transformations/Wrap/DataCellWidths.php 1 location

@@ 180-187 (lines=8) @@
177
     * @param string $str
178
     * @return int
179
     */
180
    protected static function longestWordLength($str)
181
    {
182
        $words = preg_split('#[ /-]#', $str);
183
        $lengths = array_map(function ($s) {
184
            return strlen($s);
185
        }, $words);
186
        return max($lengths);
187
    }
188
}
189