Skip to content

Commit 8375e4c

Browse files
committed
add bool type hint for getShared parameter
1 parent 1339d75 commit 8375e4c

3 files changed

Lines changed: 23 additions & 23 deletions

File tree

system/Config/BaseService.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ protected static function getSharedInstance(string $key, ...$params)
128128
*
129129
* @return \CodeIgniter\Autoloader\FileLocator
130130
*/
131-
public static function locator($getShared = true)
131+
public static function locator(bool $getShared = true)
132132
{
133133
if ($getShared)
134134
{

system/Config/Services.php

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ class Services extends BaseService
6767
*
6868
* @return \CodeIgniter\Autoloader\Autoloader
6969
*/
70-
public static function autoloader($getShared = true)
70+
public static function autoloader(bool $getShared = true)
7171
{
7272
if ($getShared)
7373
{
@@ -88,7 +88,7 @@ public static function autoloader($getShared = true)
8888
*
8989
* @return \CodeIgniter\Cache\CacheInterface
9090
*/
91-
public static function cache(\Config\Cache $config = null, $getShared = true)
91+
public static function cache(\Config\Cache $config = null, bool $getShared = true)
9292
{
9393
if ($getShared)
9494
{
@@ -114,7 +114,7 @@ public static function cache(\Config\Cache $config = null, $getShared = true)
114114
*
115115
* @return \CodeIgniter\HTTP\CLIRequest
116116
*/
117-
public static function clirequest(\Config\App $config = null, $getShared = true)
117+
public static function clirequest(\Config\App $config = null, bool $getShared = true)
118118
{
119119
if ($getShared)
120120
{
@@ -142,7 +142,7 @@ public static function clirequest(\Config\App $config = null, $getShared = true)
142142
*
143143
* @return \CodeIgniter\HTTP\CURLRequest
144144
*/
145-
public static function curlrequest(array $options = [], $response = null, \Config\App $config = null, $getShared = true) {
145+
public static function curlrequest(array $options = [], $response = null, \Config\App $config = null, bool $getShared = true) {
146146
if ($getShared === true)
147147
{
148148
return self::getSharedInstance('curlrequest', $options, $response, $config);
@@ -176,7 +176,7 @@ public static function curlrequest(array $options = [], $response = null, \Confi
176176
*
177177
* @return \CodeIgniter\Email\Email|mixed
178178
*/
179-
public static function email($config = null, $getShared = true)
179+
public static function email($config = null, bool $getShared = true)
180180
{
181181
if ($getShared)
182182
{
@@ -249,7 +249,7 @@ public static function exceptions(
249249
*
250250
* @return \CodeIgniter\Filters\Filters
251251
*/
252-
public static function filters($config = null, $getShared = true)
252+
public static function filters($config = null, bool $getShared = true)
253253
{
254254
if ($getShared)
255255
{
@@ -276,7 +276,7 @@ public static function filters($config = null, $getShared = true)
276276
*
277277
* @return \CodeIgniter\Images\Handlers\BaseHandler
278278
*/
279-
public static function image(string $handler = null, $config = null, $getShared = true)
279+
public static function image(string $handler = null, $config = null, bool $getShared = true)
280280
{
281281
if ($getShared)
282282
{
@@ -326,7 +326,7 @@ public static function iterator($getShared = true)
326326
*
327327
* @return \CodeIgniter\Language\Language
328328
*/
329-
public static function language(string $locale = null, $getShared = true)
329+
public static function language(string $locale = null, bool $getShared = true)
330330
{
331331
if ($getShared)
332332
{
@@ -395,7 +395,7 @@ public static function migrations(BaseConfig $config = null, ConnectionInterface
395395
*
396396
* @return \CodeIgniter\HTTP\Negotiate
397397
*/
398-
public static function negotiator(\CodeIgniter\HTTP\RequestInterface $request = null, $getShared = true)
398+
public static function negotiator(\CodeIgniter\HTTP\RequestInterface $request = null, bool $getShared = true)
399399
{
400400
if ($getShared)
401401
{
@@ -420,7 +420,7 @@ public static function negotiator(\CodeIgniter\HTTP\RequestInterface $request =
420420
*
421421
* @return \CodeIgniter\Pager\Pager
422422
*/
423-
public static function pager($config = null, RendererInterface $view = null, $getShared = true)
423+
public static function pager($config = null, RendererInterface $view = null, bool $getShared = true)
424424
{
425425
if ($getShared)
426426
{
@@ -451,7 +451,7 @@ public static function pager($config = null, RendererInterface $view = null, $ge
451451
*
452452
* @return \CodeIgniter\View\Parser
453453
*/
454-
public static function parser($viewPath = APPPATH.'Views/', $config = null, $getShared = true)
454+
public static function parser($viewPath = APPPATH.'Views/', $config = null, bool $getShared = true)
455455
{
456456
if ($getShared)
457457
{
@@ -479,7 +479,7 @@ public static function parser($viewPath = APPPATH.'Views/', $config = null, $get
479479
*
480480
* @return \CodeIgniter\View\View
481481
*/
482-
public static function renderer($viewPath = APPPATH.'Views/', $config = null, $getShared = true)
482+
public static function renderer($viewPath = APPPATH.'Views/', $config = null, bool $getShared = true)
483483
{
484484
if ($getShared)
485485
{
@@ -504,7 +504,7 @@ public static function renderer($viewPath = APPPATH.'Views/', $config = null, $g
504504
*
505505
* @return \CodeIgniter\HTTP\IncomingRequest
506506
*/
507-
public static function request(\Config\App $config = null, $getShared = true)
507+
public static function request(\Config\App $config = null, bool $getShared = true)
508508
{
509509
if ($getShared)
510510
{
@@ -534,7 +534,7 @@ public static function request(\Config\App $config = null, $getShared = true)
534534
*
535535
* @return \CodeIgniter\HTTP\Response
536536
*/
537-
public static function response(\Config\App $config = null, $getShared = true)
537+
public static function response(\Config\App $config = null, bool $getShared = true)
538538
{
539539
if ($getShared)
540540
{
@@ -559,7 +559,7 @@ public static function response(\Config\App $config = null, $getShared = true)
559559
*
560560
* @return \CodeIgniter\HTTP\Response
561561
*/
562-
public static function redirectResponse(\Config\App $config = null, $getShared = true)
562+
public static function redirectResponse(\Config\App $config = null, bool $getShared = true)
563563
{
564564
if ($getShared)
565565
{
@@ -609,7 +609,7 @@ public static function routes($getShared = true)
609609
*
610610
* @return \CodeIgniter\Router\Router
611611
*/
612-
public static function router(\CodeIgniter\Router\RouteCollectionInterface $routes = null, $getShared = true)
612+
public static function router(\CodeIgniter\Router\RouteCollectionInterface $routes = null, bool $getShared = true)
613613
{
614614
if ($getShared)
615615
{
@@ -635,7 +635,7 @@ public static function router(\CodeIgniter\Router\RouteCollectionInterface $rout
635635
*
636636
* @return \CodeIgniter\Security\Security
637637
*/
638-
public static function security(\Config\App $config = null, $getShared = true)
638+
public static function security(\Config\App $config = null, bool $getShared = true)
639639
{
640640
if ($getShared)
641641
{
@@ -658,7 +658,7 @@ public static function security(\Config\App $config = null, $getShared = true)
658658
*
659659
* @return \CodeIgniter\Session\Session
660660
*/
661-
public static function session(\Config\App $config = null, $getShared = true)
661+
public static function session(\Config\App $config = null, bool $getShared = true)
662662
{
663663
if ($getShared)
664664
{
@@ -735,7 +735,7 @@ public static function timer($getShared = true)
735735
*
736736
* @return \CodeIgniter\Debug\Toolbar
737737
*/
738-
public static function toolbar(\Config\App $config = null, $getShared = true)
738+
public static function toolbar(\Config\App $config = null, bool $getShared = true)
739739
{
740740
if ($getShared)
741741
{
@@ -760,7 +760,7 @@ public static function toolbar(\Config\App $config = null, $getShared = true)
760760
*
761761
* @return \CodeIgniter\HTTP\URI
762762
*/
763-
public static function uri($uri = null, $getShared = true)
763+
public static function uri($uri = null, bool $getShared = true)
764764
{
765765
if ($getShared)
766766
{
@@ -780,7 +780,7 @@ public static function uri($uri = null, $getShared = true)
780780
*
781781
* @return \CodeIgniter\Validation\Validation
782782
*/
783-
public static function validation(\Config\Validation $config = null, $getShared = true)
783+
public static function validation(\Config\Validation $config = null, bool $getShared = true)
784784
{
785785
if ($getShared)
786786
{

system/Database/Config.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ class Config extends BaseConfig
7171
*
7272
* @return BaseConnection
7373
*/
74-
public static function connect($group = null, $getShared = true)
74+
public static function connect($group = null, bool $getShared = true)
7575
{
7676
if (is_array($group))
7777
{

0 commit comments

Comments
 (0)