Skip to content

Commit

Permalink
Force lowercase service names. Fixes codeigniter4#2534
Browse files Browse the repository at this point in the history
  • Loading branch information
MGatner committed Feb 17, 2020
1 parent a6bb348 commit 5b80574
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions system/Config/BaseService.php
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ class BaseService
/**
* Cache for instance of any services that
* have been requested as a "shared" instance.
* Keys should be lowercase service names.
*
* @var array
*/
Expand Down Expand Up @@ -106,6 +107,8 @@ class BaseService
*/
protected static function getSharedInstance(string $key, ...$params)
{
$key = strtolower($key);

// Returns mock if exists
if (isset(static::$mocks[$key]))
{
Expand Down

0 comments on commit 5b80574

Please sign in to comment.