Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update fixture app #342

Merged
merged 1 commit into from
Jul 10, 2023
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
4 changes: 2 additions & 2 deletions tests/fixtures/laravel/.editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ root = true
[*]
charset = utf-8
end_of_line = lf
insert_final_newline = true
indent_style = space
indent_size = 4
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.md]
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/laravel/.env.example
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ REDIS_PASSWORD=null
REDIS_PORT=6379

MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_HOST=mailpit
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/laravel/.gitattributes
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
* text=auto
* text=auto eol=lf

*.blade.php diff=html
*.css diff=css
Expand Down
3 changes: 3 additions & 0 deletions tests/fixtures/laravel/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/.phpunit.cache
/node_modules
/public/build
/public/hot
Expand All @@ -6,11 +7,13 @@
/vendor
.env
.env.backup
.env.production
.phpunit.result.cache
Homestead.json
Homestead.yaml
auth.json
npm-debug.log
yarn-error.log
/.fleet
/.idea
/.vscode
2 changes: 1 addition & 1 deletion tests/fixtures/laravel/README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<p align="center"><a href="https://laravel.com" target="_blank"><img src="https://raw.githubusercontent.com/laravel/art/master/logo-lockup/5%20SVG/2%20CMYK/1%20Full%20Color/laravel-logolockup-cmyk-red.svg" width="400" alt="Laravel Logo"></a></p>

<p align="center">
<a href="https://travis-ci.org/laravel/framework"><img src="https://travis-ci.org/laravel/framework.svg" alt="Build Status"></a>
<a href="https://github.com/laravel/framework/actions"><img src="https://github.com/laravel/framework/workflows/tests/badge.svg" alt="Build Status"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/dt/laravel/framework" alt="Total Downloads"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/v/laravel/framework" alt="Latest Stable Version"></a>
<a href="https://packagist.org/packages/laravel/framework"><img src="https://img.shields.io/packagist/l/laravel/framework" alt="License"></a>
Expand Down
9 changes: 2 additions & 7 deletions tests/fixtures/laravel/app/Console/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,16 @@ class Kernel extends ConsoleKernel
{
/**
* Define the application's command schedule.
*
* @param \Illuminate\Console\Scheduling\Schedule $schedule
* @return void
*/
protected function schedule(Schedule $schedule)
protected function schedule(Schedule $schedule): void
{
// $schedule->command('inspire')->hourly();
}

/**
* Register the commands for the application.
*
* @return void
*/
protected function commands()
protected function commands(): void
{
$this->load(__DIR__.'/Commands');

Expand Down
24 changes: 2 additions & 22 deletions tests/fixtures/laravel/app/Exceptions/Handler.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,7 @@
class Handler extends ExceptionHandler
{
/**
* A list of exception types with their corresponding custom log levels.
*
* @var array<class-string<\Throwable>, \Psr\Log\LogLevel::*>
*/
protected $levels = [
//
];

/**
* A list of the exception types that are not reported.
*
* @var array<int, class-string<\Throwable>>
*/
protected $dontReport = [
//
];

/**
* A list of the inputs that are never flashed to the session on validation exceptions.
* The list of the inputs that are never flashed to the session on validation exceptions.
*
* @var array<int, string>
*/
Expand All @@ -38,10 +20,8 @@ class Handler extends ExceptionHandler

/**
* Register the exception handling callbacks for the application.
*
* @return void
*/
public function register()
public function register(): void
{
$this->reportable(function (Throwable $e) {
//
Expand Down
3 changes: 1 addition & 2 deletions tests/fixtures/laravel/app/Http/Controllers/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
namespace App\Http\Controllers;

use Illuminate\Foundation\Auth\Access\AuthorizesRequests;
use Illuminate\Foundation\Bus\DispatchesJobs;
use Illuminate\Foundation\Validation\ValidatesRequests;
use Illuminate\Routing\Controller as BaseController;

class Controller extends BaseController
{
use AuthorizesRequests, DispatchesJobs, ValidatesRequests;
use AuthorizesRequests, ValidatesRequests;
}
9 changes: 5 additions & 4 deletions tests/fixtures/laravel/app/Http/Kernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,26 +40,27 @@ class Kernel extends HttpKernel

'api' => [
// \Laravel\Sanctum\Http\Middleware\EnsureFrontendRequestsAreStateful::class,
'throttle:api',
\Illuminate\Routing\Middleware\ThrottleRequests::class.':api',
\Illuminate\Routing\Middleware\SubstituteBindings::class,
],
];

/**
* The application's route middleware.
* The application's middleware aliases.
*
* These middleware may be assigned to groups or used individually.
* Aliases may be used instead of class names to conveniently assign middleware to routes and groups.
*
* @var array<string, class-string|string>
*/
protected $routeMiddleware = [
protected $middlewareAliases = [
'auth' => \App\Http\Middleware\Authenticate::class,
'auth.basic' => \Illuminate\Auth\Middleware\AuthenticateWithBasicAuth::class,
'auth.session' => \Illuminate\Session\Middleware\AuthenticateSession::class,
'cache.headers' => \Illuminate\Http\Middleware\SetCacheHeaders::class,
'can' => \Illuminate\Auth\Middleware\Authorize::class,
'guest' => \App\Http\Middleware\RedirectIfAuthenticated::class,
'password.confirm' => \Illuminate\Auth\Middleware\RequirePassword::class,
'precognitive' => \Illuminate\Foundation\Http\Middleware\HandlePrecognitiveRequests::class,
'signed' => \App\Http\Middleware\ValidateSignature::class,
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
Expand Down
10 changes: 3 additions & 7 deletions tests/fixtures/laravel/app/Http/Middleware/Authenticate.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,15 @@
namespace App\Http\Middleware;

use Illuminate\Auth\Middleware\Authenticate as Middleware;
use Illuminate\Http\Request;

class Authenticate extends Middleware
{
/**
* Get the path the user should be redirected to when they are not authenticated.
*
* @param \Illuminate\Http\Request $request
* @return string|null
*/
protected function redirectTo($request)
protected function redirectTo(Request $request): ?string
{
if (! $request->expectsJson()) {
return route('login');
}
return $request->expectsJson() ? null : route('login');
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@
use Closure;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Auth;
use Symfony\Component\HttpFoundation\Response;

class RedirectIfAuthenticated
{
/**
* Handle an incoming request.
*
* @param \Illuminate\Http\Request $request
* @param \Closure(\Illuminate\Http\Request): (\Illuminate\Http\Response|\Illuminate\Http\RedirectResponse) $next
* @param string|null ...$guards
* @return \Illuminate\Http\Response|\Illuminate\Http\RedirectResponse
* @param \Closure(\Illuminate\Http\Request): (\Symfony\Component\HttpFoundation\Response) $next
*/
public function handle(Request $request, Closure $next, ...$guards)
public function handle(Request $request, Closure $next, string ...$guards): Response
{
$guards = empty($guards) ? [null] : $guards;

Expand Down
2 changes: 1 addition & 1 deletion tests/fixtures/laravel/app/Http/Middleware/TrustHosts.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ class TrustHosts extends Middleware
*
* @return array<int, string|null>
*/
public function hosts()
public function hosts(): array
{
return [
$this->allSubdomainsOfApplicationUrl(),
Expand Down
1 change: 1 addition & 0 deletions tests/fixtures/laravel/app/Models/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,5 +40,6 @@ class User extends Authenticatable
*/
protected $casts = [
'email_verified_at' => 'datetime',
'password' => 'hashed',
];
}
8 changes: 2 additions & 6 deletions tests/fixtures/laravel/app/Providers/AppServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,20 +8,16 @@ class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*
* @return void
*/
public function register()
public function register(): void
{
//
}

/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
public function boot(): void
{
//
}
Expand Down
8 changes: 2 additions & 6 deletions tests/fixtures/laravel/app/Providers/AuthServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,18 +13,14 @@ class AuthServiceProvider extends ServiceProvider
* @var array<class-string, class-string>
*/
protected $policies = [
// 'App\Models\Model' => 'App\Policies\ModelPolicy',
//
];

/**
* Register any authentication / authorization services.
*
* @return void
*/
public function boot()
public function boot(): void
{
$this->registerPolicies();

//
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@ class BroadcastServiceProvider extends ServiceProvider
{
/**
* Bootstrap any application services.
*
* @return void
*/
public function boot()
public function boot(): void
{
Broadcast::routes();

Expand Down
8 changes: 2 additions & 6 deletions tests/fixtures/laravel/app/Providers/EventServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,16 @@ class EventServiceProvider extends ServiceProvider

/**
* Register any events for your application.
*
* @return void
*/
public function boot()
public function boot(): void
{
//
}

/**
* Determine if events and listeners should be automatically discovered.
*
* @return bool
*/
public function shouldDiscoverEvents()
public function shouldDiscoverEvents(): bool
{
return false;
}
Expand Down
22 changes: 5 additions & 17 deletions tests/fixtures/laravel/app/Providers/RouteServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
class RouteServiceProvider extends ServiceProvider
{
/**
* The path to the "home" route for your application.
* The path to your application's "home" route.
*
* Typically, users are redirected here after authentication.
*
Expand All @@ -21,12 +21,12 @@ class RouteServiceProvider extends ServiceProvider

/**
* Define your route model bindings, pattern filters, and other route configuration.
*
* @return void
*/
public function boot()
public function boot(): void
{
$this->configureRateLimiting();
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
});

$this->routes(function () {
Route::middleware('api')
Expand All @@ -37,16 +37,4 @@ public function boot()
->group(base_path('routes/web.php'));
});
}

/**
* Configure the rate limiters for the application.
*
* @return void
*/
protected function configureRateLimiting()
{
RateLimiter::for('api', function (Request $request) {
return Limit::perMinute(60)->by($request->user()?->id ?: $request->ip());
});
}
}
25 changes: 13 additions & 12 deletions tests/fixtures/laravel/composer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
{
"name": "laravel/laravel",
"type": "project",
"description": "The Laravel Framework.",
"keywords": ["framework", "laravel"],
"description": "The skeleton application for the Laravel framework.",
"keywords": ["laravel", "framework"],
"license": "MIT",
"require": {
"php": "^8.0.2",
"php": "^8.1",
"guzzlehttp/guzzle": "^7.2",
"laravel/framework": "^9.19",
"laravel/sanctum": "^3.0",
"laravel/tinker": "^2.7"
"laravel/framework": "^10.10",
"laravel/sanctum": "^3.2",
"laravel/tinker": "^2.8"
},
"require-dev": {
"fakerphp/faker": "^1.9.1",
"laravel/pint": "^1.0",
"laravel/sail": "^1.0.1",
"laravel/sail": "^1.18",
"mockery/mockery": "^1.4.4",
"nunomaduro/collision": "^6.1",
"phpunit/phpunit": "^9.5.10",
"spatie/laravel-ignition": "^1.0"
"nunomaduro/collision": "^7.0",
"phpunit/phpunit": "^10.1",
"spatie/laravel-ignition": "^2.0"
},
"autoload": {
"psr-4": {
Expand Down Expand Up @@ -57,9 +57,10 @@
"preferred-install": "dist",
"sort-packages": true,
"allow-plugins": {
"pestphp/pest-plugin": true
"pestphp/pest-plugin": true,
"php-http/discovery": true
}
},
"minimum-stability": "dev",
"minimum-stability": "stable",
"prefer-stable": true
}
Loading