Completed
Pull Request — master (#14)
by Vladimir
02:46 queued 57s
created

Trello::processShareData()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

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