Skip to content

Commit

Permalink
Auto require namespaces in quality
Browse files Browse the repository at this point in the history
  • Loading branch information
kayw-geek committed Aug 1, 2023
1 parent 8f4d5e1 commit a6ed57b
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Binary file removed .DS_Store
Binary file not shown.
12 changes: 4 additions & 8 deletions src/Command/RunCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,14 @@ private static function getChangedFilesString(): ?string
{
exec("git status -s | grep -v 'D' | awk '{print $2}'", $exec_output);

if ($exec_output === '') {
return null;
}

return implode(' ', $exec_output);
}

private function executeRun(array $active_options, InputInterface $input, OutputInterface $output): int
{
$changed_files_string = self::getChangedFilesString();

if ($changed_files_string === null) {
if ($changed_files_string === '') {
return self::SUCCESS;
}

Expand Down Expand Up @@ -126,18 +122,18 @@ private function getPath(): string
private function runPhpCsFixerFix(OutputInterface $output, string $change_files_string): int
{
if (!$this->checkBinInstall(self::PHPCSFIXER_BIN_NAME)) {
$output->writeln('<error> The PHPCsFixer packages not install in your project</error>');
$output->writeln('<error> The PHPCSFixer packages not install in your project</error>');

return self::FAILURE;
}

if (!$this->checkPhpCsFixerConfigFileExist()) {
$output->writeln('<error> The PHPCsFixer config file not found on your project </error>');
$output->writeln('<error> The PHPCSFixer config file not found on your project </error>');

return self::FAILURE;
}

$output->writeln('<info> PHP Cs Fixer Fixing ... </info>');
$output->writeln('<info> PHP CS Fixer Fixing ... </info>');
$base_path = $this->getPath();
exec("$base_path/vendor/bin/php-cs-fixer fix --config $base_path/$this->phpCsFixerConfig $change_files_string", $execute_output, $result_code);

Expand Down

0 comments on commit a6ed57b

Please # to comment.