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

Sample rule #1

Closed
wants to merge 2 commits into from
Closed

Conversation

patrickkusebauch
Copy link

So, you cannot use the shim version if you want to use custom rules, see qossmic/deptrac#916.

Therefore I converted it to a standard composer installation. PHAR should work fine too as you can see in the linked ticket.

The rule itself is fairly simple, the only disadvantage is that you need to repeat the names of the PHP SPL exceptions inside the rule. Since they are well-known and fairly static, it does not seem too bad.

Basically

  • check that the reason for the dependency in the original case was an inheritance
  • check that the inheritance was from a PHP SPL library exception
  • If so, stop processing the event and don't count it as a dependency.

Feel free to ask me questions here.

@pckuijper
Copy link
Owner

Thanks for your input! This worked, I modified the script a little bit to make it work without magic strings and reference the classes directly and then also allow that specific class to have those dependencies as well.

Now I just have the challenge of implementing this inside our actual system, which is a bit tricky as we're still on an old version of symfony. But I guess using the PHAR will solve that issue then.

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