Skip to content

Comments

refactor: update dependencies and remove deprecated properties#136

Merged
gsteel merged 3 commits intolaminas:5.0.xfrom
mairo744:refactor/dep-analysis
Jul 29, 2025
Merged

refactor: update dependencies and remove deprecated properties#136
gsteel merged 3 commits intolaminas:5.0.xfrom
mairo744:refactor/dep-analysis

Conversation

@mairo744
Copy link

Q A
Documentation no
Bugfix no
BC Break no
New Feature no
RFC no
QA yes

Description

This PR adds composer-dependency-analyser to improve static analysis of unused or missing dependencies in the project.
I used maglnet/composer-require-checker, but I found that shipmonk-rnd/composer-dependency-analyser is more effective:

  • It is faster and easier to use
  • It reports more accurate dependency usage
image

During this process, I resolved the issues flagged by the tool and also updated some Composer dependencies to ensure compatibility and clean analysis results.

Added a conditional polyfill for the #[AllowDynamicProperties] attribute, which is only available in PHP 8.2+

  • Since laminas/laminas-hydrator support PHP 8.1, this attribute caused the analyser to fail
  • A CI-only polyfill is now loaded to satisfy the tool without affecting production code

"laminas/laminas-servicemanager": "^4.0",
"laminas/laminas-servicemanager": "^4.4.0",
"laminas/laminas-stdlib": "^3.20",
"psr/container": "^1.1",
Copy link
Author

Choose a reason for hiding this comment

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

I’m starting the process of upgrading to psr/container v2. At the moment, I’m unsure which specific library is blocking the upgrade, but my current suspicion is laminas/laminas-modulemanager, which appears to depend on the abandoned laminas/laminas-config.
image

Copy link
Author

Choose a reason for hiding this comment

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

Hi @gsteel,
Is it necessary for laminas/laminas-hydrator to depend on laminas/laminas-modulemanager?

It seems that laminas/laminas-modulemanager only provides default configuration for Laminas MVC applications.
image

Since Laminas MVC is being retired (announcement), would it make sense to decouple this dependency?

Copy link
Member

Choose a reason for hiding this comment

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

The laminas-modulemanager support can be removed. See: laminas/laminas-validator#384

@mairo744 mairo744 force-pushed the refactor/dep-analysis branch from 4fe1fc5 to 2401318 Compare July 24, 2025 15:56
Copy link
Member

@gsteel gsteel left a comment

Choose a reason for hiding this comment

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

Can you please drop module-manager stuff in a separate PR?

This makes it easier to formulate change-logs/migration docs etc.

Cheers 👍

@mairo744 mairo744 requested review from froschdesign and gsteel July 25, 2025 18:20
"laminas/laminas-modulemanager": "^2.17",
"laminas/laminas-serializer": "^3.0",
"laminas/laminas-servicemanager": "^4.0",
"laminas/laminas-servicemanager": "^4.4.0",
Copy link
Member

Choose a reason for hiding this comment

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

Making Laminas Service Manager a hard dep is the right thing to do - I hate soft deps, but, Hydrator ships a standalone container specifically to avoid installation of servicemanager, so I'm not sure this is ideal. WDYT @froschdesign?

mmalac added 3 commits July 29, 2025 20:40
Signed-off-by: mmalac <mmalac@sygic.com>
…alysis

Signed-off-by: mmalac <mmalac@sygic.com>
…itattributes

Signed-off-by: mmalac <mmalac@sygic.com>
@mairo744 mairo744 force-pushed the refactor/dep-analysis branch from ce59a03 to ebd4eb7 Compare July 29, 2025 18:45
Copy link
Member

@gsteel gsteel left a comment

Choose a reason for hiding this comment

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

Thanks @mairo744 - Let's merge this and defer the discussion about SMv4 as a hard dependency for later 👍

@gsteel gsteel added Enhancement Dependencies Updates and changes to dependencies QA Quality assurance tasks such as static analysis improvements labels Jul 29, 2025
@gsteel gsteel added this to the 5.0.0 milestone Jul 29, 2025
@gsteel gsteel self-assigned this Jul 29, 2025
@gsteel gsteel merged commit 623e492 into laminas:5.0.x Jul 29, 2025
32 of 33 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Dependencies Updates and changes to dependencies Enhancement QA Quality assurance tasks such as static analysis improvements

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants