3131final class ChangelogCheckCommand extends AbstractCommand
3232{
3333 /**
34- * @param Filesystem|null $filesystem
35- * @param UnreleasedEntryCheckerInterface|null $unreleasedEntryChecker
34+ * Initializes the command with necessary dependencies.
35+ *
36+ * @param Filesystem $filesystem filesystem instance for file operations
37+ * @param UnreleasedEntryCheckerInterface $unreleasedEntryChecker checker for pending unreleased entries in the changelog
3638 */
3739 public function __construct (
38- ? Filesystem $ filesystem = null ,
39- private readonly ? UnreleasedEntryCheckerInterface $ unreleasedEntryChecker = null ,
40+ Filesystem $ filesystem = new Filesystem () ,
41+ private readonly UnreleasedEntryCheckerInterface $ unreleasedEntryChecker = new UnreleasedEntryChecker () ,
4042 ) {
4143 parent ::__construct ($ filesystem );
4244 }
@@ -60,14 +62,16 @@ protected function configure(): void
6062 }
6163
6264 /**
63- * @param InputInterface $input
64- * @param OutputInterface $output
65+ * Executes the command to check for pending unreleased changes in the changelog.
66+ *
67+ * @param InputInterface $input the input interface for command arguments and options
68+ * @param OutputInterface $output the output interface for writing command output
6569 *
66- * @return int
70+ * @return int exit code indicating success (0) or failure (1)
6771 */
6872 protected function execute (InputInterface $ input , OutputInterface $ output ): int
6973 {
70- $ hasPendingChanges = ( $ this ->unreleasedEntryChecker ?? new UnreleasedEntryChecker ())
74+ $ hasPendingChanges = $ this ->unreleasedEntryChecker
7175 ->hasPendingChanges ($ this ->getCurrentWorkingDirectory (), $ input ->getOption ('against ' ));
7276
7377 if ($ hasPendingChanges ) {
0 commit comments