From 74803e41c0d722a1bfa33cd78a04397082759b1a Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Wed, 7 Mar 2018 12:27:34 +0700 Subject: [PATCH] another replace "OR" operator with "||" --- system/Cache/Handlers/MemcachedHandler.php | 2 +- system/Common.php | 2 +- system/Database/BaseConnection.php | 4 ++-- system/Database/MigrationRunner.php | 2 +- system/Database/Postgre/Connection.php | 2 +- system/Helpers/filesystem_helper.php | 2 +- system/Log/Handlers/FileHandler.php | 2 +- 7 files changed, 8 insertions(+), 8 deletions(-) diff --git a/system/Cache/Handlers/MemcachedHandler.php b/system/Cache/Handlers/MemcachedHandler.php index 8aea74d667..cd2405489f 100644 --- a/system/Cache/Handlers/MemcachedHandler.php +++ b/system/Cache/Handlers/MemcachedHandler.php @@ -310,7 +310,7 @@ class MemcachedHandler implements CacheInterface */ public function isSupported(): bool { - return (extension_loaded('memcached') OR extension_loaded('memcache')); + return (extension_loaded('memcached') || extension_loaded('memcache')); } } diff --git a/system/Common.php b/system/Common.php index 91f638c7aa..f7f6c63937 100644 --- a/system/Common.php +++ b/system/Common.php @@ -862,7 +862,7 @@ if ( ! function_exists('is_really_writable')) return true; } - elseif ( ! is_file($file) OR ( $fp = @fopen($file, 'ab')) === false) + elseif ( ! is_file($file) || ( $fp = @fopen($file, 'ab')) === false) { return false; } diff --git a/system/Database/BaseConnection.php b/system/Database/BaseConnection.php index 86b1b23534..b0dfab8a4c 100644 --- a/system/Database/BaseConnection.php +++ b/system/Database/BaseConnection.php @@ -1241,7 +1241,7 @@ abstract class BaseConnection implements ConnectionInterface */ public function escapeIdentifiers($item) { - if ($this->escapeChar === '' OR empty($item) OR in_array($item, $this->reservedIdentifiers)) + if ($this->escapeChar === '' || empty($item) || in_array($item, $this->reservedIdentifiers)) { return $item; } @@ -1360,7 +1360,7 @@ abstract class BaseConnection implements ConnectionInterface return $str; } - else if (is_string($str) OR ( is_object($str) && method_exists($str, '__toString'))) + else if (is_string($str) || ( is_object($str) && method_exists($str, '__toString'))) { return "'" . $this->escapeString($str) . "'"; } diff --git a/system/Database/MigrationRunner.php b/system/Database/MigrationRunner.php index eda1c19dd4..529c62ab39 100644 --- a/system/Database/MigrationRunner.php +++ b/system/Database/MigrationRunner.php @@ -234,7 +234,7 @@ class MigrationRunner { // Only include migrations within the scoop - if (($method === 'up' && $version > $currentVersion && $version <= $targetVersion) OR ( $method === 'down' && $version <= $currentVersion && $version > $targetVersion) + if (($method === 'up' && $version > $currentVersion && $version <= $targetVersion) || ( $method === 'down' && $version <= $currentVersion && $version > $targetVersion) ) { diff --git a/system/Database/Postgre/Connection.php b/system/Database/Postgre/Connection.php index 38d37b410b..a60ccaa301 100644 --- a/system/Database/Postgre/Connection.php +++ b/system/Database/Postgre/Connection.php @@ -217,7 +217,7 @@ class Connection extends BaseConnection implements ConnectionInterface $this->initialize(); } - if (is_string($str) OR ( is_object($str) && method_exists($str, '__toString'))) + if (is_string($str) || ( is_object($str) && method_exists($str, '__toString'))) { return pg_escape_literal($this->connID, $str); } diff --git a/system/Helpers/filesystem_helper.php b/system/Helpers/filesystem_helper.php index 0e274a4710..59456d5ad4 100644 --- a/system/Helpers/filesystem_helper.php +++ b/system/Helpers/filesystem_helper.php @@ -35,7 +35,7 @@ * @since Version 1.0.0 * @filesource */ -defined('BASEPATH') OR exit('No direct script access allowed'); +defined('BASEPATH') || exit('No direct script access allowed'); /** * CodeIgniter Directory Helpers diff --git a/system/Log/Handlers/FileHandler.php b/system/Log/Handlers/FileHandler.php index dc2b14a8a0..abbf05aabd 100644 --- a/system/Log/Handlers/FileHandler.php +++ b/system/Log/Handlers/FileHandler.php @@ -105,7 +105,7 @@ class FileHandler extends BaseHandler implements HandlerInterface // Only add protection to php files if ($this->fileExtension === 'php') { - $msg .= "\n\n"; + $msg .= "\n\n"; } }