Skip to content

Commit

Permalink
return result value
Browse files Browse the repository at this point in the history
  • Loading branch information
kimb0na authored and peterjaap committed Oct 16, 2024
1 parent 14ec70c commit b87ebb3
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions Console/Command/Validate.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@

use Dutchento\Vatfallback\Service\Exceptions\NoValidationException;
use Dutchento\Vatfallback\Service\ValidateVatInterface;
use Magento\Framework\Console\Cli;
use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
Expand Down Expand Up @@ -52,11 +53,14 @@ protected function execute(

if ($result['result']) {
$output->writeln("Success is: {$result['result']}, with service {$result['service']}");
return Cli::RETURN_SUCCESS;
} else {
$output->writeln("Invalid VAT number, with service {$result['service']}");
return Cli::RETURN_FAILURE;
}
} catch (NoValidationException $exception) {
$output->writeln("No validation took place");
return Cli::RETURN_FAILURE;
}
}

Expand Down

0 comments on commit b87ebb3

Please sign in to comment.