diff --git a/composer.json b/composer.json index 3d08110d..d817732b 100644 --- a/composer.json +++ b/composer.json @@ -19,18 +19,18 @@ "php": "^8.0.0|^8.1.0", "ext-json": "*", "doctrine/dbal": "^3.1", - "illuminate/bus": "^8.11", - "illuminate/console": "^8.11", - "illuminate/contracts": "^8.11", - "illuminate/database": "^8.11", - "illuminate/events": "^8.11", - "illuminate/notifications": "^8.11", + "illuminate/bus": "^8.11|^9.0", + "illuminate/console": "^8.11|^9.0", + "illuminate/contracts": "^8.11|^9.0", + "illuminate/database": "^8.11|^9.0", + "illuminate/events": "^8.11|^9.0", + "illuminate/notifications": "^8.11|^9.0", "laravelcollective/html": "^6.0" }, "require-dev": { "mockery/mockery": "^1.0", - "orchestra/database": "^6.0", - "orchestra/testbench" : "^6.0", + "orchestra/database": "^6.0|^7.0", + "orchestra/testbench" : "^6.0|^7.0", "phpunit/phpunit": "^9.0" }, "suggest": { diff --git a/src/Contracts/TaskInterface.php b/src/Contracts/TaskInterface.php index a34d56f0..c955de24 100644 --- a/src/Contracts/TaskInterface.php +++ b/src/Contracts/TaskInterface.php @@ -21,7 +21,7 @@ public function builder(): Builder; * @param int|Task $id * @return Task */ - public function find(Task|int $id): Task; + public function find(Task|int $id); /** * Returns all tasks. diff --git a/src/Http/Middleware/Authenticate.php b/src/Http/Middleware/Authenticate.php index 713302ec..2da5c375 100644 --- a/src/Http/Middleware/Authenticate.php +++ b/src/Http/Middleware/Authenticate.php @@ -16,7 +16,7 @@ class Authenticate * @param Closure $next * @return Response */ - public function handle(Request $request, Closure $next): Response + public function handle($request, $next) { return Totem::check($request) ? $next($request) : abort(403); } diff --git a/src/Http/Requests/ImportRequest.php b/src/Http/Requests/ImportRequest.php index 6fb2a7dd..3c9632d6 100644 --- a/src/Http/Requests/ImportRequest.php +++ b/src/Http/Requests/ImportRequest.php @@ -51,6 +51,7 @@ public function messages() * * @param array|mixed $keys * @return array + * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ public function all($keys = null) @@ -68,9 +69,10 @@ public function all($keys = null) * Get the validated data from the request. * * @return array + * * @throws \Illuminate\Contracts\Filesystem\FileNotFoundException */ - public function validated() + public function validated($key = null, $default = null) { $content = ''; @@ -84,7 +86,7 @@ public function validated() /** * * Handle a failed validation attempt. * - * @param Validator $validator + * @param Validator $validator */ protected function failedValidation(Validator $validator) { diff --git a/src/Repositories/EloquentTaskRepository.php b/src/Repositories/EloquentTaskRepository.php index eb20e573..cd3a4f7f 100644 --- a/src/Repositories/EloquentTaskRepository.php +++ b/src/Repositories/EloquentTaskRepository.php @@ -48,7 +48,7 @@ public function builder(): Builder * @param int|Task $id * @return Task */ - public function find(Task|int $id): Task + public function find(Task|int $id) { if ($id instanceof Task) { return $id; diff --git a/src/Totem.php b/src/Totem.php index 5a41b84e..ab7fb709 100644 --- a/src/Totem.php +++ b/src/Totem.php @@ -23,10 +23,10 @@ class Totem /** * Determine if the given request can access the Totem dashboard. * - * @param Request $request + * @param Request|string|null $request * @return bool */ - public static function check(Request $request): bool + public static function check($request): bool { return (static::$authUsing ?: function () { return app()->environment('local'); @@ -36,8 +36,7 @@ public static function check(Request $request): bool /** * Set the callback that should be used to authenticate Totem users. * - * @param Closure $callback - * + * @param Closure $callback * @return static */ public static function auth(Closure $callback) diff --git a/tests/Feature/TaskExecutionTest.php b/tests/Feature/TaskExecutionTest.php index 7ea97aae..186a37ec 100644 --- a/tests/Feature/TaskExecutionTest.php +++ b/tests/Feature/TaskExecutionTest.php @@ -43,7 +43,8 @@ public function it_executes_a_scheduled_task() Event::fake(); - $this->get(route('totem.task.execute', $task->id)) + $this->signIn() + ->get(route('totem.task.execute', $task->id)) ->assertSuccessful(); $this->assertEquals(1, Result::count());