You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think that could be useful require that a specific function must be called only inside a specific Class (wrapper).
For example:
I would like that json_encode(..) and json_encode(..) functions not be called outside of my JsonHelper class wrapper because i want encapsulate my json serialization / deserialization logic inside JsonHelper.
PS
I don't known how we could express this rules, because we may need a new exception clause (not a php exception) to apply to Rule::allClasses() that at this time does not exists (I believe).
See the ->except(..) and NotHaveDependencyWithTheseMethods clauses below, please.
@ricfio would you mind create a different issue for "except"? Is something we discussed earlier and, at that time, we decided to not include it in the DSL. Main reason: ->except could be interpreted as a way to
exclude classes from being evaluated (allClasses -> except)
exclude classes from the that clause (that(ResideInOneOfTheseNamespaces) -> except)
exclude classes from the should clause (should(NotHaveDependenciesOutside) -> except)
Feature Request
Summary
I think that could be useful require that a specific function must be called only inside a specific Class (wrapper).
For example:
I would like that
json_encode(..)
andjson_encode(..)
functions not be called outside of myJsonHelper
class wrapper because i want encapsulate my json serialization / deserialization logic insideJsonHelper
.PS
I don't known how we could express this rules, because we may need a new exception clause (not a php exception) to apply to
Rule::allClasses()
that at this time does not exists (I believe).See the
->except(..)
andNotHaveDependencyWithTheseMethods
clauses below, please.If there will be interest on the two above proposals we can split this issue in two separated issues (srp solid principles).
The text was updated successfully, but these errors were encountered: