Skip to content

Commit

Permalink
Bugfix use app Services
Browse files Browse the repository at this point in the history
  • Loading branch information
MGatner committed Jun 3, 2020
1 parent ff6bf11 commit 08637a1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/Alerts.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,8 @@
***/

use CodeIgniter\Config\BaseConfig;
use CodeIgniter\Config\Services;
use CodeIgniter\View\RendererInterface;
use Config\Services;
use Tatter\Alerts\Exceptions\AlertsException;

/*** CLASS ***/
Expand Down
10 changes: 6 additions & 4 deletions src/Config/Services.php
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
<?php namespace Tatter\Alerts\Config;

use CodeIgniter\Config\BaseService;
use CodeIgniter\View\RendererInterface;

class Services extends BaseService
class Services extends \Config\Services
{
public static function alerts(BaseConfig $config = null, RendererInterface $view = null, bool $getShared = true)
{
if ($getShared):
if ($getShared)
{
return static::getSharedInstance('alerts', $config, $view);
endif;
}

// If no config was injected then load one
// Prioritizes app/Config if found
if (empty($config))
{
$config = config('Alerts');
}

return new \Tatter\Alerts\Alerts($config, $view);
}
Expand Down

0 comments on commit 08637a1

Please sign in to comment.