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
We are building our app as a modular monolith. We've defined a rule that each module can NOT depend on another module's namespace.
Rule::allClasses()
->that(newResideInOneOfTheseNamespaces($namespace))
->should(newNotDependsOnTheseNamespaces(...$otherModulesNamespaces)
->because('modules should NOT share code between each-other');
Each module can define its routes in a dedicated routes.php file in its directory where we use Laravel to define our routes with static calls to, for example, Route::post(). It means there is no class definition in the routes.php file.
Today after creating a second module, we received an error that our Controller in Module A depends on Module B when there's no import, static call, method call, or anything between the two. After a quick investigation, we've discovered a leak of the dependencies list in FileVisitor if one of the files has no class defined.
Current behavior
Arkitect reports violations:
App\DependenciesLeak\SecondModule\SomeClass has 1 violations
depends on App\DependenciesLeak\FirstModule\Router, but should not depend on these namespaces: App\DependenciesLeak\FirstModule because modules should be independent (on line 7)
Bug Report
Summary
We are building our app as a modular monolith. We've defined a rule that each module can NOT depend on another module's namespace.
Each module can define its routes in a dedicated
routes.php
file in its directory where we use Laravel to define our routes with static calls to, for example,Route::post()
. It means there is no class definition in theroutes.php
file.Today after creating a second module, we received an error that our Controller in Module A depends on Module B when there's no import, static call, method call, or anything between the two. After a quick investigation, we've discovered a leak of the
dependencies
list inFileVisitor
if one of the files has no class defined.Current behavior
Arkitect reports violations:
How to reproduce
Please see #388 for the code snippets.
Expected behavior
No violations are reported and
dependencies
are not leaked between filesThe text was updated successfully, but these errors were encountered: