diff --git a/framework/core/composer.json b/framework/core/composer.json index 2ecc9ec07..86a9594b5 100644 --- a/framework/core/composer.json +++ b/framework/core/composer.json @@ -41,21 +41,21 @@ "dflydev/fig-cookies": "^1.0.2", "doctrine/dbal": "^2.7", "franzl/whoops-middleware": "^0.4.0", - "illuminate/bus": "5.7.*", - "illuminate/cache": "5.7.*", - "illuminate/config": "5.7.*", - "illuminate/container": "5.7.*", - "illuminate/contracts": "5.7.*", - "illuminate/database": "5.7.*", - "illuminate/events": "5.7.*", - "illuminate/filesystem": "5.7.*", - "illuminate/hashing": "5.7.*", - "illuminate/mail": "5.7.*", - "illuminate/queue": "5.7.*", - "illuminate/session": "5.7.*", - "illuminate/support": "5.7.*", - "illuminate/validation": "5.7.*", - "illuminate/view": "5.7.*", + "illuminate/bus": "5.8.*", + "illuminate/cache": "5.8.*", + "illuminate/config": "5.8.*", + "illuminate/container": "5.8.*", + "illuminate/contracts": "5.8.*", + "illuminate/database": "5.8.*", + "illuminate/events": "5.8.*", + "illuminate/filesystem": "5.8.*", + "illuminate/hashing": "5.8.*", + "illuminate/mail": "5.8.*", + "illuminate/queue": "5.8.*", + "illuminate/session": "5.8.*", + "illuminate/support": "5.8.*", + "illuminate/validation": "5.8.*", + "illuminate/view": "5.8.*", "intervention/image": "^2.5.0", "laminas/laminas-diactoros": "^1.8.4", "laminas/laminas-httphandlerrunner": "^1.0", diff --git a/framework/core/src/Http/Middleware/HandleErrors.php b/framework/core/src/Http/Middleware/HandleErrors.php index d7965333e..a2d741884 100644 --- a/framework/core/src/Http/Middleware/HandleErrors.php +++ b/framework/core/src/Http/Middleware/HandleErrors.php @@ -41,7 +41,7 @@ class HandleErrors implements Middleware */ protected $reporters; - public function __construct(Registry $registry, HttpFormatter $formatter, array $reporters) + public function __construct(Registry $registry, HttpFormatter $formatter, iterable $reporters) { $this->registry = $registry; $this->formatter = $formatter; diff --git a/framework/core/src/Notification/NotificationRepository.php b/framework/core/src/Notification/NotificationRepository.php index d1baf5c25..96030f98a 100644 --- a/framework/core/src/Notification/NotificationRepository.php +++ b/framework/core/src/Notification/NotificationRepository.php @@ -11,7 +11,6 @@ namespace Flarum\Notification; use Carbon\Carbon; use Flarum\User\User; -use Illuminate\Database\Query\Expression; class NotificationRepository { @@ -36,11 +35,8 @@ class NotificationRepository ->skip($offset) ->take($limit); - return Notification::select('notifications.*') - ->selectRaw('p.unread_count') - // Expression is necessary until Laravel 5.8. - // See https://github.com/laravel/framework/pull/28400 - ->joinSub($primaries, 'p', 'notifications.id', '=', new Expression('p.id')) + return Notification::select('notifications.*', 'p.unread_count') + ->joinSub($primaries, 'p', 'notifications.id', '=', 'p.id') ->latest() ->get(); } diff --git a/framework/core/tests/integration/setup.php b/framework/core/tests/integration/setup.php index 8403acf5c..afe5a6063 100644 --- a/framework/core/tests/integration/setup.php +++ b/framework/core/tests/integration/setup.php @@ -14,12 +14,12 @@ use Flarum\Install\Installation; require __DIR__.'/../../vendor/autoload.php'; -$host = env('DB_HOST', 'localhost'); -$port = intval(env('DB_PORT', 3306)); -$name = env('DB_DATABASE', 'flarum_test'); -$user = env('DB_USERNAME', 'root'); -$pass = env('DB_PASSWORD', ''); -$pref = env('DB_PREFIX', ''); +$host = getenv('DB_HOST') ?: 'localhost'; +$port = intval(getenv('DB_PORT') ?: 3306); +$name = getenv('DB_DATABASE') ?: 'flarum_test'; +$user = getenv('DB_USERNAME') ?: 'root'; +$pass = getenv('DB_PASSWORD') ?: ''; +$pref = getenv('DB_PREFIX') ?: ''; echo "Connecting to database $name at $host:$port.\n"; echo "Logging in as $user with password '$pass'.\n"; @@ -48,15 +48,9 @@ $pipeline = $installation ->configPath('config.php') ->debugMode(true) ->baseUrl(BaseUrl::fromString('http://localhost')) - ->databaseConfig(new DatabaseConfig( - 'mysql', - env('DB_HOST', 'localhost'), - intval(env('DB_PORT', 3306)), - env('DB_DATABASE', 'flarum_test'), - env('DB_USERNAME', 'root'), - env('DB_PASSWORD', ''), - env('DB_PREFIX', '') - )) + ->databaseConfig( + new DatabaseConfig('mysql', $host, $port, $name, $user, $pass, $pref) + ) ->adminUser(new AdminUser( 'admin', 'secret',