Skip to content

Commit

Permalink
harmonization of the wording
Browse files Browse the repository at this point in the history
  • Loading branch information
DeGraciaMathieu committed May 12, 2024
1 parent 8c000c2 commit e51b2d5
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
4 changes: 2 additions & 2 deletions app/Infrastructure/Analyze/Adapters/AnalyzeServiceAdapter.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@
use App\Domain\Aggregators\FileAggregator;
use App\Domain\Aggregators\WordAggregator;
use App\Infrastructure\Analyze\Visitors\ClassVisitor;
use App\Infrastructure\Analyze\Mappers\PhpParserWordMapper;
use App\Infrastructure\Analyze\Mappers\AnalyzeServiceMapper;

class AnalyzeServiceAdapter implements AnalyzeService
{
public function __construct(
private Parser $parser,
private PhpParserWordMapper $mapper,
private AnalyzeServiceMapper $mapper,
) {}

public function getWords(FileAggregator $fileAggregator, bool $withMethod): WordAggregator
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
use App\Domain\Entities\WordEntity;
use App\Domain\Aggregators\WordAggregator;

class PhpParserWordMapper
class AnalyzeServiceMapper
{
public function __construct(
private WordAggregator $wordAggregator,
Expand All @@ -15,14 +15,19 @@ public function __construct(
public function map(array $words): void
{
foreach ($words as $word) {
$this->wordAggregator->add(
WordEntity::from($word),
);
$this->add($word);
}
}

public function aggregate(): WordAggregator
{
return $this->wordAggregator;
}

private function add(string $word): void
{
$this->wordAggregator->add(
WordEntity::from($word),
);
}
}

0 comments on commit e51b2d5

Please sign in to comment.