Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 2 additions & 5 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,9 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest]
php: [8.1]
laravel: [9.*]
laravel: ['9.50', 10]
coverage-driver: [pcov]
stability: [prefer-lowest, prefer-stable]
include:
- laravel: 9.*
testbench: 7.*

name: P${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} - ${{ matrix.os }}

Expand All @@ -43,7 +40,7 @@ jobs:

- name: Install dependencies
run: |
composer require "laravel/framework:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update
composer require "illuminate/contracts=^${{ matrix.laravel }}" --no-interaction --no-update
composer update --${{ matrix.stability }} --prefer-dist --no-interaction

- name: Execute tests
Expand Down
9 changes: 4 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,12 @@
],
"require": {
"php": "^8.1",
"illuminate/contracts": "^9.5",
"illuminate/database": "^9.5",
"illuminate/support": "^9.5"
"illuminate/contracts": "^9.5|^10.0",
"illuminate/database": "^9.5|^10.0",
"illuminate/support": "^9.5|^10.0"
},
"require-dev": {
"nunomaduro/collision": "^6.0",
"orchestra/testbench": "^7.5",
"orchestra/testbench": "^7.5|^8.0",
"phpunit/phpunit": "^9.5"
},
"autoload": {
Expand Down
6 changes: 0 additions & 6 deletions src/Console/InstallCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@ class InstallCommand extends Command

/**
* Execute the console command.
*
* @return void
*/
public function handle(): void {
// Controllers...
Expand All @@ -49,7 +47,6 @@ public function handle(): void {
*
* @param string $originalFile The path of the original file.
* @param string $content The content to be appended.
* @return void
*/
protected function appendToFile(string $originalFile, string $content): void {
$original = file_get_contents($originalFile);
Expand All @@ -61,9 +58,6 @@ protected function appendToFile(string $originalFile, string $content): void {

/**
* Publish the provided resource path.
*
* @param string $path
* @return void
*/
protected function publishResource(string $path): void {
(new Filesystem)->ensureDirectoryExists(resource_path($path));
Expand Down
13 changes: 0 additions & 13 deletions src/LockScreen.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,6 @@ class LockScreen
/**
* Create a new middleware instance.
*
* @param ResponseFactory $responseFactory
* @param UrlGenerator $urlGenerator
* @param int|null $passwordTimeout
* @return void
*/
public function __construct(
Expand All @@ -27,12 +24,6 @@ public function __construct(

/**
* Handle an incoming request.
*
* @param Request $request
* @param Closure $next
* @param string|null $redirectToRoute
* @param int|null $passwordTimeoutSeconds
* @return mixed
*/
public function handle(Request $request, Closure $next, string $redirectToRoute = null, int $passwordTimeoutSeconds = null): mixed {
/** Bypass the middleware if the request is to the lock screen */
Expand Down Expand Up @@ -62,10 +53,6 @@ public function handle(Request $request, Closure $next, string $redirectToRoute

/**
* Determine if the account has been locked due to inactivity.
*
* @param Request $request
* @param int|null $passwordTimeoutSeconds
* @return bool
*/
protected function shouldConfirmPassword(Request $request, int $passwordTimeoutSeconds = null): bool {
if (!$request->session()->has('auth.latest_activity_at')) {
Expand Down
13 changes: 0 additions & 13 deletions src/LockScreenServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,6 @@ class LockScreenServiceProvider extends ServiceProvider
{
/**
* Bootstrap the application services.
*
* @param Router $router
* @return void
*/
public function boot(Router $router): void {
$this->defineAssetPublishing();
Expand All @@ -29,17 +26,13 @@ public function boot(Router $router): void {

/**
* Define the asset publishing configuration.
*
* @return void
*/
public function defineAssetPublishing(): void {
//
}

/**
* Register any application services.
*
* @return void
*/
public function register(): void {
$this->app->bind(LockScreen::class, function ($app) {
Expand All @@ -55,17 +48,13 @@ public function register(): void {

/**
* Set up the configuration.
*
* @return void
*/
protected function configure(): void {
$this->mergeConfigFrom(__DIR__.'/../config/lockscreen.php', 'lockscreen');
}

/**
* Set up the resource publishing groups.
*
* @return void
*/
protected function offerPublishing(): void {
if ($this->app->runningInConsole()) {
Expand All @@ -77,8 +66,6 @@ protected function offerPublishing(): void {

/**
* Register the Artisan commands.
*
* @return void
*/
protected function registerCommands(): void {
if ($this->app->runningInConsole()) {
Expand Down
4 changes: 0 additions & 4 deletions stubs/App/Http/Controllers/Auth/UnlockableController.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ class LockScreenController extends Controller
{
/**
* Show unlock account view.
*
* @return View
*/
public function show(): View {
return view('auth.locked');
Expand All @@ -23,8 +21,6 @@ public function show(): View {
/**
* Confirm the user's password.
*
* @param Request $request
* @return RedirectResponse
*
* @throws ValidationException
*/
Expand Down
8 changes: 0 additions & 8 deletions tests/LockScreenTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@ class LockScreenTest extends TestCase
{
/**
* Check if the user stores in session the last activity timestamp.
*
* @return void
*/
public function test_user_stores_last_activity_timestamp(): void {
$user = User::factory()->create();
Expand All @@ -36,8 +34,6 @@ public function test_user_stores_last_activity_timestamp(): void {

/**
* Check if the acount does not lock if the user interacts with the app.
*
* @return void
*/
public function test_account_not_locked_if_using_app(): void {
$user = User::factory()->create();
Expand Down Expand Up @@ -72,8 +68,6 @@ public function test_account_not_locked_if_using_app(): void {

/**
* Check if the account locks if the user last activity exceeds the specified TTL.
*
* @return void
*/
public function test_account_locks_exceeded_ttl(): void {
$user = User::factory()->create();
Expand Down Expand Up @@ -105,8 +99,6 @@ public function test_account_locks_exceeded_ttl(): void {

/**
* Check if the account locks if the user last activity exceeds the specified TTL (JSON response).
*
* @return void
*/
public function test_account_locks_exceeded_ttl_json(): void {
$user = User::factory()->create();
Expand Down
2 changes: 0 additions & 2 deletions tests/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ class User extends Authenticatable

/**
* Create a new factory instance for the model.
*
* @return Factory
*/
protected static function newFactory(): Factory {
return new UserFactory;
Expand Down
7 changes: 0 additions & 7 deletions tests/TestCase.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,6 @@ class TestCase extends Orchestra
{
/**
* Define database migrations.
*
* @return void
*/
protected function defineDatabaseMigrations(): void {
$this->loadLaravelMigrations();
Expand All @@ -35,10 +33,6 @@ protected function getPackageProviders($app): array {

/**
* Creates a custom request based on the provided method and URI.
*
* @param string $method
* @param string $uri
* @return Request
*/
public function createRequest(string $method, string $uri, array $headers = []): Request {
$symfonyRequest = SymfonyRequest::create($uri, $method, server: $headers);
Expand All @@ -53,7 +47,6 @@ public function createRequest(string $method, string $uri, array $headers = []):
* Define routes setup.
*
* @param Router $router
* @return void
*/
protected function defineRoutes($router): void {
$router->get('locked', fn () => 'Account locked')->name('locked');
Expand Down