TextMessage::getTitle()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Importance

Changes 3
Bugs 3 Features 0
Metric Value
c 3
b 3
f 0
dl 0
loc 4
rs 10
cc 1
eloc 2
nc 1
nop 0
1
<?php
2
3
namespace PEIP\Message;
4
5
/*
6
 * This file is part of the PEIP package.
7
 * (c) 2009-2016 Timo Michna <timomichna/yahoo.de>
8
 *
9
 * For the full copyright and license information, please view the LICENSE
10
 * file that was distributed with this source code.
11
 */
12
13
/*
14
 * TextMessage
15
 *
16
 * @author Timo Michna <timomichna/yahoo.de>
17
 * @package PEIP
18
 * @subpackage message
19
 * @extends \PEIP\Message\StringMessage
20
 * @implements \PEIP\INF\Base\Container, \PEIP\INF\Message\Message, \PEIP\INF\Base\Buildable
21
 */
22
23
24
use PEIP\Base\GenericBuilder;
25
26
class TextMessage extends \PEIP\Message\StringMessage
27
{
28
    protected $title;
29
30
    /**
31
     * @param $content
32
     * @param $title
33
     *
34
     * @return
35
     */
36
    public function __construct($content, $title)
37
    {
38
        $this->setContent((string) $content);
0 ignored issues
show
Bug introduced by
The method setContent() does not exist on PEIP\Message\TextMessage. Did you maybe mean doSetContent()?

This check marks calls to methods that do not seem to exist on an object.

This is most likely the result of a method being renamed without all references to it being renamed likewise.

Loading history...
39
    }
40
41
    /**
42
     * @param $title
43
     *
44
     * @return
45
     */
46
    public function setTitle($title)
47
    {
48
        $this->title = (string) $title;
49
    }
50
51
    /**
52
     * @return
53
     */
54
    public function getTitle()
55
    {
56
        return $this->title;
57
    }
58
59
    /**
60
     * Provides a static build method to create new Instances of this class.
61
     * Implements \PEIP\INF\Base\Buildable. Overwrites GenericMessage::build.
62
     *
63
     * @static
64
     * @implements \PEIP\INF\Base\Buildable
65
     *
66
     * @return bool wether the header is set
67
     */
68
    public static function build(array $arguments = [])
69
    {
70
        return GenericBuilder::getInstance('\PEIP\Message\StringMessage')->build($arguments);
71
    }
72
}
73