Skip to content

Commit

Permalink
Merge pull request #42 from moufmouf/dont_generate_coded_exceptions
Browse files Browse the repository at this point in the history
Fixing already existing exception detection
  • Loading branch information
moufmouf authored Sep 18, 2018
2 parents fe4da23 + f462744 commit b5446e5
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 13 deletions.
6 changes: 0 additions & 6 deletions generated/Exceptions/CurlException.php

This file was deleted.

6 changes: 0 additions & 6 deletions generated/Exceptions/JsonException.php

This file was deleted.

3 changes: 2 additions & 1 deletion generator/src/FileCreator.php
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

use function array_merge;
use Complex\Exception;
use function file_exists;
use PhpOffice\PhpSpreadsheet\Spreadsheet;
use PhpOffice\PhpSpreadsheet\Writer\Xlsx;
use function ucfirst;
Expand Down Expand Up @@ -145,7 +146,7 @@ public function generateRectorFile(array $functions, string $path): void
public function createExceptionFile(string $moduleName): void
{
$exceptionName = self::toExceptionName($moduleName);
if (!\class_exists("Safe\\Exceptions\\{$exceptionName}")) {
if (!file_exists(__DIR__.'/../../lib/Exceptions/'.$exceptionName.'.php')) {
\file_put_contents(
__DIR__.'/../../generated/Exceptions/'.$exceptionName.'.php',
<<<EOF
Expand Down

0 comments on commit b5446e5

Please sign in to comment.