Issues (24)

src/Builder/ParseRulesBuilder.php (2 issues)

1
<?php
2
3
namespace SteamMarketProviders\ParserManager\Builder;
4
5
use Closure;
6
7
class ParseRulesBuilder
8
{
9
    private \stdClass $rules;
10
11
    public function __construct()
12
    {
13
        $this->rules = new \stdClass();
14
    }
15
16
    public function wrapper(string $name, string $value, Closure $wrapper)
17
    {
18
        $old = clone $this->rules;
0 ignored issues
show
The assignment to $old is dead and can be removed.
Loading history...
19
20
        $this->rules->$name = $value;
21
        call_user_func($wrapper, $this);
22
23
        return $this;
24
    }
25
26
    public function item(string $name, string $value)
27
    {
28
        $this->rules->$name = $value;
29
        return $this;
30
    }
31
32
    public function print()
33
    {
34
        var_dump($this->rules);
0 ignored issues
show
Security Debugging Code introduced by
var_dump($this->rules) looks like debug code. Are you sure you do not want to remove it?
Loading history...
35
    }
36
}
37