Skip to content

Commit 6d0bdc7

Browse files
committed
superficial bits in preparation for #503
1 parent 5ca0547 commit 6d0bdc7

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

generator/src/FileCreator.php

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,14 +28,21 @@ public function generatePhpFile(array $functions, string $path): void
2828

2929
foreach ($phpFunctionsByModule as $module => $phpFunctions) {
3030
$lcModule = \lcfirst($module);
31+
if (!is_dir($path)) {
32+
\mkdir($path);
33+
}
3134
$stream = \fopen($path.$lcModule.'.php', 'w');
3235
if ($stream === false) {
3336
throw new \RuntimeException('Unable to write to '.$path);
3437
}
38+
39+
// Write file header
3540
\fwrite($stream, "<?php\n
3641
namespace Safe;
3742
3843
use Safe\\Exceptions\\".self::toExceptionName($module). ';');
44+
45+
// Write file header
3946
foreach ($phpFunctions as $phpFunction) {
4047
\fwrite($stream, "\n".$phpFunction);
4148
}

generator/src/GenerateCommand.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
2323
{
2424

2525
$this->rmGenerated();
26+
2627
// Let's build the DTD necessary to load the XML files.
2728
DocPage::buildEntities();
2829
$scanner = new Scanner(__DIR__ . '/../doc/doc-en/en/reference/');

0 commit comments

Comments
 (0)