Total Complexity | 3 |
Total Lines | 38 |
Duplicated Lines | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 1 |
1 | <?php declare(strict_types=1); |
||
12 | final class StringWriter extends AbstractWriter |
||
13 | { |
||
14 | /** |
||
15 | * @var string |
||
16 | */ |
||
17 | private $pgn; |
||
18 | |||
19 | /** |
||
20 | * Initializes a new instance of this class. |
||
21 | * |
||
22 | * @param bool $showMoveNumberTwice Whether or not to repeat the move number. |
||
23 | */ |
||
24 | public function __construct(bool $showMoveNumberTwice = false) |
||
25 | { |
||
26 | parent::__construct($showMoveNumberTwice); |
||
27 | |||
28 | $this->pgn = ''; |
||
29 | } |
||
30 | |||
31 | /** |
||
32 | * Gets the PGN data that was written. |
||
33 | * |
||
34 | * @return string |
||
35 | */ |
||
36 | public function getPgn(): string |
||
37 | { |
||
38 | return $this->pgn; |
||
39 | } |
||
40 | |||
41 | /** |
||
42 | * Writes a single game. |
||
43 | * |
||
44 | * @param string $pgn The PGN data of a single game. |
||
45 | * @return void |
||
46 | */ |
||
47 | protected function writeGame(string $pgn): void |
||
50 | } |
||
51 | } |
||
52 |