File tree Expand file tree Collapse file tree 3 files changed +12
-14
lines changed
Expand file tree Collapse file tree 3 files changed +12
-14
lines changed Original file line number Diff line number Diff line change @@ -10,7 +10,6 @@ parameters:
1010 - src/Config/Routes.php
1111 - src/Views/*
1212 ignoreErrors:
13- - '#Cannot access property [\$a-z_]+ on (array|object)#'
1413 - '#Unsafe usage of new static\(\)*#'
1514 universalObjectCratesClasses:
1615 - CodeIgniter\Entity
Original file line number Diff line number Diff line change 2222*
2323***/
2424
25- use CodeIgniter \Config \ BaseConfig ;
25+ use CodeIgniter \Session \ Session ;
2626use CodeIgniter \View \RendererInterface ;
2727use Config \Services ;
28+ use Tatter \Alerts \Config \Alerts as AlertsConfig ;
2829use Tatter \Alerts \Exceptions \AlertsException ;
2930
3031/*** CLASS ***/
@@ -34,7 +35,7 @@ class Alerts
3435 /**
3536 * Our configuration instance.
3637 *
37- * @var \Tatter\Alerts\Config\Alerts
38+ * @var AlertsConfig
3839 */
3940 protected $ config ;
4041
@@ -48,12 +49,12 @@ class Alerts
4849 /**
4950 * The active user session, for loading and storing alerts.
5051 *
51- * @var \CodeIgniter\Session\ Session
52+ * @var Session
5253 */
5354 protected $ session ;
5455
5556 // initiate library, check for existing session
56- public function __construct (BaseConfig $ config , RendererInterface $ view = null )
57+ public function __construct (AlertsConfig $ config , RendererInterface $ view = null )
5758 {
5859 // save configuration
5960 $ this ->config = $ config ;
Original file line number Diff line number Diff line change 11<?php namespace Tatter \Alerts \Config ;
22
33use CodeIgniter \View \RendererInterface ;
4+ use Config \Services as BaseServices ;
5+ use Tatter \Alerts \Alerts ;
6+ use Tatter \Alerts \Config \Alerts as AlertsConfig ;
47
5- class Services extends \ Config \Services
8+ class Services extends BaseServices
69{
7- public static function alerts (BaseConfig $ config = null , RendererInterface $ view = null , bool $ getShared = true )
10+ public static function alerts (AlertsConfig $ config = null , RendererInterface $ view = null , bool $ getShared = true )
811 {
912 if ($ getShared )
1013 {
1114 return static ::getSharedInstance ('alerts ' , $ config , $ view );
1215 }
1316
14- // If no config was injected then load one
15- // Prioritizes app/Config if found
16- if (empty ($ config ))
17- {
18- $ config = config ('Alerts ' );
19- }
17+ $ config = $ config ?? config ('Alerts ' );
2018
21- return new \ Tatter \ Alerts \ Alerts ($ config , $ view );
19+ return new Alerts ($ config , $ view );
2220 }
2321}
You can’t perform that action at this time.
0 commit comments