Hi I've just installed the module and tried command line validation. (ver.2.4.7)
root@deploy:/app# bin/magento vat:validate BE 0402206045
Success is: 1, with service RegExp
There is an error in /app/vendor/symfony/console/Command/Command.php at line: 329
Return value of "Dutchento\Vatfallback\Console\Command\Validate\Interceptor::execute()" must be of the type int, "null" returned.#0 /app/vendor/magento/framework/Interception/Interceptor.php(58): Symfony\Component\Console\Command\Command->run(Object(Symfony\Component\Console\Input\ArgvInput), Object(Symfony\Component\Console\Output\ConsoleOutput))
...
and possible fix can be:
diff --git a/vendor/dutchento/m2-vatfallback/Console/Command/Validate.php b/vendor/dutchento/m2-vatfallback/Console/Command/Validate.php
index 3e1f4ce6..dff958c1 100644
--- a/vendor/dutchento/m2-vatfallback/Console/Command/Validate.php
+++ b/vendor/dutchento/m2-vatfallback/Console/Command/Validate.php
@@ -11,6 +11,7 @@ namespace Dutchento\Vatfallback\Console\Command;
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;
@@ -52,11 +53,15 @@ class Validate extends Command
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;
}
}
Hi I've just installed the module and tried command line validation. (ver.2.4.7)
and possible fix can be:
please review, thanks!