Skip to content

Commit

Permalink
[0.x] Add mare to ci (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
imdhemy committed Jul 20, 2024
1 parent db97725 commit fc85a2a
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 4 deletions.
6 changes: 5 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ jobs:
run: "composer cs-check"
if: matrix.operating-system == 'ubuntu-latest'

- name: "Static code analysis"
- name: "Psalm Static Analysis"
run: "composer psalm"
if: matrix.operating-system == 'ubuntu-latest'

- name: "Mare Static Analysis"
run: "composer mare"
if: matrix.operating-system == 'ubuntu-latest'
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"psalm": "vendor/bin/psalm --no-cache",
"psalm-t": "vendor/bin/psalm --no-cache --output-format=compact",
"cs-check": "vendor/bin/php-cs-fixer fix --dry-run --diff --verbose",
"cs-fix": "php-cs-fixer fix --verbose"
"cs-fix": "php-cs-fixer fix --verbose",
"mare": "./bin/run scan"
},
"bin": [
"bin/run"
Expand Down
2 changes: 1 addition & 1 deletion src/Console/ConfigFinder.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ class ConfigFinder
*/
public function find(string $configOption, string $workDir): Config
{
$configPath = empty($configOption) ? $workDir.'/.mare_scan.php' : $configOption;
$configPath = '' === $configOption ? $workDir.'/.mare_scan.php' : $configOption;

if (! file_exists($configPath)) {
throw ConfigNotFoundException::create($configPath);
Expand Down
2 changes: 1 addition & 1 deletion src/Console/ScanCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ protected function execute(InputInterface $input, OutputInterface $output): int

$progressBar->finish();

return empty($result) ? $this->exitSuccess() : $this->exitError($result);
return 0 === count($result) ? $this->exitSuccess() : $this->exitError($result);
}

private function findConfiguration(InputInterface $input): Config
Expand Down

0 comments on commit fc85a2a

Please sign in to comment.