Livejournal::shareUrl()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 18

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 18
rs 9.6666
c 0
b 0
f 0
cc 2
nc 2
nop 0
1
<?php
2
3
namespace SocialLinks\Providers;
4
5
class Livejournal extends ProviderBase implements ProviderInterface
6
{
7
    /**
8
     * {@inheritdoc}
9
     */
10
    public function shareUrl()
11
    {
12
        $titleArray = $this->page->get(array('title'));
13
14
        if (isset($titleArray['title'])) {
15
            $title = $titleArray['title'];
16
        } else {
17
            $title = $this->page->getUrl();
18
        }
19
20
        $postText = '<a href="'.$this->page->getUrl().'">'.$title.'</a>';
21
22
        return $this->buildUrl(
23
            'http://www.livejournal.com/update.bml',
24
            array('title' => 'subject'),
25
            array('event' => $postText)
26
        );
27
    }
28
}
29