Skip to content

Commit

Permalink
fix: ensure template files have a tpl file extension (api-platform#6826)
Browse files Browse the repository at this point in the history
  • Loading branch information
kochen authored and soyuka committed Nov 29, 2024
1 parent eb53218 commit 8273ec1
Show file tree
Hide file tree
Showing 10 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion docs/pdg.config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pdg:
src: './guides'
references:
base_url: '/docs/reference'
exclude: ['*Factory.php', '*.tpl.php', 'deprecation.php']
exclude: ['*Factory.php', '*.php.tpl', 'deprecation.php']
exclude_path: ['OpenApi/Tests', 'JsonSchema/Tests', 'RamseyUuid/Tests', 'Metadata/Tests', 'HttpCache/Tests', 'Elasticsearch/Tests', 'Doctrine/Common/Tests', 'GraphQl/Tests', 'Serializer/Tests']
namespace: 'ApiPlatform'
output: 'dist/reference'
Expand Down
4 changes: 2 additions & 2 deletions src/Laravel/Console/Maker/Utils/StateTemplateGenerator.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ public function generate(string $pathLink, string $stateClassName, StateTypeEnum
private function loadTemplate(StateTypeEnum $stateTypeEnum): string
{
$templateFile = match ($stateTypeEnum) {
StateTypeEnum::Provider => 'StateProvider.tpl.php',
StateTypeEnum::Processor => 'StateProcessor.tpl.php',
StateTypeEnum::Provider => 'StateProvider.php.tpl',
StateTypeEnum::Processor => 'StateProcessor.php.tpl',
};

$templatePath = \dirname(__DIR__).'/Resources/skeleton/'.$templateFile;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(private Filesystem $filesystem)
*/
public function regenerateProviderFile(): void
{
$templatePath = \dirname(__DIR__).'/Resources/skeleton/AppServiceProvider.tpl.php';
$templatePath = \dirname(__DIR__).'/Resources/skeleton/AppServiceProvider.php.tpl';
$targetPath = base_path('app/Providers/AppServiceProvider.php');

$this->regenerateFileFromTemplate($templatePath, $targetPath);
Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Maker/MakeStateProcessor.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen

$generator->generateClass(
$stateProcessorClassNameDetails->getFullName(),
__DIR__.'/Resources/skeleton/StateProcessor.tpl.php'
__DIR__.'/Resources/skeleton/StateProcessor.php.tpl'
);
$generator->writeChanges();

Expand Down
2 changes: 1 addition & 1 deletion src/Symfony/Maker/MakeStateProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ public function generate(InputInterface $input, ConsoleStyle $io, Generator $gen

$generator->generateClass(
$stateProviderClassNameDetails->getFullName(),
__DIR__.'/Resources/skeleton/StateProvider.tpl.php'
__DIR__.'/Resources/skeleton/StateProvider.php.tpl'
);
$generator->writeChanges();

Expand Down

0 comments on commit 8273ec1

Please sign in to comment.