Completed
Pull Request — master (#164)
by Pascal
01:43
created

ParsedComment   A

Complexity

Total Complexity 3

Size/Duplication

Total Lines 48
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 0

Importance

Changes 1
Bugs 0 Features 0
Metric Value
c 1
b 0
f 0
dl 0
loc 48
rs 10
wmc 3
lcom 0
cbo 0

3 Methods

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 5 1
A getLine() 0 4 1
A getComment() 0 4 1
1
<?php
2
3
namespace Gettext\Utils;
4
5
/**
6
 * Comment parsed by PhpFunctionsScanner.
7
 */
8
class ParsedComment
9
{
10
    /**
11
     * The comment itself.
12
     *
13
     * @var string
14
     */
15
    protected $comment;
16
17
    /**
18
     * The line where the function starts.
19
     *
20
     * @var int
21
     */
22
    protected $line;
23
24
    /**
25
     * Initializes the instance.
26
     *
27
     * @param string $comment The comment itself.
28
     * @param int    $line The line where the comment starts.
29
     */
30
    public function __construct($comment, $line)
31
    {
32
        $this->comment = $comment;
33
        $this->line = $line;
34
    }
35
36
    /**
37
     * Return the comment's line number.
38
     *
39
     * @return int Line number.
40
     */
41
    public function getLine()
42
    {
43
        return $this->line;
44
    }
45
46
    /**
47
     * Return the actual comment string.
48
     *
49
     * @return string The comment.
50
     */
51
    public function getComment()
52
    {
53
        return $this->comment;
54
    }
55
}
56