Completed
Push — master ( c952f4...b4ee2b )
by Seong
01:13
created

DiscussHelper.php ➔ getUserImage()   A

Complexity

Conditions 2
Paths 2

Size

Total Lines 7

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 4
dl 0
loc 7
rs 10
c 0
b 0
f 0
1
<?php
2
3
if (!function_exists('limitText')) {
4
5
    function limitText($text, $size = 200)
6
    {
7
        if (strlen($text) > $size)
8
            return substr($text, 0, $size) . '...';
9
        else
10
            return $text;
11
    }
12
}
13
14
if (!function_exists('getUserImage')) {
15
16
    function getUserImage($user, $imageField, $imagePath, $defaultImage)
17
    {
18
        if ($imageField == "")
19
            return  $defaultImage;
20
        else
21
            return $imagePath.$user->$imageField;
22
    }
23
}
24