- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 48
 
Open
Description
Feature Request
I would enforce a rule on a deprecated namespace.
| Q | A | 
|---|---|
| New Feature | yes | 
| RFC | yes | 
| BC Break | no | 
Summary
I would like to have a DSL like this:
Rule::noClass()
  ->should(new ResideInOneOfTheseNamespaces(
      "Prima\Service",
      "Prima\Entity"
  ))->because("Those namespaces have been deprecated in favor of the new modular architecture");This rule is already implementable in the following way:
Rule::allClasses()
  ->that(new ResideInOneOfTheseNamespaces(
      "Prima\Service",
      "Prima\Entity"
  ))->should(
      new NotResideInTheseNamespaces(
          "Prima\Service",
          "Prima\Entity"
      )
  )->because("Those namespaces have been deprecated in favor of the new modular architecture");But it looks awkward to me to read.
Furthermore, it would be easier to express rules like the following:
Rule::noClass()
  ->should(new HaveNameMatching("*Manager"))
  ->because("of our naming convention services should be named with a more self-explanatory name");What do you think?
Metadata
Metadata
Assignees
Labels
No labels