Skip to content

Commit 80f7b5f

Browse files
committed
Revert 'Application' type so that it works on Laravel Lumen
[2024-06-27 08:43:37] laravel.EMERGENCY: Unable to create configured logger. Using emergency logger. {"exception":"[object] (TypeError(code: 0): Rollbar\\Laravel\\RollbarServiceProvider::Rollbar\\Laravel\\{closure}(): Argument rollbar#1 ($app) must be of type Illuminate\\Contracts\\Foundation\\Application, Laravel\\Lumen\\Application given, called in /projects/MoveUp/backend/www/vendor/illuminate/container/Container.php on line 908 at /projects/MoveUp/backend/www/vendor/rollbar/rollbar-laravel/src/RollbarServiceProvider.php:58)
1 parent 69ecc7c commit 80f7b5f

File tree

2 files changed

+5
-7
lines changed

2 files changed

+5
-7
lines changed

src/MonologHandler.php

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,21 @@
22

33
namespace Rollbar\Laravel;
44

5-
use Illuminate\Contracts\Foundation\Application;
65
use Monolog\Handler\RollbarHandler;
76
use Monolog\LogRecord;
87

98
class MonologHandler extends RollbarHandler
109
{
11-
protected Application $app;
10+
protected $app;
1211

1312
/**
1413
* Sets the Laravel application, so it can be used to get the current user and session data later.
1514
*
16-
* @param Application $app The Laravel application.
15+
* @param $app The Laravel application.
1716
*
1817
* @return void
1918
*/
20-
public function setApp(Application $app): void
19+
public function setApp($app): void
2120
{
2221
$this->app = $app;
2322
}

src/RollbarServiceProvider.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
use Rollbar\RollbarLogger;
55
use Illuminate\Support\Arr;
66
use InvalidArgumentException;
7-
use Illuminate\Contracts\Foundation\Application;
87
use Illuminate\Support\Facades\Config;
98
use Illuminate\Support\ServiceProvider;
109

@@ -20,7 +19,7 @@ public function register(): void
2019
return;
2120
}
2221

23-
$this->app->singleton(RollbarLogger::class, function (Application $app) {
22+
$this->app->singleton(RollbarLogger::class, function ($app) {
2423

2524
$defaults = [
2625
'environment' => $app->environment(),
@@ -55,7 +54,7 @@ public function register(): void
5554
return Rollbar::logger();
5655
});
5756

58-
$this->app->singleton(MonologHandler::class, function (Application $app) {
57+
$this->app->singleton(MonologHandler::class, function ($app) {
5958

6059
$level = static::config('level', 'debug');
6160

0 commit comments

Comments
 (0)