-
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into feature/fixes-documentation
Conflicts: README.md docs/004_config.md
- Loading branch information
Showing
30 changed files
with
494 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,4 @@ | |
/.vscode/ | ||
/vendor/ | ||
.phpunit.* | ||
.php_cs.cache | ||
.php_cs.cache |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<?php | ||
|
||
declare(strict_types=1); | ||
|
||
namespace Gacela\CodeGenerator; | ||
|
||
use Gacela\Framework\AbstractConfig; | ||
use Gacela\Framework\Config; | ||
use LogicException; | ||
|
||
final class CodeGeneratorConfig extends AbstractConfig | ||
{ | ||
public function getFacadeMakerTemplate(): string | ||
{ | ||
return $this->getCommandTemplateContent('facade-maker.txt'); | ||
} | ||
|
||
public function getFactoryMakerTemplate(): string | ||
{ | ||
return $this->getCommandTemplateContent('factory-maker.txt'); | ||
} | ||
|
||
public function getConfigMakerTemplate(): string | ||
{ | ||
return $this->getCommandTemplateContent('config-maker.txt'); | ||
} | ||
|
||
public function getDependencyProviderMakerTemplate(): string | ||
{ | ||
return $this->getCommandTemplateContent('dependency-provider-maker.txt'); | ||
} | ||
|
||
private function getCommandTemplateContent(string $filename): string | ||
{ | ||
return file_get_contents(__DIR__ . '/Infrastructure/Template/Command/' . $filename); | ||
} | ||
|
||
public function getComposerJsonContentAsArray(): array | ||
{ | ||
$filename = Config::getApplicationRootDir() . '/composer.json'; | ||
if (!file_exists($filename)) { | ||
throw new LogicException('composer.json file not found but it is required'); | ||
} | ||
|
||
return json_decode(file_get_contents($filename), true); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.