/** * @return bool */ protected static function is_cli() { if (self::$cli !== null) { return self::$cli; } return self::$cli = PHP_SAPI === 'cli'; }