From 7c5767a622735becf300882c554f5915c0ca92cf Mon Sep 17 00:00:00 2001 From: Jitendra Adhikari Date: Sat, 25 Aug 2018 16:03:10 +0700 Subject: [PATCH] refactor(twig.gen): generated -> count --- src/Generator/TwigGenerator.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/Generator/TwigGenerator.php b/src/Generator/TwigGenerator.php index 55b7f64..22ebdde 100644 --- a/src/Generator/TwigGenerator.php +++ b/src/Generator/TwigGenerator.php @@ -56,7 +56,7 @@ public function __construct(array $templatePaths, string $cachePath) */ public function generate(string $targetPath, array $parameters, CollisionHandlerInterface $handler = null): int { - $generated = 0; + $count = 0; if (!$this->twig) { $this->initTwig(); @@ -75,13 +75,13 @@ public function generate(string $targetPath, array $parameters, CollisionHandler $processed[$relativePath] = true; if ($this->shouldGenerate($template, $parameters)) { - $generated += (int) $this->doGenerate($relativePath, $targetPath, $parameters, $handler); + $count += (int) $this->doGenerate($relativePath, $targetPath, $parameters, $handler); } } $this->pathUtil->createBinaries($parameters['bin'] ?? [], $parameters['path'] ?? ''); - return $generated; + return $count; } public function generateTests(array $testMetadata, array $parameters): int @@ -90,7 +90,7 @@ public function generateTests(array $testMetadata, array $parameters): int $this->initTwig(); } - $generated = 0; + $count = 0; foreach ($testMetadata as $metadata) { // Skip existing @@ -99,11 +99,10 @@ public function generateTests(array $testMetadata, array $parameters): int } $content = $this->twig->render('tests/test.twig', $metadata + $parameters); - - $generated += (int) $this->pathUtil->writeFile($targetFile, $content); + $count += (int) $this->pathUtil->writeFile($targetFile, $content); } - return $generated; + return $count; } public function generateDocs(array $docsMetadata, array $parameters): int