Skip to content

Commit

Permalink
fix cs
Browse files Browse the repository at this point in the history
  • Loading branch information
savinmikhail committed Jan 4, 2025
1 parent 0a61f6c commit c546ec0
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 17 deletions.
10 changes: 5 additions & 5 deletions src/AnalyzeComments/Analyzer/Analyzer.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,11 @@
final readonly class Analyzer
{
public function __construct(
private Config $configDTO,
private CommentTypeFactory $commentFactory,
private MetricsFacade $metrics,
private BaselineStorageInterface $baselineStorage,
private CacheInterface $cache,
private Config $configDTO,
private CommentTypeFactory $commentFactory,
private MetricsFacade $metrics,
private BaselineStorageInterface $baselineStorage,
private CacheInterface $cache,
private CommentStatisticsAggregator $statisticsAggregator,
) {}

Expand Down
2 changes: 1 addition & 1 deletion src/AnalyzeComments/Analyzer/AnalyzerFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
final readonly class AnalyzerFactory
{
public function getAnalyzer(
Config $configDto,
Config $configDto,
BaselineStorageInterface $baselineStorage,
): Analyzer {
$commentFactory = new CommentTypeFactory($configDto->getAllowedTypes());
Expand Down
4 changes: 2 additions & 2 deletions src/AnalyzeComments/Analyzer/CommentFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@

public function __construct(
private CommentTypeFactory $commentFactory,
private Config $configDTO,
?Parser $parser = null,
private Config $configDTO,
?Parser $parser = null,
) {
$this->parser = $parser ?? (new ParserFactory())->createForHostVersion();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
final readonly class CommentStatisticsAggregator
{
public function __construct(
private Config $configDTO,
private Config $configDTO,
private CommentTypeFactory $commentFactory,
) {}

Expand Down
2 changes: 1 addition & 1 deletion src/AnalyzeComments/Analyzer/FileContentExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{
public function __construct(
private SplFileInfo $file,
private Config $configDTO,
private Config $configDTO,
) {}

public function getContent(): string
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
<?php

declare(strict_types=1);

namespace SavinMikhail\CommentsDensity\AnalyzeComments\Formatter\Filter;

use SavinMikhail\CommentsDensity\AnalyzeComments\Analyzer\DTO\Output\CommentDTO;
use SavinMikhail\CommentsDensity\AnalyzeComments\Analyzer\DTO\Output\CommentStatisticsDTO;
use SavinMikhail\CommentsDensity\AnalyzeComments\Analyzer\DTO\Output\Report;

use function in_array;

final readonly class ViolatingCommentsOnlyFilter
{
public function filter(Report $report): array
Expand All @@ -15,15 +19,14 @@ public function filter(Report $report): array
static fn(CommentStatisticsDTO $commentStatisticsDTO): string => $commentStatisticsDTO->type,
array_filter(
$report->commentsStatistics,
static fn(CommentStatisticsDTO $commentStatisticsDTO): bool => $commentStatisticsDTO->color === 'red'
)
static fn(CommentStatisticsDTO $commentStatisticsDTO): bool => $commentStatisticsDTO->color === 'red',
),
);

return array_filter(
$report->comments,
static fn(CommentDTO $commentDTO): bool =>
in_array($commentDTO->commentType, $violatingTypes, true)
&& $commentDTO->commentTypeColor === 'red'
static fn(CommentDTO $commentDTO): bool => in_array($commentDTO->commentType, $violatingTypes, true)
&& $commentDTO->commentTypeColor === 'red',
);
}
}
}
2 changes: 1 addition & 1 deletion src/AnalyzeComments/Formatter/HtmlFormatter.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
namespace SavinMikhail\CommentsDensity\AnalyzeComments\Formatter;

use SavinMikhail\CommentsDensity\AnalyzeComments\Analyzer\DTO\Output\Report;

use SavinMikhail\CommentsDensity\AnalyzeComments\Formatter\Filter\ViolatingCommentsOnlyFilter;

use function file_put_contents;
use function htmlspecialchars;
use function nl2br;
Expand Down

0 comments on commit c546ec0

Please sign in to comment.