File tree Expand file tree Collapse file tree 20 files changed +37
-20
lines changed
Expand file tree Collapse file tree 20 files changed +37
-20
lines changed Original file line number Diff line number Diff line change 1010use SavinMikhail \CommentsDensity \AnalyzeComments \Config \DTO \ConfigDTO ;
1111use SavinMikhail \CommentsDensity \AnalyzeComments \MissingDocblock \MissingDocBlockAnalyzer ;
1212use SplFileInfo ;
13- use Symfony \Component \Console \Output \OutputInterface ;
1413use Symfony \Contracts \Cache \CacheInterface ;
14+
1515use function array_merge ;
1616use function count ;
1717use function file ;
1818use function file_get_contents ;
1919use function in_array ;
2020use function is_array ;
2121use function token_get_all ;
22+
2223use const T_COMMENT ;
2324use const T_DOC_COMMENT ;
2425
Original file line number Diff line number Diff line change 44
55namespace SavinMikhail \CommentsDensity \AnalyzeComments \Analyzer ;
66
7+ use Psr \Cache \InvalidArgumentException ;
78use SavinMikhail \CommentsDensity \AnalyzeComments \Analyzer \DTO \Output \CommentDTO ;
89use SavinMikhail \CommentsDensity \AnalyzeComments \Analyzer \DTO \Output \CommentStatisticsDTO ;
910use SavinMikhail \CommentsDensity \AnalyzeComments \Analyzer \DTO \Output \Report ;
1415use SavinMikhail \CommentsDensity \AnalyzeComments \MissingDocblock \MissingDocBlockAnalyzer ;
1516use SavinMikhail \CommentsDensity \Baseline \Storage \BaselineStorageInterface ;
1617use SplFileInfo ;
17- use Symfony \Component \Console \Output \OutputInterface ;
1818use Symfony \Contracts \Cache \CacheInterface ;
19+
1920use function array_push ;
2021
2122final class Analyzer
@@ -35,7 +36,7 @@ public function __construct(
3536
3637 /**
3738 * @param SplFileInfo[] $files
38- * @throws CommentsDensityException
39+ * @throws CommentsDensityException|InvalidArgumentException
3940 */
4041 public function analyze (iterable $ files ): Report
4142 {
Original file line number Diff line number Diff line change 1313use SavinMikhail \CommentsDensity \AnalyzeComments \MissingDocblock \MissingDocBlockAnalyzer ;
1414use SavinMikhail \CommentsDensity \Baseline \Storage \BaselineStorageInterface ;
1515use Symfony \Component \Cache \Adapter \FilesystemAdapter ;
16- use Symfony \Component \Console \Output \OutputInterface ;
1716
1817final readonly class AnalyzerFactory
1918{
Original file line number Diff line number Diff line change 1010use SavinMikhail \CommentsDensity \AnalyzeComments \Config \DTO \ConfigDTO ;
1111use SavinMikhail \CommentsDensity \AnalyzeComments \Exception \CommentsDensityException ;
1212use SavinMikhail \CommentsDensity \AnalyzeComments \MissingDocblock \MissingDocBlockAnalyzer ;
13+
1314use function substr_count ;
15+
1416use const PHP_EOL ;
1517
1618final readonly class CommentStatisticsAggregator
Original file line number Diff line number Diff line change 88use RecursiveIteratorIterator ;
99use SavinMikhail \CommentsDensity \AnalyzeComments \Analyzer \AnalyzerFactory ;
1010use SavinMikhail \CommentsDensity \AnalyzeComments \Config \ConfigLoader ;
11- use SavinMikhail \CommentsDensity \AnalyzeComments \Config \DTO \ConfigDTO ;
12- use SavinMikhail \CommentsDensity \AnalyzeComments \Exception \CommentsDensityException ;
1311use SavinMikhail \CommentsDensity \AnalyzeComments \Formatter \ConsoleFormatter ;
14- use SavinMikhail \CommentsDensity \AnalyzeComments \Formatter \FormatterFactory ;
1512use SavinMikhail \CommentsDensity \AnalyzeComments \Formatter \HtmlFormatter ;
1613use SavinMikhail \CommentsDensity \Baseline \Storage \TreePhpBaselineStorage ;
1714use SplFileInfo ;
2219final class AnalyzeCommentCommand extends Command
2320{
2421 public function __construct (
25- private readonly ConfigLoader $ configLoader = new ConfigLoader (),
22+ private readonly ConfigLoader $ configLoader = new ConfigLoader (),
2623 private readonly TreePhpBaselineStorage $ storage = new TreePhpBaselineStorage (),
27- private readonly AnalyzerFactory $ analyzerFactory = new AnalyzerFactory (),
28- ?string $ name = null ,
29- )
30- {
24+ private readonly AnalyzerFactory $ analyzerFactory = new AnalyzerFactory (),
25+ ?string $ name = null ,
26+ ) {
3127 parent ::__construct ($ name );
3228 }
3329
Original file line number Diff line number Diff line change 66
77use SavinMikhail \CommentsDensity \AnalyzeComments \Config \DTO \ConfigDTO ;
88use SavinMikhail \CommentsDensity \AnalyzeComments \Exception \CommentsDensityException ;
9+
910use function defined ;
1011use function dirname ;
1112use function file_exists ;
13+
1214use const DIRECTORY_SEPARATOR ;
1315
1416final readonly class ConfigLoader
Original file line number Diff line number Diff line change 88use SavinMikhail \CommentsDensity \AnalyzeComments \Analyzer \DTO \Output \CommentDTO ;
99use SavinMikhail \CommentsDensity \AnalyzeComments \Analyzer \DTO \Output \CommentStatisticsDTO ;
1010use SavinMikhail \CommentsDensity \AnalyzeComments \Analyzer \DTO \Output \ComToLocDTO ;
11- use SavinMikhail \CommentsDensity \AnalyzeComments \Analyzer \DTO \Output \Report ;
1211use SavinMikhail \CommentsDensity \AnalyzeComments \Analyzer \DTO \Output \PerformanceMetricsDTO ;
12+ use SavinMikhail \CommentsDensity \AnalyzeComments \Analyzer \DTO \Output \Report ;
1313use Symfony \Component \Console \Helper \Table ;
1414use Symfony \Component \Console \Output \OutputInterface ;
15+
1516use function array_map ;
1617
1718final readonly class ConsoleFormatter implements FormatterInterface
Original file line number Diff line number Diff line change 55namespace SavinMikhail \CommentsDensity \AnalyzeComments \Formatter ;
66
77use SavinMikhail \CommentsDensity \AnalyzeComments \Analyzer \DTO \Output \Report ;
8+
89use function file_put_contents ;
910use function htmlspecialchars ;
1011use function nl2br ;
12+
1113use const ENT_QUOTES ;
1214use const ENT_SUBSTITUTE ;
1315
Original file line number Diff line number Diff line change 99use SavinMikhail \CommentsDensity \AnalyzeComments \Analyzer \DTO \Output \CdsDTO ;
1010use SavinMikhail \CommentsDensity \AnalyzeComments \Analyzer \DTO \Output \CommentStatisticsDTO ;
1111use SavinMikhail \CommentsDensity \AnalyzeComments \Comments \CommentFactory ;
12+
1213use function in_array ;
1314use function round ;
1415
Original file line number Diff line number Diff line change 66
77use SavinMikhail \CommentsDensity \AnalyzeComments \Analyzer \DTO \Output \CommentStatisticsDTO ;
88use SavinMikhail \CommentsDensity \AnalyzeComments \Analyzer \DTO \Output \ComToLocDTO ;
9+
910use function round ;
1011
1112final class ComToLoc
You can’t perform that action at this time.
0 commit comments