Email::shareUrl()   A
last analyzed

Complexity

Conditions 3
Paths 4

Size

Total Lines 21

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 21
rs 9.584
c 0
b 0
f 0
cc 3
nc 4
nop 0
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