Gravatar   A
last analyzed

Complexity

Total Complexity 1

Size/Duplication

Total Lines 16
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 0
dl 0
loc 16
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A url() 0 7 1
1
<?php
2
3
namespace Vibe\Gravatar;
4
5
/**
6
 * Gravatar class to get gravatar from user emails.
7
 */
8
class Gravatar
9
{
10
    /**
11
    * get url
12
    * @param string $email - email to be used for gravatar
13
    * @param int $size - optional size of image
14
    * @return string $url - gravatar url
15
    */
16
    public function url($email, $size = 80)
17
    {
18
        $url = 'https://www.gravatar.com/avatar/';
19
        $url .= md5(strtolower(trim($email)));
20
        $url .= "?s=$size";
21
        return $url;
22
    }
23
}
24