| Conditions | 3 |
| Paths | 3 |
| Total Lines | 34 |
| Code Lines | 19 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 22 | protected function execute(InputInterface $input, OutputInterface $output): int |
||
| 23 | { |
||
| 24 | $units = $this->repository->locale_for('en-001')['units']['long']; |
||
| 25 | $methods = []; |
||
| 26 | |||
| 27 | foreach ($units as $name => $unit) { |
||
| 28 | if (empty($unit['unitPattern-count-one'])) { |
||
| 29 | continue; |
||
| 30 | } |
||
| 31 | |||
| 32 | $normalized = strtr($name, [ '-' => '_' ]); |
||
| 33 | |||
| 34 | $methods[] = <<<PHP |
||
| 35 | /** |
||
| 36 | * @param float|int|numeric-string \$number |
||
| 37 | * |
||
| 38 | * @return \$this |
||
| 39 | */ |
||
| 40 | public function $normalized(float|int|string \$number): self |
||
| 41 | { |
||
| 42 | \$this->sequence["$name"] = \$number; |
||
| 43 | |||
| 44 | return \$this; |
||
| 45 | } |
||
| 46 | PHP; |
||
| 47 | } |
||
| 48 | |||
| 49 | $contents = $this->render( |
||
| 50 | methods: implode("\n\n", $methods), |
||
| 51 | ); |
||
| 52 | |||
| 53 | file_put_contents(self::GENERATED_FILE, $contents); |
||
| 54 | |||
| 55 | return self::SUCCESS; |
||
| 56 | } |
||
| 86 |