From f561cb59b67e04d6ae5d5c63a8edd7c6b3fec1fa Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guillaume=20Perr=C3=A9al?= <guillaume.perreal@irstea.fr>
Date: Thu, 3 Sep 2020 13:14:14 +0200
Subject: [PATCH] Trim tous les templates.

---
 src/HeaderComment/FormattedHeaderProvider.php     | 3 +--
 src/HeaderComment/UserDefinedTemplateProvider.php | 3 +--
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/HeaderComment/FormattedHeaderProvider.php b/src/HeaderComment/FormattedHeaderProvider.php
index f6a65a2..9afe58e 100644
--- a/src/HeaderComment/FormattedHeaderProvider.php
+++ b/src/HeaderComment/FormattedHeaderProvider.php
@@ -5,7 +5,6 @@
  *
  * For the full copyright and license information, please view the LICENSE
  * file that was distributed with this source code.
- *
  */
 
 namespace Irstea\CS\HeaderComment;
@@ -39,7 +38,7 @@ final class FormattedHeaderProvider implements HeaderProviderInterface
      */
     public function getHeader(): ?string
     {
-        $template = $this->templateProvider->getTemplate();
+        $template = trim($this->templateProvider->getTemplate());
 
         return $template ? $this->templateFormatter->format($template) : null;
     }
diff --git a/src/HeaderComment/UserDefinedTemplateProvider.php b/src/HeaderComment/UserDefinedTemplateProvider.php
index df92ba4..9d390f5 100644
--- a/src/HeaderComment/UserDefinedTemplateProvider.php
+++ b/src/HeaderComment/UserDefinedTemplateProvider.php
@@ -5,7 +5,6 @@
  *
  * For the full copyright and license information, please view the LICENSE
  * file that was distributed with this source code.
- *
  */
 
 namespace Irstea\CS\HeaderComment;
@@ -37,6 +36,6 @@ final class UserDefinedTemplateProvider implements TemplateProviderInterface
     {
         $path = $this->fileLocator->locate('.docheader');
 
-        return $path ? trim(file_get_contents($path)) : null;
+        return $path ? file_get_contents($path) : null;
     }
 }
-- 
GitLab