Skip to content

Commit

Permalink
Fixed issue where all service providers were registered regardless of…
Browse files Browse the repository at this point in the history
… whether they need to be
  • Loading branch information
philipobenito committed Sep 21, 2018
1 parent 4264532 commit a6c52d7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Expand Up @@ -2,6 +2,11 @@

All Notable changes to `League\Container` will be documented in this file

## 3.2.1

### Fixed
- Fixed issue where all service providers were registered regardless of whether they need to be.

## 3.2.0

### Added
Expand Down
7 changes: 4 additions & 3 deletions src/ServiceProvider/ServiceProviderAggregate.php
Expand Up @@ -93,9 +93,10 @@ public function register(string $service)
return;
}

$provider->register();

$this->registered[] = $provider->getIdentifier();
if ($provider->provides($service)) {
$provider->register();
$this->registered[] = $provider->getIdentifier();
}
}
}
}

0 comments on commit a6c52d7

Please sign in to comment.