ReplaceResult::getReplacements()   A
last analyzed

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
 * This file is part of php-simple-regex.
4
 *
5
 * php-simple-regex is free software: you can redistribute it and/or modify
6
 * it under the terms of the GNU Lesser General Public License as published by
7
 * the Free Software Foundation, either version 3 of the License, or
8
 * (at your option) any later version.
9
 *
10
 * php-simple-regex is distributed in the hope that it will be useful,
11
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 * GNU General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU General Public License
16
 * along with php-simple-regex.  If not, see <http://www.gnu.org/licenses/>.
17
 */
18
namespace Mcustiel\PhpSimpleRegex;
19
20
/**
21
 * Represents the result of calling a preg_replace_* function and requesting the count of replacements.
22
 *
23
 * @author mcustiel
24
 * @codeCoverageIgnore
25
 */
26
class ReplaceResult
27
{
28
    /**
29
     * @var string
30
     */
31
    private $result;
32
    /**
33
     * @var integer
34
     */
35
    private $replacements;
36
37
    /**
38
     * Class constructor.
39
     *
40
     * @param string $result
41
     * @param integer $replacements
42
     */
43
    public function __construct($result, $replacements)
44
    {
45
        $this->result = $result;
46
        $this->replacements = $replacements;
47
    }
48
49
    /**
50
     * @return string
51
     */
52
    public function getResult()
53
    {
54
        return $this->result;
55
    }
56
57
    /**
58
     * @return number
59
     */
60
    public function getReplacements()
61
    {
62
        return $this->replacements;
63
    }
64
}
65