Conditions | 1 |
Paths | 1 |
Total Lines | 32 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Tests | 0 |
CRAP Score | 2 |
Changes | 0 |
1 | <?php |
||
7 | public function write($path, GenericState $state) |
||
8 | { |
||
9 | $fileContent = <<<FILE |
||
10 | <?php |
||
11 | |||
12 | namespace Brazanation\States; |
||
13 | |||
14 | class {$state->getClassName()} extends State |
||
15 | { |
||
16 | const CODE = {$state->getCode()}; |
||
17 | |||
18 | const FULL_NAME = '{$state->getFullName()}'; |
||
19 | |||
20 | const SHORT_NAME = '{$state->getShortName()}'; |
||
21 | |||
22 | const TIMEZONE = '{$state->getTimeZone()}'; |
||
23 | |||
24 | public function __construct() |
||
25 | { |
||
26 | parent::__construct( |
||
27 | self::FULL_NAME, |
||
28 | self::SHORT_NAME, |
||
29 | self::CODE, |
||
30 | self::TIMEZONE |
||
31 | ); |
||
32 | } |
||
33 | } |
||
34 | |||
35 | FILE; |
||
36 | |||
37 | return file_put_contents("{$path}/{$state->getClassName()}.php", $fileContent); |
||
38 | } |
||
39 | } |
||
40 |