Skip to content

Commit 4ff5eb5

Browse files
committed
package by feature
1 parent 7c5f424 commit 4ff5eb5

File tree

63 files changed

+256
-268
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+256
-268
lines changed

Taskfile.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,12 @@ tasks:
5858
deps: [install]
5959
cmd: 'vendor/bin/composer-unused {{.CLI_ARGS}}'
6060

61+
run:
62+
cmd: './bin/comments_density analyze:comments'
63+
64+
base:
65+
cmd: './bin/comments_density generate:baseline'
66+
6167
check:
6268
cmds:
6369
- task: cs

bin/comments_density

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
declare(strict_types=1);
55

66
use Composer\XdebugHandler\XdebugHandler;
7-
use SavinMikhail\CommentsDensity\Commands\AnalyzeCommentCommand;
8-
use SavinMikhail\CommentsDensity\Commands\BaselineCommand;
7+
use SavinMikhail\CommentsDensity\AnalyzeComments\Commands\AnalyzeCommentCommand;
8+
use SavinMikhail\CommentsDensity\Baseline\Commands\BaselineCommand;
99
use Symfony\Component\Console\Application;
1010

1111
// Display all errors and warnings

comments_density.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,9 @@
22

33
declare(strict_types=1);
44

5-
use SavinMikhail\CommentsDensity\Config\DTO\ConfigDTO;
6-
use SavinMikhail\CommentsDensity\Config\DTO\ConsoleOutputDTO;
7-
use SavinMikhail\CommentsDensity\Config\DTO\MissingDocblockConfigDTO;
8-
use SavinMikhail\CommentsDensity\Config\DTO\OutputDTO;
5+
use SavinMikhail\CommentsDensity\AnalyzeComments\Config\DTO\ConfigDTO;
6+
use SavinMikhail\CommentsDensity\AnalyzeComments\Config\DTO\ConsoleOutputDTO;
7+
use SavinMikhail\CommentsDensity\AnalyzeComments\Config\DTO\MissingDocblockConfigDTO;
98

109
return new ConfigDTO(
1110
thresholds: [

src/Analyzer/AnalyzeFileTask.php renamed to src/AnalyzeComments/Analyzer/AnalyzeFileTask.php

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,22 @@
22

33
declare(strict_types=1);
44

5-
namespace SavinMikhail\CommentsDensity\Analyzer;
5+
namespace SavinMikhail\CommentsDensity\AnalyzeComments\Analyzer;
66

7-
use SavinMikhail\CommentsDensity\Analyzer\DTO\Output\CommentDTO;
8-
use SavinMikhail\CommentsDensity\Comments\CommentFactory;
9-
use SavinMikhail\CommentsDensity\Config\DTO\ConfigDTO;
10-
use SavinMikhail\CommentsDensity\MissingDocblock\MissingDocBlockAnalyzer;
7+
use SavinMikhail\CommentsDensity\AnalyzeComments\Analyzer\DTO\Output\CommentDTO;
8+
use SavinMikhail\CommentsDensity\AnalyzeComments\Comments\CommentFactory;
9+
use SavinMikhail\CommentsDensity\AnalyzeComments\Config\DTO\ConfigDTO;
10+
use SavinMikhail\CommentsDensity\AnalyzeComments\MissingDocblock\MissingDocBlockAnalyzer;
1111
use SplFileInfo;
1212
use Symfony\Component\Console\Output\OutputInterface;
1313
use Symfony\Contracts\Cache\CacheInterface;
14-
1514
use function array_merge;
1615
use function count;
1716
use function file;
1817
use function file_get_contents;
1918
use function in_array;
2019
use function is_array;
2120
use function token_get_all;
22-
2321
use const T_COMMENT;
2422
use const T_DOC_COMMENT;
2523

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@
22

33
declare(strict_types=1);
44

5-
namespace SavinMikhail\CommentsDensity\Analyzer;
6-
7-
use SavinMikhail\CommentsDensity\Analyzer\DTO\Output\CommentDTO;
8-
use SavinMikhail\CommentsDensity\Analyzer\DTO\Output\CommentStatisticsDTO;
9-
use SavinMikhail\CommentsDensity\Analyzer\DTO\Output\OutputDTO;
5+
namespace SavinMikhail\CommentsDensity\AnalyzeComments\Analyzer;
6+
7+
use SavinMikhail\CommentsDensity\AnalyzeComments\Analyzer\DTO\Output\CommentDTO;
8+
use SavinMikhail\CommentsDensity\AnalyzeComments\Analyzer\DTO\Output\CommentStatisticsDTO;
9+
use SavinMikhail\CommentsDensity\AnalyzeComments\Analyzer\DTO\Output\OutputDTO;
10+
use SavinMikhail\CommentsDensity\AnalyzeComments\Comments\CommentFactory;
11+
use SavinMikhail\CommentsDensity\AnalyzeComments\Config\DTO\ConfigDTO;
12+
use SavinMikhail\CommentsDensity\AnalyzeComments\Metrics\MetricsFacade;
13+
use SavinMikhail\CommentsDensity\AnalyzeComments\MissingDocblock\MissingDocBlockAnalyzer;
1014
use SavinMikhail\CommentsDensity\Baseline\Storage\BaselineStorageInterface;
11-
use SavinMikhail\CommentsDensity\Comments\CommentFactory;
12-
use SavinMikhail\CommentsDensity\Config\DTO\ConfigDTO;
13-
use SavinMikhail\CommentsDensity\Metrics\MetricsFacade;
14-
use SavinMikhail\CommentsDensity\MissingDocblock\MissingDocBlockAnalyzer;
1515
use SplFileInfo;
1616
use Symfony\Component\Console\Output\OutputInterface;
1717
use Symfony\Contracts\Cache\CacheInterface;
18-
1918
use function array_push;
2019

2120
final class Analyzer

src/Analyzer/AnalyzerFactory.php renamed to src/AnalyzeComments/Analyzer/AnalyzerFactory.php

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,16 @@
22

33
declare(strict_types=1);
44

5-
namespace SavinMikhail\CommentsDensity\Analyzer;
5+
namespace SavinMikhail\CommentsDensity\AnalyzeComments\Analyzer;
66

7+
use SavinMikhail\CommentsDensity\AnalyzeComments\Comments\CommentFactory;
8+
use SavinMikhail\CommentsDensity\AnalyzeComments\Config\DTO\ConfigDTO;
9+
use SavinMikhail\CommentsDensity\AnalyzeComments\Metrics\CDS;
10+
use SavinMikhail\CommentsDensity\AnalyzeComments\Metrics\ComToLoc;
11+
use SavinMikhail\CommentsDensity\AnalyzeComments\Metrics\MetricsFacade;
12+
use SavinMikhail\CommentsDensity\AnalyzeComments\Metrics\ResourceUtilization;
13+
use SavinMikhail\CommentsDensity\AnalyzeComments\MissingDocblock\MissingDocBlockAnalyzer;
714
use SavinMikhail\CommentsDensity\Baseline\Storage\BaselineStorageInterface;
8-
use SavinMikhail\CommentsDensity\Comments\CommentFactory;
9-
use SavinMikhail\CommentsDensity\Config\DTO\ConfigDTO;
10-
use SavinMikhail\CommentsDensity\Metrics\CDS;
11-
use SavinMikhail\CommentsDensity\Metrics\ComToLoc;
12-
use SavinMikhail\CommentsDensity\Metrics\MetricsFacade;
13-
use SavinMikhail\CommentsDensity\Metrics\ResourceUtilization;
14-
use SavinMikhail\CommentsDensity\MissingDocblock\MissingDocBlockAnalyzer;
1515
use Symfony\Component\Cache\Adapter\FilesystemAdapter;
1616
use Symfony\Component\Console\Output\OutputInterface;
1717

src/Analyzer/CommentStatisticsAggregator.php renamed to src/AnalyzeComments/Analyzer/CommentStatisticsAggregator.php

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,15 @@
22

33
declare(strict_types=1);
44

5-
namespace SavinMikhail\CommentsDensity\Analyzer;
6-
7-
use SavinMikhail\CommentsDensity\Analyzer\DTO\Output\CommentDTO;
8-
use SavinMikhail\CommentsDensity\Analyzer\DTO\Output\CommentStatisticsDTO;
9-
use SavinMikhail\CommentsDensity\Comments\CommentFactory;
10-
use SavinMikhail\CommentsDensity\Config\DTO\ConfigDTO;
11-
use SavinMikhail\CommentsDensity\Exception\CommentsDensityException;
12-
use SavinMikhail\CommentsDensity\MissingDocblock\MissingDocBlockAnalyzer;
5+
namespace SavinMikhail\CommentsDensity\AnalyzeComments\Analyzer;
136

7+
use SavinMikhail\CommentsDensity\AnalyzeComments\Analyzer\DTO\Output\CommentDTO;
8+
use SavinMikhail\CommentsDensity\AnalyzeComments\Analyzer\DTO\Output\CommentStatisticsDTO;
9+
use SavinMikhail\CommentsDensity\AnalyzeComments\Comments\CommentFactory;
10+
use SavinMikhail\CommentsDensity\AnalyzeComments\Config\DTO\ConfigDTO;
11+
use SavinMikhail\CommentsDensity\AnalyzeComments\Exception\CommentsDensityException;
12+
use SavinMikhail\CommentsDensity\AnalyzeComments\MissingDocblock\MissingDocBlockAnalyzer;
1413
use function substr_count;
15-
1614
use const PHP_EOL;
1715

1816
final readonly class CommentStatisticsAggregator

src/Analyzer/DTO/Output/CdsDTO.php renamed to src/AnalyzeComments/Analyzer/DTO/Output/CdsDTO.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace SavinMikhail\CommentsDensity\Analyzer\DTO\Output;
5+
namespace SavinMikhail\CommentsDensity\AnalyzeComments\Analyzer\DTO\Output;
66

77
final readonly class CdsDTO
88
{

src/Analyzer/DTO/Output/ComToLocDTO.php renamed to src/AnalyzeComments/Analyzer/DTO/Output/ComToLocDTO.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace SavinMikhail\CommentsDensity\Analyzer\DTO\Output;
5+
namespace SavinMikhail\CommentsDensity\AnalyzeComments\Analyzer\DTO\Output;
66

77
final readonly class ComToLocDTO
88
{

src/Analyzer/DTO/Output/CommentDTO.php renamed to src/AnalyzeComments/Analyzer/DTO/Output/CommentDTO.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
declare(strict_types=1);
44

5-
namespace SavinMikhail\CommentsDensity\Analyzer\DTO\Output;
5+
namespace SavinMikhail\CommentsDensity\AnalyzeComments\Analyzer\DTO\Output;
66

77
final readonly class CommentDTO
88
{

0 commit comments

Comments
 (0)