Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed typo when checking if the field diffFile is empty. #99

Merged
merged 1 commit into from
May 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion PhpcsChanged/CliOptions.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,25 +267,25 @@
$options = [];
$options['report'] = $this->reporter;
$options['files'] = $this->files;
if ($this->phpcsStandard) {

Check failure on line 270 in PhpcsChanged/CliOptions.php

View workflow job for this annotation

GitHub Actions / PHP: 7.4 | Static analysis

RiskyTruthyFalsyComparison

PhpcsChanged/CliOptions.php:270:7: RiskyTruthyFalsyComparison: Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)
$options['standard'] = $this->phpcsStandard;
}
if ($this->phpcsExtensions) {

Check failure on line 273 in PhpcsChanged/CliOptions.php

View workflow job for this annotation

GitHub Actions / PHP: 7.4 | Static analysis

RiskyTruthyFalsyComparison

PhpcsChanged/CliOptions.php:273:7: RiskyTruthyFalsyComparison: Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)
$options['extensions'] = $this->phpcsExtensions;
}
if ($this->noVendorPhpcs) {
$options['no-vendor-phpcs'] = true;
}
if ($this->phpcsPath) {

Check failure on line 279 in PhpcsChanged/CliOptions.php

View workflow job for this annotation

GitHub Actions / PHP: 7.4 | Static analysis

RiskyTruthyFalsyComparison

PhpcsChanged/CliOptions.php:279:7: RiskyTruthyFalsyComparison: Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)
$options['phpcs-path'] = $this->phpcsPath;
}
if ($this->gitPath) {

Check failure on line 282 in PhpcsChanged/CliOptions.php

View workflow job for this annotation

GitHub Actions / PHP: 7.4 | Static analysis

RiskyTruthyFalsyComparison

PhpcsChanged/CliOptions.php:282:7: RiskyTruthyFalsyComparison: Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)
$options['git-path'] = $this->gitPath;
}
if ($this->catPath) {

Check failure on line 285 in PhpcsChanged/CliOptions.php

View workflow job for this annotation

GitHub Actions / PHP: 7.4 | Static analysis

RiskyTruthyFalsyComparison

PhpcsChanged/CliOptions.php:285:7: RiskyTruthyFalsyComparison: Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)
$options['cat-path'] = $this->catPath;
}
if ($this->svnPath) {

Check failure on line 288 in PhpcsChanged/CliOptions.php

View workflow job for this annotation

GitHub Actions / PHP: 7.4 | Static analysis

RiskyTruthyFalsyComparison

PhpcsChanged/CliOptions.php:288:7: RiskyTruthyFalsyComparison: Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)
$options['svn-path'] = $this->svnPath;
}
if ($this->debug) {
Expand Down Expand Up @@ -349,9 +349,9 @@
public function getExecutablePath(string $executableName): string {
switch ($executableName) {
case 'phpcs':
return $this->phpcsPath ?: getenv('PHPCS') ?: 'phpcs';

Check failure on line 352 in PhpcsChanged/CliOptions.php

View workflow job for this annotation

GitHub Actions / PHP: 7.4 | Static analysis

RiskyTruthyFalsyComparison

PhpcsChanged/CliOptions.php:352:12: RiskyTruthyFalsyComparison: Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)

Check failure on line 352 in PhpcsChanged/CliOptions.php

View workflow job for this annotation

GitHub Actions / PHP: 7.4 | Static analysis

RiskyTruthyFalsyComparison

PhpcsChanged/CliOptions.php:352:12: RiskyTruthyFalsyComparison: Operand of type false|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)
case 'git':
return $this->gitPath ?: getenv('GIT') ?: 'git';

Check failure on line 354 in PhpcsChanged/CliOptions.php

View workflow job for this annotation

GitHub Actions / PHP: 7.4 | Static analysis

RiskyTruthyFalsyComparison

PhpcsChanged/CliOptions.php:354:12: RiskyTruthyFalsyComparison: Operand of type null|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)

Check failure on line 354 in PhpcsChanged/CliOptions.php

View workflow job for this annotation

GitHub Actions / PHP: 7.4 | Static analysis

RiskyTruthyFalsyComparison

PhpcsChanged/CliOptions.php:354:12: RiskyTruthyFalsyComparison: Operand of type false|string contains type string, which can be falsy and truthy. This can cause possibly unexpected behavior. Use strict comparison instead. (see https://psalm.dev/356)
case 'cat':
return $this->catPath ?: getenv('CAT') ?: 'cat';
case 'svn':
Expand All @@ -366,7 +366,7 @@
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.');
}
}
Expand Down
Loading