From 3811a963017a3388677be7e96dc915e3d732cf7c Mon Sep 17 00:00:00 2001 From: Dmitriy Konstantinov Date: Thu, 23 May 2024 19:24:41 +0300 Subject: [PATCH] Fixed typo when checking if the field `diffFile` is empty. (#99) After moving the option to `CliOptions` in commit d7eb1168f5d4054, the field `diff` was renamed to `diffFile`, which caused a bug in the handler for the `--diff` argument. --- PhpcsChanged/CliOptions.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/PhpcsChanged/CliOptions.php b/PhpcsChanged/CliOptions.php index 12980ee..1517ca2 100644 --- a/PhpcsChanged/CliOptions.php +++ b/PhpcsChanged/CliOptions.php @@ -366,7 +366,7 @@ public function validate(): void { throw new InvalidOptionException('You must use either automatic or manual mode.'); } if ($this->mode === Modes::MANUAL) { - if (empty($this->diff) || empty($this->phpcsUnmodified) || empty($this->phpcsModified)) { + if (empty($this->diffFile) || empty($this->phpcsUnmodified) || empty($this->phpcsModified)) { throw new InvalidOptionException('Manual mode requires a diff, the unmodified file phpcs output, and the modified file phpcs output.'); } }