Skip to content

Commit

Permalink
superficial bits in preparation for #503
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Jan 31, 2025
1 parent 5ca0547 commit 6d0bdc7
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions generator/src/FileCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,21 @@ public function generatePhpFile(array $functions, string $path): void

foreach ($phpFunctionsByModule as $module => $phpFunctions) {
$lcModule = \lcfirst($module);
if (!is_dir($path)) {
\mkdir($path);
}
$stream = \fopen($path.$lcModule.'.php', 'w');
if ($stream === false) {
throw new \RuntimeException('Unable to write to '.$path);
}

// Write file header
\fwrite($stream, "<?php\n
namespace Safe;
use Safe\\Exceptions\\".self::toExceptionName($module). ';');

// Write file header
foreach ($phpFunctions as $phpFunction) {
\fwrite($stream, "\n".$phpFunction);
}
Expand Down
1 change: 1 addition & 0 deletions generator/src/GenerateCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int
{

$this->rmGenerated();

// Let's build the DTD necessary to load the XML files.
DocPage::buildEntities();
$scanner = new Scanner(__DIR__ . '/../doc/doc-en/en/reference/');
Expand Down

0 comments on commit 6d0bdc7

Please sign in to comment.