Skip to content

Commit

Permalink
Merge pull request #1138 from samsonasik/int-cast-rem
Browse files Browse the repository at this point in the history
remove unneeded (int) casting as use int type hint or certainly an int
  • Loading branch information
lonnieezell authored Aug 6, 2018
2 parents 0f98889 + cc216b5 commit 1f43e8c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion system/CodeIgniter.php
Original file line number Diff line number Diff line change
Expand Up @@ -552,7 +552,7 @@ public function displayCache($config)
*/
public static function cache(int $time)
{
self::$cacheTTL = (int) $time;
self::$cacheTTL = $time;
}

//--------------------------------------------------------------------
Expand Down
4 changes: 2 additions & 2 deletions system/HTTP/URI.php
Original file line number Diff line number Diff line change
Expand Up @@ -633,7 +633,7 @@ public function setHost(string $str)
*
* @return $this
*/
public function setPort($port)
public function setPort(int $port = null)
{
if (is_null($port))
{
Expand Down Expand Up @@ -952,7 +952,7 @@ protected function applyParts($parts)
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;
}
}
Expand Down
4 changes: 2 additions & 2 deletions system/View/Filters.php
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ public static function limit_words($value, int $limit = 100): string
*
* @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');

Expand All @@ -236,7 +236,7 @@ public static function local_number($value, string $type='decimal', $precision=4
'duration' => \NumberFormatter::DURATION,
];

return format_number($value, (int)$precision, $locale, ['type' => $types[$type]]);
return format_number($value, $precision, $locale, ['type' => $types[$type]]);
}

//--------------------------------------------------------------------
Expand Down

0 comments on commit 1f43e8c

Please sign in to comment.