WordFormatter   A
last analyzed

Complexity

Total Complexity 2

Size/Duplication

Total Lines 21
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 2
c 1
b 0
f 0
lcom 0
cbo 0
dl 0
loc 21
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A wrap() 0 9 2
1
<?php
2
3
/*
4
 * This file is part of the Word wrap helper
5
 *
6
 * (c) Nexuslink Services
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11
12
namespace WordWrapHelper;
13
14
class WordFormatter {    
15
16
    /**
17
     * @param string $content     
18
     * @param int    $width [Optional]
19
     * @param string $break [Optional]
20
     * @param bool   $cut [Optional]
21
     * 
22
     * @return string
23
     */
24
    public function wrap($content, $width = 75, $break = "\n", $cut = false) {
25
26
        if(!empty($content))
27
        {
28
            return wordwrap($content, $width, $break, $cut);
29
        }
30
        
31
        return $content;
32
    }
33
    
34
}