Skip to content

2.5 release - Linting and tests#85

Merged
DaanRijpkema merged 41 commits into
masterfrom
linting-and-tests
Jun 30, 2026
Merged

2.5 release - Linting and tests#85
DaanRijpkema merged 41 commits into
masterfrom
linting-and-tests

Conversation

@daanrijpkemacb

@daanrijpkemacb daanrijpkemacb commented Nov 10, 2024

Copy link
Copy Markdown
Collaborator

No description provided.

@daanrijpkemacb daanrijpkemacb force-pushed the linting-and-tests branch 2 times, most recently from 0d4f57f to dd5587f Compare November 10, 2024 14:09
daanrijpkemacb and others added 28 commits June 29, 2026 15:52
- Introduced `setPaymentMethodToBancontact` method in `PaymentBluemRequest.php`.
- Updated `PaymentsContext.php` to include `PAYMENT_METHOD_BANCONTACT`.
- Added `isBancontact` method to check if the current payment method is Bancontact.
- Updated `README.md` to document the new Bancontact support.
…cies

- Updated the minimum PHP version requirement to 8.3 in composer.json and README.md.
- Bumped rector/rector to version 2.4 and updated related dependencies.
- Removed deprecated Magento coding standard dependency from composer.json.
- Updated README to reflect the new versioning and requirements.

This change ensures compatibility with PHP 8.3 and prepares the library for future enhancements.
… consistency

- Introduced strict types declaration across multiple files to enforce type safety.
- Updated variable declarations to use `readonly` where applicable for better immutability.
- Enhanced string formatting using `sprintf` for improved readability and consistency.
- Refined exception handling to use more descriptive variable names.

This change aims to enhance code quality and maintainability, ensuring a more robust implementation.
…ng across multiple files

This commit addresses inconsistencies in code formatting, including spacing around operators and method definitions. The changes enhance code readability and maintainability. No functional changes were made.

Testing was conducted to ensure that all existing functionalities remain intact after the formatting adjustments.
- Upgraded PHPUnit to version 11 in CI configuration.
- Set PHP platform version to 8.3 in composer.json for compatibility.
- Adjusted dependencies in composer.lock to align with new requirements.
…ecks

This commit introduces a new Makefile target for setting up Git hooks and adds a pre-commit script that runs unit tests when PHP files are modified. This ensures that tests are executed automatically, improving code quality and reducing the chances of introducing errors.
…operties

Refactor properties in various BluemResponse classes to nullable types to enhance type safety and prevent potential null reference errors. This change ensures that the application can handle cases where these properties may not be set, improving overall robustness.
… environment and return status values

- Introduced a new Constants class to centralize environment and expected return status definitions.
- Updated BluemConfigurationValidator to utilize these constants, enhancing code readability and maintainability.
…tes for Unit, Integration, and Acceptance tests

- Adjusted phpunit.xml to define distinct test suites for better organization and clarity.
- Enhanced Makefile to facilitate running all tests in one command, improving developer efficiency.
Added CurlHttpTransport class to handle HTTP requests using cURL, implementing the HttpTransportInterface. This allows for better encapsulation of HTTP transport logic and error handling. Updated Bluem class to utilize the new transport mechanism, enhancing the overall architecture.

Testing was conducted to ensure that the new transport layer correctly handles responses and errors.
Extracted the FakeHttpTransport class from BluemTest.php into its own file, enhancing code organization and maintainability. This change allows for easier testing and potential reuse of the FakeHttpTransport in other test cases.
…ructor type hints

- Introduced a new property `paymentBrandID` in `BluemConfiguration` for better configuration management.
- Updated constructor type hints in `BluemRequest` and `PaymentStatusBluemRequest` to use `BluemConfiguration` explicitly.
- Enhanced error handling in `BluemResponse` and `BluemConfigurationValidator` for improved clarity.

This change aims to streamline the configuration process and enhance type safety across the Bluem integration.
Modified constructors in multiple BluemRequest classes to allow for BluemConfiguration or stdClass as the configuration parameter. This change enhances flexibility in handling different configuration types across requests.
- Changed copyright year from 2023 to 2026 in all relevant files.
- Refactored constructor syntax in several classes to use single-line format.
- Adjusted array formatting for consistency across various files.
- Cleaned up unnecessary line breaks and improved readability in multiple classes.
… and certificate management

- Enhanced the validate method to streamline error handling and improve readability.
- Introduced separate methods to determine the appropriate certificate based on the current date and environment.
- Updated logic for determining the filename of the certificate to accommodate future certificates.
- Improved exception handling for loading keys and verifying signatures.
…and consistency

- Adjusted visibility and formatting of properties and methods in the Bluem class.
- Enhanced error handling in the BluemConfigurationValidator for missing environment configuration.
- Updated the Webhook class for consistent property visibility and formatting.
- Added unit test for creating a PaymentBluemRequest in BluemPaymentsTest.
- Refactored BluemTest to use createStub instead of createMock for better test clarity.
- Removed unused helper methods in BluemTest to streamline the test class.
Comment thread src/Bluem.php Outdated
Comment thread src/Bluem.php Outdated
Comment thread src/Constants.php Outdated
Comment thread src/Constants.php
Comment thread src/Constants.php
Comment thread src/Webhook.php Outdated
Comment thread src/Webhook.php Outdated
Comment thread src/Webhook.php Outdated
Comment thread src/Webhook.php Outdated
Comment thread tests/Integration/IdentityRequestTest.php Outdated

@DaanRijpkema DaanRijpkema left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Environment constants
Duplicated in report identity
Remove unnecessary commented code
One more sweep should be enough

@DaanRijpkema DaanRijpkema changed the title Linting and tests 2.5 release - Linting and tests Jun 29, 2026
@DaanRijpkema DaanRijpkema merged commit 3c4676b into master Jun 30, 2026
3 checks passed
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