steam-market-providers /
parser-manager
| 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
Unused Code
introduced
by
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
|
|||
| 35 | } |
||
| 36 | } |
||
| 37 |