Skip to content
This repository was archived by the owner on Nov 18, 2025. It is now read-only.

Commit b5f8f6d

Browse files
committed
🔨 replace true,false,null and array()
Signed-off-by: otengkwame <[email protected]>
1 parent 0e112b1 commit b5f8f6d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+1271
-1271
lines changed

framework/core/CodeIgniter.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,7 @@
117117

118118
foreach (array_keys($$superglobal) as $var) {
119119
if (isset($GLOBALS[$var]) && !in_array($var, $_protected, true)) {
120-
$GLOBALS[$var] = NULL;
120+
$GLOBALS[$var] = null;
121121
}
122122
}
123123
}
@@ -302,7 +302,7 @@
302302
* Instantiate the routing class and set the routing
303303
* ------------------------------------------------------
304304
*/
305-
$RTR = &load_class('Router', 'core', isset($routing) ? $routing : NULL);
305+
$RTR = &load_class('Router', 'core', isset($routing) ? $routing : null);
306306

307307
/*
308308
* ------------------------------------------------------

framework/core/Common.php

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@
5757
* Determines if the current version of PHP is equal to or greater than the supplied value
5858
*
5959
* @param string
60-
* @return bool TRUE if the current version is $version or higher
60+
* @return bool true if the current version is $version or higher
6161
*/
6262
function is_php($version)
6363
{
@@ -80,7 +80,7 @@ function is_php($version)
8080
/**
8181
* Tests for file writability
8282
*
83-
* is_writable() returns TRUE on Windows servers when you really can't write to
83+
* is_writable() returns true on Windows servers when you really can't write to
8484
* the file, based on the read-only attribute. is_writable() is also unreliable
8585
* on Unix servers if safe_mode is on.
8686
*
@@ -102,23 +102,23 @@ function is_really_writable($file)
102102
if (is_dir($file))
103103
{
104104
$file = rtrim($file, '/').'/'.md5(mt_rand());
105-
if (($fp = @fopen($file, 'ab')) === FALSE)
105+
if (($fp = @fopen($file, 'ab')) === false)
106106
{
107-
return FALSE;
107+
return false;
108108
}
109109

110110
fclose($fp);
111111
@chmod($file, 0777);
112112
@unlink($file);
113-
return TRUE;
113+
return true;
114114
}
115-
elseif ( ! is_file($file) OR ($fp = @fopen($file, 'ab')) === FALSE)
115+
elseif ( ! is_file($file) OR ($fp = @fopen($file, 'ab')) === false)
116116
{
117-
return FALSE;
117+
return false;
118118
}
119119

120120
fclose($fp);
121-
return TRUE;
121+
return true;
122122
}
123123
}
124124

@@ -138,7 +138,7 @@ function is_really_writable($file)
138138
* @param mixed an optional argument to pass to the class constructor
139139
* @return object
140140
*/
141-
function &load_class($class, $directory = 'libraries', $param = NULL)
141+
function &load_class($class, $directory = 'libraries', $param = null)
142142
{
143143
static $_classes = [];
144144

@@ -148,7 +148,7 @@ function &load_class($class, $directory = 'libraries', $param = NULL)
148148
return $_classes[$class];
149149
}
150150

151-
$name = FALSE;
151+
$name = false;
152152

153153
// Look for the class first in the local application/libraries folder
154154
// then in the native system/libraries folder
@@ -158,7 +158,7 @@ function &load_class($class, $directory = 'libraries', $param = NULL)
158158
{
159159
$name = 'CI_'.$class;
160160

161-
if (class_exists($name, FALSE) === FALSE)
161+
if (class_exists($name, false) === false)
162162
{
163163
require_once($path.$directory.'/'.$class.'.php');
164164
}
@@ -172,14 +172,14 @@ function &load_class($class, $directory = 'libraries', $param = NULL)
172172
{
173173
$name = config_item('subclass_prefix').$class;
174174

175-
if (class_exists($name, FALSE) === FALSE)
175+
if (class_exists($name, false) === false)
176176
{
177177
require_once(APPPATH.$directory.'/'.$name.'.php');
178178
}
179179
}
180180

181181
// Did we find the class?
182-
if ($name === FALSE)
182+
if ($name === false)
183183
{
184184
// Note: We use exit() rather than show_error() in order to avoid a
185185
// self-referencing loop with the Exceptions class
@@ -242,10 +242,10 @@ function &get_config(Array $replace = [])
242242
if (empty($config))
243243
{
244244
$file_path = APPPATH.'config/config.php';
245-
$found = FALSE;
245+
$found = false;
246246
if (file_exists($file_path))
247247
{
248-
$found = TRUE;
248+
$found = true;
249249
require($file_path);
250250
}
251251

@@ -300,7 +300,7 @@ function config_item($item)
300300
$_config[0] =& get_config();
301301
}
302302

303-
return isset($_config[0][$item]) ? $_config[0][$item] : NULL;
303+
return isset($_config[0][$item]) ? $_config[0][$item] : null;
304304
}
305305
}
306306

@@ -349,18 +349,18 @@ function is_https()
349349
{
350350
if ( ! empty($_SERVER['HTTPS']) && strtolower($_SERVER['HTTPS']) !== 'off')
351351
{
352-
return TRUE;
352+
return true;
353353
}
354354
elseif (isset($_SERVER['HTTP_X_FORWARDED_PROTO']) && strtolower($_SERVER['HTTP_X_FORWARDED_PROTO']) === 'https')
355355
{
356-
return TRUE;
356+
return true;
357357
}
358358
elseif ( ! empty($_SERVER['HTTP_FRONT_END_HTTPS']) && strtolower($_SERVER['HTTP_FRONT_END_HTTPS']) !== 'off')
359359
{
360-
return TRUE;
360+
return true;
361361
}
362362

363-
return FALSE;
363+
return false;
364364
}
365365
}
366366

@@ -434,7 +434,7 @@ function show_error($message, $status_code = 500, $heading = 'An Error Was Encou
434434
* @param bool
435435
* @return void
436436
*/
437-
function show_404($page = '', $log_error = TRUE)
437+
function show_404($page = '', $log_error = true)
438438
{
439439
$_error =& load_class('Exceptions', 'core');
440440
$_error->show_404($page, $log_error);
@@ -460,7 +460,7 @@ function log_message($level, $message)
460460
{
461461
static $_log;
462462

463-
if ($_log === NULL)
463+
if ($_log === null)
464464
{
465465
// references cannot be directly assigned to static variables, so we use an array
466466
$_log[0] =& load_class('Log', 'core');
@@ -561,13 +561,13 @@ function set_status_header($code = 200, $text = '')
561561

562562
if (strpos(PHP_SAPI, 'cgi') === 0)
563563
{
564-
header('Status: '.$code.' '.$text, TRUE);
564+
header('Status: '.$code.' '.$text, true);
565565
return;
566566
}
567567

568-
$server_protocol = (isset($_SERVER['SERVER_PROTOCOL']) && in_array($_SERVER['SERVER_PROTOCOL'], ['HTTP/1.0', 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0'], TRUE))
568+
$server_protocol = (isset($_SERVER['SERVER_PROTOCOL']) && in_array($_SERVER['SERVER_PROTOCOL'], ['HTTP/1.0', 'HTTP/1.1', 'HTTP/2', 'HTTP/2.0'], true))
569569
? $_SERVER['SERVER_PROTOCOL'] : 'HTTP/1.1';
570-
header($server_protocol.' '.$code.' '.$text, TRUE, $code);
570+
header($server_protocol.' '.$code.' '.$text, true, $code);
571571
}
572572
}
573573

@@ -705,7 +705,7 @@ function _shutdown_handler()
705705
* @param bool
706706
* @return string
707707
*/
708-
function remove_invisible_characters($str, $url_encoded = TRUE)
708+
function remove_invisible_characters($str, $url_encoded = true)
709709
{
710710
$non_displayables = [];
711711

@@ -738,10 +738,10 @@ function remove_invisible_characters($str, $url_encoded = TRUE)
738738
* Returns HTML escaped variable.
739739
*
740740
* @param mixed $var The input string or array of strings to be escaped.
741-
* @param bool $double_encode $double_encode set to FALSE prevents escaping twice.
741+
* @param bool $double_encode $double_encode set to false prevents escaping twice.
742742
* @return mixed The escaped string or array of strings as a result.
743743
*/
744-
function html_escape($var, $double_encode = TRUE)
744+
function html_escape($var, $double_encode = true)
745745
{
746746
if (empty($var))
747747
{
@@ -776,9 +776,9 @@ function html_escape($var, $double_encode = TRUE)
776776
* @param bool
777777
* @return string
778778
*/
779-
function _stringify_attributes($attributes, $js = FALSE)
779+
function _stringify_attributes($attributes, $js = false)
780780
{
781-
$atts = NULL;
781+
$atts = null;
782782

783783
if (empty($attributes))
784784
{
@@ -812,7 +812,7 @@ function _stringify_attributes($attributes, $js = FALSE)
812812
* extension is loaded - checks whether the function that is
813813
* checked might be disabled in there as well.
814814
*
815-
* This is useful as function_exists() will return FALSE for
815+
* This is useful as function_exists() will return false for
816816
* functions disabled via the *disable_functions* php.ini
817817
* setting, but not for *suhosin.executor.func.blacklist* and
818818
* *suhosin.executor.disable_eval*. These settings will just
@@ -825,8 +825,8 @@ function _stringify_attributes($attributes, $js = FALSE)
825825
*
826826
* @link http://www.hardened-php.net/suhosin/
827827
* @param string $function_name Function to check for
828-
* @return bool TRUE if the function exists and is safe to call,
829-
* FALSE otherwise.
828+
* @return bool true if the function exists and is safe to call,
829+
* false otherwise.
830830
*/
831831
function function_usable($function_name)
832832
{
@@ -841,9 +841,9 @@ function function_usable($function_name)
841841
: [];
842842
}
843843

844-
return ! in_array($function_name, $_suhosin_func_blacklist, TRUE);
844+
return ! in_array($function_name, $_suhosin_func_blacklist, true);
845845
}
846846

847-
return FALSE;
847+
return false;
848848
}
849849
}

0 commit comments

Comments
 (0)