Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[PROPOSAL] New laminas-servicemanager-inspector package #55

Closed
zakirullin opened this issue Jan 4, 2021 · 2 comments
Closed

[PROPOSAL] New laminas-servicemanager-inspector package #55

zakirullin opened this issue Jan 4, 2021 · 2 comments

Comments

@zakirullin
Copy link
Member

zakirullin commented Jan 4, 2021

Preface

It's no doubt that static analysis comes in handy in a variety of use cases nowadays.

Both ReflectionBasedAbstractFactory & AutowireFactory are quite well-demanded, even though its overall configuration is quite error prone, especially if one doesn't favour the AoT.

Problem

There are a few runtime defects possible now:

  • Circular dependency
  • Cyclic alias
  • Missing factory
  • Factory autoload failure
  • Unresolvable service/scalar
  • Scalar type/name mismatch
  • Many other scenarios of misconfiguration

Solution

Hereby I'm offering a new package, which is capable of addressing all the issues specified above statically.
Basically it's just a tool that uses $config['dependencies'] to tell us whether it's all good or not (with certain degree of confidence). It will also scan AST for all ContainerInterface::get() calls, to see whether all of them can be satisfied.

WIP

Scope of use

It would benefit current end-users of laminas-servicemanager, no matter if used with laminas-di/AoT or not.
Suitable for both laminas/mezzio-based applications.

As @Xerkus and @tux-rampage suggested it can be used by servicemanager as a dev dependency.

Maintaining

I'll be able to maintain the package once it's approved.

@zakirullin
Copy link
Member Author

zakirullin commented Jan 5, 2021

@Xerkus suggested to write a psalm plugin, and it's actually a better way to go.
We'll lose some flexibility as well as dependency-tree rendering (that we can easily sacrifice), for the sake of better maintainability.

We're back to a separate laminas/cli based command.

@zakirullin zakirullin changed the title [PROPOSAL] New servicemanager-inspector package [PROPOSAL] New laminas-psalm package Jan 5, 2021
@zakirullin zakirullin changed the title [PROPOSAL] New laminas-psalm package [PROPOSAL] New laminas-psalm-plugin package Jan 5, 2021
@zakirullin zakirullin changed the title [PROPOSAL] New laminas-psalm-plugin package [PROPOSAL] New laminas-servicemanager-inspector package Jan 10, 2021
@weierophinney
Copy link
Member

TSC has voted to accept this as of 2021-03-01!

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

No branches or pull requests

2 participants