Skip to content

Commit 1fbcd24

Browse files
committed
refactor: change the if statement to a ternary operator
1 parent 9348899 commit 1fbcd24

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

system/CodeIgniter.php

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -834,11 +834,9 @@ protected function runController($class)
834834
// This is a Web request or PHP CLI request
835835
$params = $this->router->params();
836836

837-
if (method_exists($class, '_remap')) {
838-
$output = $class->_remap($this->method, ...$params);
839-
} else {
840-
$output = $class->{$this->method}(...$params);
841-
}
837+
$output = method_exists($class, '_remap')
838+
? $class->_remap($this->method, ...$params)
839+
: $class->{$this->method}(...$params);
842840
}
843841

844842
$this->benchmark->stop('controller');

0 commit comments

Comments
 (0)