Skip to content

Remove validation from Vat constructor and related test cleanup - #75

Merged
janlanger merged 3 commits into
masterfrom
copilot/vscode1755701916346
Aug 20, 2025
Merged

Remove validation from Vat constructor and related test cleanup#75
janlanger merged 3 commits into
masterfrom
copilot/vscode1755701916346

Conversation

Copilot AI commented Aug 20, 2025

Copy link
Copy Markdown
Contributor

This PR removes validation logic from the Vat constructor that was preventing negative amounts, along with cleaning up related test code and unused imports.

Changes made:

  1. Removed validation from Vat constructor: Eliminated Validator::checkNumberPositiveOrZero($amount) check that was throwing exceptions for negative amounts
  2. Cleaned up imports: Removed unused use SlevomatCsobGateway\Validator; import from Vat class
  3. Removed validation test: Deleted the testValidation() method from VatTest that was specifically testing the removed validation logic
  4. Cleaned up test imports: Removed unused use InvalidArgumentException; import from VatTest

The Vat class now accepts any integer amount value (including negative values) without validation, while maintaining all other functionality. The remaining tests continue to verify the core encoding behavior.


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI requested a review from janlanger August 20, 2025 15:01
@janlanger
janlanger marked this pull request as ready for review August 20, 2025 15:01
@janlanger

Copy link
Copy Markdown
Member

@copilot remove also test that tested the validation (VatTest)

Co-authored-by: janlanger <415695+janlanger@users.noreply.github.com>

Copilot AI commented Aug 20, 2025

Copy link
Copy Markdown
Contributor Author

@copilot remove also test that tested the validation (VatTest)

Removed the validation test method and unused InvalidArgumentException import from VatTest as requested. Commit: db12bb1

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5b5e3821314f947dd040c70f7992a64eac89025c
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/UPfrt4 /usr/bin/composer install (http block)
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/jcRCuz /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/PHPCSStandards/composer-installer/zipball/e9cf5e4bbf7eeaf9ef5db34938942602838fc2b1
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/UPfrt4 /usr/bin/composer install (http block)
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/jcRCuz /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/guzzle/psr7/zipball/c2270caaabe631b3b44c85f99e5a04bbb8060d16
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/UPfrt4 /usr/bin/composer install (http block)
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/jcRCuz /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/jcRCuz /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/jcRCuz /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/jcRCuz /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/jcRCuz /usr/bin/composer install --no-interaction (http block)
  • https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/UPfrt4 /usr/bin/composer install (http block)
    • Triggering command: /usr/bin/php8.3 -n -c /tmp/jcRCuz /usr/bin/composer install --no-interaction (http block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI changed the title [WIP] Remove validation from Vat constructor and unused Validator import Remove validation from Vat constructor and related test cleanup Aug 20, 2025
@janlanger
janlanger merged commit 9034d34 into master Aug 20, 2025
26 checks passed
@janlanger
janlanger deleted the copilot/vscode1755701916346 branch August 20, 2025 15:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants