Skip to content

Commit

Permalink
Merge pull request #44 from codenamephp/master
Browse files Browse the repository at this point in the history
5.1.1
  • Loading branch information
bastianschwarz authored Nov 14, 2020
2 parents 79d9225 + 51d9c8e commit f40eabc
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ public function get() : array {
public function add(iDefinitionsProvider $provider) : iCollection {
if($provider instanceof iDependsOn) {
foreach($provider->getDependencies() as $dependencyClassname) {
if(!in_array($dependencyClassname, $this->getAddedProviderClassnames(), true)) $this->add($this->getByClassnameProviderFactory()->build($dependencyClassname));
if($this->providerWasNotYetAdded($dependencyClassname)) $this->add($this->getByClassnameProviderFactory()->build($dependencyClassname));
}
}

Expand All @@ -102,4 +102,7 @@ public function add(iDefinitionsProvider $provider) : iCollection {
return $this;
}

}
private function providerWasNotYetAdded(string $dependencyClassname) : bool {
return !in_array($dependencyClassname, $this->getAddedProviderClassnames(), true);
}
}

0 comments on commit f40eabc

Please sign in to comment.