From c6dd386d67f770a468c5ea3239465196515d28ed Mon Sep 17 00:00:00 2001 From: Mati Kochen Date: Tue, 26 Nov 2024 13:39:39 +0100 Subject: [PATCH] fix: ensure template files have a tpl file extension (#6826) --- docs/pdg.config.yaml | 2 +- .../{StateProcessor.tpl.php => StateProcessor.php.tpl} | 0 .../skeleton/{StateProvider.tpl.php => StateProvider.php.tpl} | 0 src/Laravel/Console/Maker/Utils/StateTemplateGenerator.php | 4 ++-- ...{AppServiceProvider.tpl.php => AppServiceProvider.php.tpl} | 0 .../Tests/Console/Maker/Utils/AppServiceFileGenerator.php | 2 +- src/Symfony/Maker/MakeStateProcessor.php | 2 +- src/Symfony/Maker/MakeStateProvider.php | 2 +- .../{StateProcessor.tpl.php => StateProcessor.php.tpl} | 0 .../skeleton/{StateProvider.tpl.php => StateProvider.php.tpl} | 0 10 files changed, 6 insertions(+), 6 deletions(-) rename src/Laravel/Console/Maker/Resources/skeleton/{StateProcessor.tpl.php => StateProcessor.php.tpl} (100%) rename src/Laravel/Console/Maker/Resources/skeleton/{StateProvider.tpl.php => StateProvider.php.tpl} (100%) rename src/Laravel/Tests/Console/Maker/Resources/skeleton/{AppServiceProvider.tpl.php => AppServiceProvider.php.tpl} (100%) rename src/Symfony/Maker/Resources/skeleton/{StateProcessor.tpl.php => StateProcessor.php.tpl} (100%) rename src/Symfony/Maker/Resources/skeleton/{StateProvider.tpl.php => StateProvider.php.tpl} (100%) diff --git a/docs/pdg.config.yaml b/docs/pdg.config.yaml index 39bc4f435ca..1970c1e1b82 100644 --- a/docs/pdg.config.yaml +++ b/docs/pdg.config.yaml @@ -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' diff --git a/src/Laravel/Console/Maker/Resources/skeleton/StateProcessor.tpl.php b/src/Laravel/Console/Maker/Resources/skeleton/StateProcessor.php.tpl similarity index 100% rename from src/Laravel/Console/Maker/Resources/skeleton/StateProcessor.tpl.php rename to src/Laravel/Console/Maker/Resources/skeleton/StateProcessor.php.tpl diff --git a/src/Laravel/Console/Maker/Resources/skeleton/StateProvider.tpl.php b/src/Laravel/Console/Maker/Resources/skeleton/StateProvider.php.tpl similarity index 100% rename from src/Laravel/Console/Maker/Resources/skeleton/StateProvider.tpl.php rename to src/Laravel/Console/Maker/Resources/skeleton/StateProvider.php.tpl diff --git a/src/Laravel/Console/Maker/Utils/StateTemplateGenerator.php b/src/Laravel/Console/Maker/Utils/StateTemplateGenerator.php index 2082d512f76..3751793c58c 100644 --- a/src/Laravel/Console/Maker/Utils/StateTemplateGenerator.php +++ b/src/Laravel/Console/Maker/Utils/StateTemplateGenerator.php @@ -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; diff --git a/src/Laravel/Tests/Console/Maker/Resources/skeleton/AppServiceProvider.tpl.php b/src/Laravel/Tests/Console/Maker/Resources/skeleton/AppServiceProvider.php.tpl similarity index 100% rename from src/Laravel/Tests/Console/Maker/Resources/skeleton/AppServiceProvider.tpl.php rename to src/Laravel/Tests/Console/Maker/Resources/skeleton/AppServiceProvider.php.tpl diff --git a/src/Laravel/Tests/Console/Maker/Utils/AppServiceFileGenerator.php b/src/Laravel/Tests/Console/Maker/Utils/AppServiceFileGenerator.php index 6edd7363b03..a85272c0223 100644 --- a/src/Laravel/Tests/Console/Maker/Utils/AppServiceFileGenerator.php +++ b/src/Laravel/Tests/Console/Maker/Utils/AppServiceFileGenerator.php @@ -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); diff --git a/src/Symfony/Maker/MakeStateProcessor.php b/src/Symfony/Maker/MakeStateProcessor.php index 6620f39f3e8..82c8596a952 100644 --- a/src/Symfony/Maker/MakeStateProcessor.php +++ b/src/Symfony/Maker/MakeStateProcessor.php @@ -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(); diff --git a/src/Symfony/Maker/MakeStateProvider.php b/src/Symfony/Maker/MakeStateProvider.php index 714af081761..7fc69cd938a 100644 --- a/src/Symfony/Maker/MakeStateProvider.php +++ b/src/Symfony/Maker/MakeStateProvider.php @@ -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(); diff --git a/src/Symfony/Maker/Resources/skeleton/StateProcessor.tpl.php b/src/Symfony/Maker/Resources/skeleton/StateProcessor.php.tpl similarity index 100% rename from src/Symfony/Maker/Resources/skeleton/StateProcessor.tpl.php rename to src/Symfony/Maker/Resources/skeleton/StateProcessor.php.tpl diff --git a/src/Symfony/Maker/Resources/skeleton/StateProvider.tpl.php b/src/Symfony/Maker/Resources/skeleton/StateProvider.php.tpl similarity index 100% rename from src/Symfony/Maker/Resources/skeleton/StateProvider.tpl.php rename to src/Symfony/Maker/Resources/skeleton/StateProvider.php.tpl