Skip to content

Commit d261b1e

Browse files
committed
Replaced == with === and != with !== in /system/libraries
1 parent 773ccc3 commit d261b1e

24 files changed

+268
-268
lines changed

system/libraries/Cache/drivers/Cache_file.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ public function __construct()
5353
$CI =& get_instance();
5454
$CI->load->helper('file');
5555
$path = $CI->config->item('cache_path');
56-
$this->_cache_path = ($path == '') ? APPPATH.'cache/' : $path;
56+
$this->_cache_path = ($path === '') ? APPPATH.'cache/' : $path;
5757
}
5858

5959
// ------------------------------------------------------------------------

system/libraries/Cache/drivers/Cache_memcached.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ protected function _setup_memcached()
212212
$cache_server['weight'] = $this->_memcache_conf['default']['default_weight'];
213213
}
214214

215-
if (get_class($this->_memcached) == 'Memcache')
215+
if (get_class($this->_memcached) === 'Memcache')
216216
{
217217
// Third parameter is persistance and defaults to TRUE.
218218
$this->_memcached->addServer(

system/libraries/Calendar.php

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ public function initialize($config = array())
155155
public function generate($year = '', $month = '', $data = array())
156156
{
157157
// Set and validate the supplied month/year
158-
if ($year == '')
158+
if ($year === '')
159159
{
160160
$year = date('Y', $this->local_time);
161161
}
@@ -168,7 +168,7 @@ public function generate($year = '', $month = '', $data = array())
168168
$year = '20'.$year;
169169
}
170170

171-
if ($month == '')
171+
if ($month === '')
172172
{
173173
$month = date('m', $this->local_time);
174174
}
@@ -205,7 +205,7 @@ public function generate($year = '', $month = '', $data = array())
205205
$cur_month = date('m', $this->local_time);
206206
$cur_day = date('j', $this->local_time);
207207

208-
$is_current_month = ($cur_year == $year && $cur_month == $month);
208+
$is_current_month = ($cur_year === $year && $cur_month === $month);
209209

210210
// Generate the template data array
211211
$this->parse_template();
@@ -214,7 +214,7 @@ public function generate($year = '', $month = '', $data = array())
214214
$out = $this->temp['table_open']."\n\n".$this->temp['heading_row_start']."\n";
215215

216216
// "previous" month link
217-
if ($this->show_next_prev == TRUE)
217+
if ($this->show_next_prev === TRUE)
218218
{
219219
// Add a trailing slash to the URL if needed
220220
$this->next_prev_url = preg_replace('/(.+?)\/*$/', '\\1/', $this->next_prev_url);
@@ -224,15 +224,15 @@ public function generate($year = '', $month = '', $data = array())
224224
}
225225

226226
// Heading containing the month/year
227-
$colspan = ($this->show_next_prev == TRUE) ? 5 : 7;
227+
$colspan = ($this->show_next_prev === TRUE) ? 5 : 7;
228228

229229
$this->temp['heading_title_cell'] = str_replace('{colspan}', $colspan,
230230
str_replace('{heading}', $this->get_month_name($month).' '.$year, $this->temp['heading_title_cell']));
231231

232232
$out .= $this->temp['heading_title_cell']."\n";
233233

234234
// "next" month link
235-
if ($this->show_next_prev == TRUE)
235+
if ($this->show_next_prev === TRUE)
236236
{
237237
$adjusted_date = $this->adjust_date($month + 1, $year);
238238
$out .= str_replace('{next_url}', $this->next_prev_url.$adjusted_date['year'].'/'.$adjusted_date['month'], $this->temp['heading_next_cell']);
@@ -258,21 +258,21 @@ public function generate($year = '', $month = '', $data = array())
258258

259259
for ($i = 0; $i < 7; $i++)
260260
{
261-
$out .= ($is_current_month === TRUE && $day == $cur_day) ? $this->temp['cal_cell_start_today'] : $this->temp['cal_cell_start'];
261+
$out .= ($is_current_month === TRUE && $day === $cur_day) ? $this->temp['cal_cell_start_today'] : $this->temp['cal_cell_start'];
262262

263263
if ($day > 0 && $day <= $total_days)
264264
{
265265
if (isset($data[$day]))
266266
{
267267
// Cells with content
268-
$temp = ($is_current_month === TRUE && $day == $cur_day) ?
268+
$temp = ($is_current_month === TRUE && $day === $cur_day) ?
269269
$this->temp['cal_cell_content_today'] : $this->temp['cal_cell_content'];
270270
$out .= str_replace(array('{content}', '{day}'), array($data[$day], $day), $temp);
271271
}
272272
else
273273
{
274274
// Cells with no content
275-
$temp = ($is_current_month === TRUE && $day == $cur_day) ?
275+
$temp = ($is_current_month === TRUE && $day === $cur_day) ?
276276
$this->temp['cal_cell_no_content_today'] : $this->temp['cal_cell_no_content'];
277277
$out .= str_replace('{day}', $day, $temp);
278278
}
@@ -283,7 +283,7 @@ public function generate($year = '', $month = '', $data = array())
283283
$out .= $this->temp['cal_cell_blank'];
284284
}
285285

286-
$out .= ($is_current_month === TRUE && $day == $cur_day) ? $this->temp['cal_cell_end_today'] : $this->temp['cal_cell_end'];
286+
$out .= ($is_current_month === TRUE && $day === $cur_day) ? $this->temp['cal_cell_end_today'] : $this->temp['cal_cell_end'];
287287
$day++;
288288
}
289289

@@ -306,7 +306,7 @@ public function generate($year = '', $month = '', $data = array())
306306
*/
307307
public function get_month_name($month)
308308
{
309-
if ($this->month_type == 'short')
309+
if ($this->month_type === 'short')
310310
{
311311
$month_names = array('01' => 'cal_jan', '02' => 'cal_feb', '03' => 'cal_mar', '04' => 'cal_apr', '05' => 'cal_may', '06' => 'cal_jun', '07' => 'cal_jul', '08' => 'cal_aug', '09' => 'cal_sep', '10' => 'cal_oct', '11' => 'cal_nov', '12' => 'cal_dec');
312312
}
@@ -333,7 +333,7 @@ public function get_month_name($month)
333333
*/
334334
public function get_day_names($day_type = '')
335335
{
336-
if ($day_type != '')
336+
if ($day_type !== '')
337337
{
338338
$this->day_type = $day_type;
339339
}
@@ -419,9 +419,9 @@ public function get_total_days($month, $year)
419419
}
420420

421421
// Is the year a leap year?
422-
if ($month == 2)
422+
if ($month === 2)
423423
{
424-
if ($year % 400 == 0 OR ($year % 4 == 0 && $year % 100 != 0))
424+
if ($year % 400 === 0 OR ($year % 4 === 0 && $year % 100 !== 0))
425425
{
426426
return 29;
427427
}
@@ -480,7 +480,7 @@ public function parse_template()
480480
{
481481
$this->temp = $this->default_template();
482482

483-
if ($this->template == '')
483+
if ($this->template === '')
484484
{
485485
return;
486486
}

system/libraries/Cart.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,7 +193,7 @@ protected function _insert($items = array())
193193
$items['qty'] = (float) $items['qty'];
194194

195195
// If the quantity is zero or blank there's nothing for us to do
196-
if ( ! is_numeric($items['qty']) OR $items['qty'] == 0)
196+
if ( ! is_numeric($items['qty']) OR $items['qty'] === 0)
197197
{
198198
return FALSE;
199199
}
@@ -358,7 +358,7 @@ protected function _update($items = array())
358358

359359
// Is the quantity zero? If so we will remove the item from the cart.
360360
// If the quantity is greater than zero we are updating
361-
if ($items['qty'] == 0)
361+
if ($items['qty'] === 0)
362362
{
363363
unset($this->_cart_contents[$items['rowid']]);
364364
}
@@ -520,7 +520,7 @@ public function product_options($rowid = '')
520520
*/
521521
public function format_number($n = '')
522522
{
523-
return ($n == '') ? '' : number_format( (float) $n, 2, '.', ',');
523+
return ($n === '') ? '' : number_format( (float) $n, 2, '.', ',');
524524
}
525525

526526
// --------------------------------------------------------------------

0 commit comments

Comments
 (0)