Skip to content

Commit

Permalink
renamed hasDependency method
Browse files Browse the repository at this point in the history
  • Loading branch information
DeGraciaMathieu committed Dec 9, 2024
1 parent 9df62d5 commit aad21ea
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/Domain/Aggregators/DependencyAggregator.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ public function calculateInstability(): void
continue;
}

if ($otherClass->hasDependency($givenClass)) {
if ($otherClass->isDependentOn($givenClass)) {
$givenClass->incrementAfferent();
}
}
Expand Down
2 changes: 1 addition & 1 deletion app/Domain/Entities/ClassDependencies.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public function incrementAfferent(): void
$this->coupling->incrementAfferent();
}

public function hasDependency(ClassDependencies $otherClass): bool
public function isDependentOn(ClassDependencies $otherClass): bool
{
return $this->dependencies->knows($otherClass->fqcn);
}
Expand Down
4 changes: 2 additions & 2 deletions tests/Unit/Domain/Entities/ClassDependenciesTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
->withFqcn('C')
->build();

expect($classDependencies->hasDependency($c))->toBeFalse();
expect($classDependencies->isDependentOn($c))->toBeFalse();
});

test('it correctly checks if a class is a dependency', function () {
Expand All @@ -59,7 +59,7 @@
->withFqcn('B')
->build();

expect($classDependencies->hasDependency($b))->toBeTrue();
expect($classDependencies->isDependentOn($b))->toBeTrue();
});

test('it calculates the abstractness correctly', function () {
Expand Down

0 comments on commit aad21ea

Please sign in to comment.