Skip to content

Conversation

@AlessandroMinoccheri
Copy link
Member

@AlessandroMinoccheri AlessandroMinoccheri commented Aug 3, 2022

In this PR I added the possibility to filter components with shouldOnlyDependOnComponents function that generates a rule: DependsOnlyOnTheseNamespaces

This can fix some problems about issue #277

@codecov-commenter
Copy link

codecov-commenter commented Aug 3, 2022

Codecov Report

Merging #278 (1723cf5) into main (b41f577) will increase coverage by 0.07%.
The diff coverage is 100.00%.

@@             Coverage Diff              @@
##               main     #278      +/-   ##
============================================
+ Coverage     93.55%   93.62%   +0.07%     
- Complexity      367      370       +3     
============================================
  Files            57       57              
  Lines           977      988      +11     
============================================
+ Hits            914      925      +11     
  Misses           63       63              
Impacted Files Coverage Δ
src/RuleBuilders/Architecture/Architecture.php 100.00% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

/** @var array<string, string[]> */
private $allowedDependencies;
/** @var array<string, string[]> */
private $allowedSpecificDependencies;
Copy link
Collaborator

Choose a reason for hiding this comment

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

Cosa cambia tra le allowedDependencies e le allowedSpecificDependencies?

Copy link
Member Author

Choose a reason for hiding this comment

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

allowedDependencies is used for creating the rule NotDependsOnTheseNamespaces.
allowedSpecificDependencies is used for creating the rule DependsOnlyOnTheseNamespaces.

I don't like the design now but I would like to iterate on it later.
What do you think @pfazzi ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

Ok, I think the implementation is a bit misleading ATM. We should iterate over it, but it could lead to a breaking change.
Anyway in this step I would rename this variable to something more self-explaining, like componentDependsOnlyOnTheseNamespaces.

Copy link
Member Author

Choose a reason for hiding this comment

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

I agree with you @pfazzi.
I renamed the variable with your suggestion :)

@AlessandroMinoccheri AlessandroMinoccheri merged commit fab1940 into main Aug 9, 2022
@AlessandroMinoccheri AlessandroMinoccheri deleted the add-shouldOnlyDependOnComponents branch August 9, 2022 15:37
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.

4 participants