Skip to content

Commit

Permalink
Merge pull request #1191 from samsonasik/bool-getshared
Browse files Browse the repository at this point in the history
add bool type hint for getShared parameter
  • Loading branch information
lonnieezell authored Sep 4, 2018
2 parents 3a8e823 + 8375e4c commit 60d017c
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 23 deletions.
2 changes: 1 addition & 1 deletion system/Config/BaseService.php
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ protected static function getSharedInstance(string $key, ...$params)
*
* @return \CodeIgniter\Autoloader\FileLocator
*/
public static function locator($getShared = true)
public static function locator(bool $getShared = true)
{
if ($getShared)
{
Expand Down
42 changes: 21 additions & 21 deletions system/Config/Services.php
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ class Services extends BaseService
*
* @return \CodeIgniter\Autoloader\Autoloader
*/
public static function autoloader($getShared = true)
public static function autoloader(bool $getShared = true)
{
if ($getShared)
{
Expand All @@ -88,7 +88,7 @@ public static function autoloader($getShared = true)
*
* @return \CodeIgniter\Cache\CacheInterface
*/
public static function cache(\Config\Cache $config = null, $getShared = true)
public static function cache(\Config\Cache $config = null, bool $getShared = true)
{
if ($getShared)
{
Expand All @@ -114,7 +114,7 @@ public static function cache(\Config\Cache $config = null, $getShared = true)
*
* @return \CodeIgniter\HTTP\CLIRequest
*/
public static function clirequest(\Config\App $config = null, $getShared = true)
public static function clirequest(\Config\App $config = null, bool $getShared = true)
{
if ($getShared)
{
Expand Down Expand Up @@ -142,7 +142,7 @@ public static function clirequest(\Config\App $config = null, $getShared = true)
*
* @return \CodeIgniter\HTTP\CURLRequest
*/
public static function curlrequest(array $options = [], $response = null, \Config\App $config = null, $getShared = true) {
public static function curlrequest(array $options = [], $response = null, \Config\App $config = null, bool $getShared = true) {
if ($getShared === true)
{
return self::getSharedInstance('curlrequest', $options, $response, $config);
Expand Down Expand Up @@ -176,7 +176,7 @@ public static function curlrequest(array $options = [], $response = null, \Confi
*
* @return \CodeIgniter\Email\Email|mixed
*/
public static function email($config = null, $getShared = true)
public static function email($config = null, bool $getShared = true)
{
if ($getShared)
{
Expand Down Expand Up @@ -249,7 +249,7 @@ public static function exceptions(
*
* @return \CodeIgniter\Filters\Filters
*/
public static function filters($config = null, $getShared = true)
public static function filters($config = null, bool $getShared = true)
{
if ($getShared)
{
Expand All @@ -276,7 +276,7 @@ public static function filters($config = null, $getShared = true)
*
* @return \CodeIgniter\Images\Handlers\BaseHandler
*/
public static function image(string $handler = null, $config = null, $getShared = true)
public static function image(string $handler = null, $config = null, bool $getShared = true)
{
if ($getShared)
{
Expand Down Expand Up @@ -326,7 +326,7 @@ public static function iterator($getShared = true)
*
* @return \CodeIgniter\Language\Language
*/
public static function language(string $locale = null, $getShared = true)
public static function language(string $locale = null, bool $getShared = true)
{
if ($getShared)
{
Expand Down Expand Up @@ -395,7 +395,7 @@ public static function migrations(BaseConfig $config = null, ConnectionInterface
*
* @return \CodeIgniter\HTTP\Negotiate
*/
public static function negotiator(\CodeIgniter\HTTP\RequestInterface $request = null, $getShared = true)
public static function negotiator(\CodeIgniter\HTTP\RequestInterface $request = null, bool $getShared = true)
{
if ($getShared)
{
Expand All @@ -420,7 +420,7 @@ public static function negotiator(\CodeIgniter\HTTP\RequestInterface $request =
*
* @return \CodeIgniter\Pager\Pager
*/
public static function pager($config = null, RendererInterface $view = null, $getShared = true)
public static function pager($config = null, RendererInterface $view = null, bool $getShared = true)
{
if ($getShared)
{
Expand Down Expand Up @@ -451,7 +451,7 @@ public static function pager($config = null, RendererInterface $view = null, $ge
*
* @return \CodeIgniter\View\Parser
*/
public static function parser($viewPath = APPPATH.'Views/', $config = null, $getShared = true)
public static function parser($viewPath = APPPATH.'Views/', $config = null, bool $getShared = true)
{
if ($getShared)
{
Expand Down Expand Up @@ -479,7 +479,7 @@ public static function parser($viewPath = APPPATH.'Views/', $config = null, $get
*
* @return \CodeIgniter\View\View
*/
public static function renderer($viewPath = APPPATH.'Views/', $config = null, $getShared = true)
public static function renderer($viewPath = APPPATH.'Views/', $config = null, bool $getShared = true)
{
if ($getShared)
{
Expand All @@ -504,7 +504,7 @@ public static function renderer($viewPath = APPPATH.'Views/', $config = null, $g
*
* @return \CodeIgniter\HTTP\IncomingRequest
*/
public static function request(\Config\App $config = null, $getShared = true)
public static function request(\Config\App $config = null, bool $getShared = true)
{
if ($getShared)
{
Expand Down Expand Up @@ -534,7 +534,7 @@ public static function request(\Config\App $config = null, $getShared = true)
*
* @return \CodeIgniter\HTTP\Response
*/
public static function response(\Config\App $config = null, $getShared = true)
public static function response(\Config\App $config = null, bool $getShared = true)
{
if ($getShared)
{
Expand All @@ -559,7 +559,7 @@ public static function response(\Config\App $config = null, $getShared = true)
*
* @return \CodeIgniter\HTTP\Response
*/
public static function redirectResponse(\Config\App $config = null, $getShared = true)
public static function redirectResponse(\Config\App $config = null, bool $getShared = true)
{
if ($getShared)
{
Expand Down Expand Up @@ -609,7 +609,7 @@ public static function routes($getShared = true)
*
* @return \CodeIgniter\Router\Router
*/
public static function router(\CodeIgniter\Router\RouteCollectionInterface $routes = null, $getShared = true)
public static function router(\CodeIgniter\Router\RouteCollectionInterface $routes = null, bool $getShared = true)
{
if ($getShared)
{
Expand All @@ -635,7 +635,7 @@ public static function router(\CodeIgniter\Router\RouteCollectionInterface $rout
*
* @return \CodeIgniter\Security\Security
*/
public static function security(\Config\App $config = null, $getShared = true)
public static function security(\Config\App $config = null, bool $getShared = true)
{
if ($getShared)
{
Expand All @@ -658,7 +658,7 @@ public static function security(\Config\App $config = null, $getShared = true)
*
* @return \CodeIgniter\Session\Session
*/
public static function session(\Config\App $config = null, $getShared = true)
public static function session(\Config\App $config = null, bool $getShared = true)
{
if ($getShared)
{
Expand Down Expand Up @@ -735,7 +735,7 @@ public static function timer($getShared = true)
*
* @return \CodeIgniter\Debug\Toolbar
*/
public static function toolbar(\Config\App $config = null, $getShared = true)
public static function toolbar(\Config\App $config = null, bool $getShared = true)
{
if ($getShared)
{
Expand All @@ -760,7 +760,7 @@ public static function toolbar(\Config\App $config = null, $getShared = true)
*
* @return \CodeIgniter\HTTP\URI
*/
public static function uri($uri = null, $getShared = true)
public static function uri($uri = null, bool $getShared = true)
{
if ($getShared)
{
Expand All @@ -780,7 +780,7 @@ public static function uri($uri = null, $getShared = true)
*
* @return \CodeIgniter\Validation\Validation
*/
public static function validation(\Config\Validation $config = null, $getShared = true)
public static function validation(\Config\Validation $config = null, bool $getShared = true)
{
if ($getShared)
{
Expand Down
2 changes: 1 addition & 1 deletion system/Database/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class Config extends BaseConfig
*
* @return BaseConnection
*/
public static function connect($group = null, $getShared = true)
public static function connect($group = null, bool $getShared = true)
{
if (is_array($group))
{
Expand Down

0 comments on commit 60d017c

Please sign in to comment.