Passed
Pull Request — master (#14)
by Vladimir
02:30 queued 44s
created

Trello::buildLink()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 5
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 5
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 3
nc 1
nop 0
1
<?php
2
/**
3
 * @link https://github.com/yiimaker/yii2-social-share
4
 * @copyright Copyright (c) 2017-2018 Yii Maker
5
 * @license BSD 3-Clause License
6
 */
7
8
namespace ymaker\social\share\drivers;
9
10
use ymaker\social\share\base\AbstractDriver;
11
12
/**
13
 * Driver for Trello.
14
 *
15
 * @link https://trello.com
16
 *
17
 * @author Vladimir Kuprienko <[email protected]>
18
 * @since 2.2
19
 */
20
class Trello extends AbstractDriver
21
{
22
    /**
23
     * {@inheritdoc}
24
     */
25
    protected function processShareData()
26
    {
27
        $this->url = static::encodeData($this->url);
28
        $this->title = static::encodeData($this->title);
29
    }
30
31
    /**
32
     * {@inheritdoc}
33
     */
34
    protected function buildLink()
35
    {
36
        return 'https://trello.com/add-card'
37
            . '?url={url}'
38
            . '&name={title}'
39
        ;
40
    }
41
42
    /**
43
     * {@inheritdoc}
44
     */
45
    protected function getMetaTags()
46
    {
47
        return [['property' => 'og:description', 'content' => '{description}']];
48
    }
49
}
50