Update composer Q2-2025 [PHPSTAN v2, Rector V2] #43
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request includes updates to streamline CI workflows, enhance type safety with PHPStan assertions, and improve compatibility by upgrading dependencies. Additionally, it introduces new helper scripts and refactors existing code for better maintainability and clarity.
CI Workflow Updates:
.github/workflows/ci.yml
: Updated script commands for CI jobs to use consistent naming conventions (e.g.,composer run phpstan:check
instead ofcomposer run phpstan
).Dependency Upgrades:
composer.json
: Upgraded dependencies to support newer versions, includingbeberlei/assert
(^2.0 || ^3.0
),phpunit/phpunit
(^11.0 || ^12.0
), andphpstan/phpstan
(^2.0
). Addedphpstan/phpstan-beberlei-assert
for enhanced PHPStan integration. [1] [2]Helper Scripts:
composer.json
: Refactored and added new composer scripts, such asrun:all
andtest:all
, to simplify running multiple checks and tests. Introduced platform configuration for PHP version8.2.28
.Type Safety Enhancements:
src/CXml/Builder/OrderRequestBuilder.php
: Added PHPStan assertions to validate input types for methods likeshipTo
,tax
, andaddBusinessPartner
. Ensured stricter type checks for array keys and values. [1] [2] [3]src/CXml/Builder/ProductActivityMessageBuilder.php
: Incorporated assertions to validate extrinsics keys and values as strings.Codebase Refactoring:
rector.php
: Changed the cache directory path to/tmp/rector-cxml-php
for better namespace clarity.src/CXml/Jms/CXmlWrappingNodeJmsEventSubscriber.php
: Improved handling of serialization and deserialization events, including type checks and early returns for invalid inputs. [1] [2]