Passed
Push — master ( 82b0d0...1ac70f )
by Bobby
09:15
created

TransformerInitTrait   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Test Coverage

Coverage 100%

Importance

Changes 1
Bugs 0 Features 0
Metric Value
wmc 1
eloc 5
c 1
b 0
f 0
dl 0
loc 24
ccs 3
cts 3
cp 1
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
namespace Ballen\Linguist\Transformers;
4
5
use Ballen\Linguist\Configuration;
6
7
/**
8
 * Linguist
9
 *
10
 * Linguist is a PHP library for parsing strings, it can extract and manipulate
11
 *  prefixed words in content ideal for working with @mentions, #topics and
12
 *  even custom action tags!
13
 *
14
 * @author Bobby Allen <[email protected]>
15
 * @license http://www.gnu.org/licenses/gpl-3.0.html
16
 * @link https://github.com/allebb/linguist
17
 * @link http://www.bobbyallen.me
18
 *
19
 */
20
trait TransformerInitTrait
21
{
22
23
    /**
24
     * Runtime storage for the formatted text string.
25
     * @var string
26
     */
27
    protected $formatted = '';
28
29
    /**
30
     * The tag configuration.
31
     * @var array 
32
     */
33
    protected $tags;
34
35
    /**
36
     * Class constructor
37
     * @param string $string The string of which to be converted/transformed.
38
     * @param Configuration $configuration The tag configuration.
39
     */
40 18
    public function __construct($string, Configuration $configuration)
41
    {
42 18
        $this->tags = $configuration->get();
43 18
        $this->transform($string);
0 ignored issues
show
Bug introduced by
It seems like transform() must be provided by classes using this trait. How about adding it as abstract method to this trait? ( Ignorable by Annotation )

If this is a false-positive, you can also ignore this issue in your code via the ignore-call  annotation

43
        $this->/** @scrutinizer ignore-call */ 
44
               transform($string);
Loading history...
44 18
    }
45
}
46