From 72657ab02db3e7369c0f4914efe404974e0eb59e Mon Sep 17 00:00:00 2001 From: Abdul Malik Ikhsan Date: Sun, 5 Aug 2018 18:35:58 +0700 Subject: [PATCH] remove unneeded (int) casting as already use int type hint or certainly an int --- system/CodeIgniter.php | 2 +- system/HTTP/URI.php | 2 +- system/View/Filters.php | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/system/CodeIgniter.php b/system/CodeIgniter.php index 34e8c3a0c9..cb03cedf5e 100644 --- a/system/CodeIgniter.php +++ b/system/CodeIgniter.php @@ -552,7 +552,7 @@ class CodeIgniter */ public static function cache(int $time) { - self::$cacheTTL = (int) $time; + self::$cacheTTL = $time; } //-------------------------------------------------------------------- diff --git a/system/HTTP/URI.php b/system/HTTP/URI.php index cd82a884f6..99a5599119 100644 --- a/system/HTTP/URI.php +++ b/system/HTTP/URI.php @@ -952,7 +952,7 @@ class URI if ( ! is_null($parts['port'])) { // Valid port numbers are enforced by earlier parse_url or setPort() - $port = (int) $parts['port']; + $port = $parts['port']; $this->port = $port; } } diff --git a/system/View/Filters.php b/system/View/Filters.php index c0078525d0..dc450c24f7 100644 --- a/system/View/Filters.php +++ b/system/View/Filters.php @@ -222,7 +222,7 @@ class Filters * * @return string */ - public static function local_number($value, string $type='decimal', $precision=4, string $locale = null): string + public static function local_number($value, string $type='decimal', int $precision=4, string $locale = null): string { helper('number'); @@ -236,7 +236,7 @@ class Filters 'duration' => \NumberFormatter::DURATION, ]; - return format_number($value, (int)$precision, $locale, ['type' => $types[$type]]); + return format_number($value, $precision, $locale, ['type' => $types[$type]]); } //--------------------------------------------------------------------