Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove unneeded (int) casting as use int type hint or certainly an int #1138

Merged
merged 2 commits into from
Aug 6, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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