我就不多说了,能写出这种代码的人,还有人推崇。。。
https://github.com/slimphp/Slim/blob/2.x/Slim/Log.php#L308
if (!isset(self::$levels[$level])) {
throw new \InvalidArgumentException('Invalid log level supplied to function');
} else if ($this->enabled && $this->writer && $level <= $this->level) {
....
throw new \InvalidArgumentException
-> then ->
else if ?
然后,该作者的 slim3 居然还是高度遵循 fig PSR ,我去。。。