Email   A
last analyzed

Complexity

Total Complexity 3

Size/Duplication

Total Lines 27
Duplicated Lines 0 %

Coupling/Cohesion

Components 1
Dependencies 2

Importance

Changes 0
Metric Value
wmc 3
lcom 1
cbo 2
dl 0
loc 27
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A shareUrl() 0 21 3
1
<?php
2
3
namespace SocialLinks\Providers;
4
5
class Email extends ProviderBase implements ProviderInterface
6
{
7
    /**
8
     * {@inheritdoc}
9
     */
10
    public function shareUrl()
11
    {
12
        $info = $this->page->get();
13
        $subject = $info['title'] ?: $info['url'];
14
15
        if (empty($info['text'])) {
16
            $body = $info['url'];
17
        } else {
18
            $body = $info['text']."\n".$info['url'];
19
        }
20
21
        return $this->buildUrl(
22
            'mailto:',
23
            null,
24
            array(
25
                'subject' => $subject,
26
                'body' => $body,
27
            ),
28
            static::RFC3986
29
        );
30
    }
31
}
32