From 5f3a557cf7424062da60064c8c646e983be54cda Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Guillaume=20Perr=C3=A9al?= <guillaume.perreal@irstea.fr>
Date: Fri, 7 Dec 2018 11:52:26 +0100
Subject: [PATCH] CS.

---
 src/Config.php | 17 +++++++++++++----
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/src/Config.php b/src/Config.php
index 269df9e..f027e1a 100644
--- a/src/Config.php
+++ b/src/Config.php
@@ -1,11 +1,18 @@
 <?php
+/*
+ * This file is part of "irstea/php-cs-fixer-config".
+ * (c) 2018 Irstea <dsi.poleis@irstea.fr>
+ *
+ * For the full copyright and license information, please view the LICENSE
+ * file that was distributed with this source code.
+ */
 
 namespace Irstea\CS;
 
 use PhpCsFixer\Config as PhpCsFixerConfig;
 
 /**
- * Class Config
+ * Class Config.
  */
 final class Config extends PhpCsFixerConfig
 {
@@ -144,13 +151,14 @@ final class Config extends PhpCsFixerConfig
             function () {
                 $last = date('Y');
                 $first = exec('git log --format=%cd --date=format:%Y --date-order | tail -n1') ?? $last;
+
                 return ($last !== null && $last !== $first) ? "$first-$last" : $first;
             }
         );
     }
 
     /**
-     * @return boolean[]
+     * @return bool[]
      */
     private function ruleSets()
     {
@@ -216,7 +224,7 @@ final class Config extends PhpCsFixerConfig
         $commit = $this->getHeadCommit();
         $cache = $this->loadCache();
         if (!isset($cache[$commit][$key])) {
-            if (!isset($cache[$commit])) {
+            if (!isset($cache[$commit])) {        // TODO: load a template from a local file.
                 $cache[$commit] = [];
             }
             $cache[$commit][$key] = $generator();
@@ -234,6 +242,7 @@ final class Config extends PhpCsFixerConfig
         if ($this->commit === null) {
             $this->commit = trim(shell_exec('git rev-parse HEAD'));
         }
+
         return $this->commit;
     }
 
@@ -248,6 +257,7 @@ final class Config extends PhpCsFixerConfig
                 $this->cache = json_decode(file_get_contents($this->cacheFile), true);
             }
         }
+
         return $this->cache;
     }
 
@@ -258,5 +268,4 @@ final class Config extends PhpCsFixerConfig
     {
         file_put_contents($this->cacheFile, json_encode($cache));
     }
-
 }
-- 
GitLab