Skip to content

Commit

Permalink
single indent of multiline chains (#10168)
Browse files Browse the repository at this point in the history
continuation of #10166
  • Loading branch information
browner12 authored Feb 17, 2025
1 parent d78a652 commit 0790883
Show file tree
Hide file tree
Showing 26 changed files with 425 additions and 424 deletions.
5 changes: 3 additions & 2 deletions cashier-paddle.md
Original file line number Diff line number Diff line change
Expand Up @@ -1081,8 +1081,9 @@ If you would like to offer trial periods to your customers while still collectin
use Illuminate\Http\Request;

Route::get('/user/subscribe', function (Request $request) {
$checkout = $request->user()->subscribe('pri_monthly')
->returnTo(route('home'));
$checkout = $request->user()
->subscribe('pri_monthly')
->returnTo(route('home'));

return view('billing', ['checkout' => $checkout]);
});
Expand Down
40 changes: 20 additions & 20 deletions console-tests.md
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,11 @@ You may test this command with the following test:
```php tab=Pest
test('console command', function () {
$this->artisan('question')
->expectsQuestion('What is your name?', 'Taylor Otwell')
->expectsQuestion('Which language do you prefer?', 'PHP')
->expectsOutput('Your name is Taylor Otwell and you prefer PHP.')
->doesntExpectOutput('Your name is Taylor Otwell and you prefer Ruby.')
->assertExitCode(0);
->expectsQuestion('What is your name?', 'Taylor Otwell')
->expectsQuestion('Which language do you prefer?', 'PHP')
->expectsOutput('Your name is Taylor Otwell and you prefer PHP.')
->doesntExpectOutput('Your name is Taylor Otwell and you prefer Ruby.')
->assertExitCode(0);
});
```

Expand All @@ -78,11 +78,11 @@ test('console command', function () {
public function test_console_command(): void
{
$this->artisan('question')
->expectsQuestion('What is your name?', 'Taylor Otwell')
->expectsQuestion('Which language do you prefer?', 'PHP')
->expectsOutput('Your name is Taylor Otwell and you prefer PHP.')
->doesntExpectOutput('Your name is Taylor Otwell and you prefer Ruby.')
->assertExitCode(0);
->expectsQuestion('What is your name?', 'Taylor Otwell')
->expectsQuestion('Which language do you prefer?', 'PHP')
->expectsOutput('Your name is Taylor Otwell and you prefer PHP.')
->doesntExpectOutput('Your name is Taylor Otwell and you prefer Ruby.')
->assertExitCode(0);
}
```

Expand All @@ -91,12 +91,12 @@ If you are utilizing the `search` or `multisearch` functions provided by [Larave
```php tab=Pest
test('console command', function () {
$this->artisan('example')
->expectsSearch('What is your name?', search: 'Tay', answers: [
->expectsSearch('What is your name?', search: 'Tay', answers: [
'Taylor Otwell',
'Taylor Swift',
'Darian Taylor'
], answer: 'Taylor Otwell')
->assertExitCode(0);
], answer: 'Taylor Otwell')
->assertExitCode(0);
});
```

Expand All @@ -107,12 +107,12 @@ test('console command', function () {
public function test_console_command(): void
{
$this->artisan('example')
->expectsSearch('What is your name?', search: 'Tay', answers: [
->expectsSearch('What is your name?', search: 'Tay', answers: [
'Taylor Otwell',
'Taylor Swift',
'Darian Taylor'
], answer: 'Taylor Otwell')
->assertExitCode(0);
], answer: 'Taylor Otwell')
->assertExitCode(0);
}
```

Expand All @@ -121,8 +121,8 @@ You may also assert that a console command does not generate any output using th
```php tab=Pest
test('console command', function () {
$this->artisan('example')
->doesntExpectOutput()
->assertExitCode(0);
->doesntExpectOutput()
->assertExitCode(0);
});
```

Expand All @@ -143,8 +143,8 @@ The `expectsOutputToContain` and `doesntExpectOutputToContain` methods may be us
```php tab=Pest
test('console command', function () {
$this->artisan('example')
->expectsOutputToContain('Taylor')
->assertExitCode(0);
->expectsOutputToContain('Taylor')
->assertExitCode(0);
});
```

Expand Down
48 changes: 24 additions & 24 deletions container.md
Original file line number Diff line number Diff line change
Expand Up @@ -222,16 +222,16 @@ Sometimes you may have two classes that utilize the same interface, but you wish
use Illuminate\Support\Facades\Storage;

$this->app->when(PhotoController::class)
->needs(Filesystem::class)
->give(function () {
return Storage::disk('local');
});
->needs(Filesystem::class)
->give(function () {
return Storage::disk('local');
});

$this->app->when([VideoController::class, UploadController::class])
->needs(Filesystem::class)
->give(function () {
return Storage::disk('s3');
});
->needs(Filesystem::class)
->give(function () {
return Storage::disk('s3');
});

<a name="contextual-attributes"></a>
### Contextual Attributes
Expand Down Expand Up @@ -349,8 +349,8 @@ Sometimes you may have a class that receives some injected classes, but also nee
use App\Http\Controllers\UserController;

$this->app->when(UserController::class)
->needs('$variableName')
->give($value);
->needs('$variableName')
->give($value);

Sometimes a class may depend on an array of [tagged](#tagging) instances. Using the `giveTagged` method, you may easily inject all of the container bindings with that tag:

Expand Down Expand Up @@ -397,24 +397,24 @@ Occasionally, you may have a class that receives an array of typed objects using
Using contextual binding, you may resolve this dependency by providing the `give` method with a closure that returns an array of resolved `Filter` instances:

$this->app->when(Firewall::class)
->needs(Filter::class)
->give(function (Application $app) {
return [
$app->make(NullFilter::class),
$app->make(ProfanityFilter::class),
$app->make(TooLongFilter::class),
];
});
->needs(Filter::class)
->give(function (Application $app) {
return [
$app->make(NullFilter::class),
$app->make(ProfanityFilter::class),
$app->make(TooLongFilter::class),
];
});

For convenience, you may also just provide an array of class names to be resolved by the container whenever `Firewall` needs `Filter` instances:

$this->app->when(Firewall::class)
->needs(Filter::class)
->give([
NullFilter::class,
ProfanityFilter::class,
TooLongFilter::class,
]);
->needs(Filter::class)
->give([
NullFilter::class,
ProfanityFilter::class,
TooLongFilter::class,
]);

<a name="variadic-tag-dependencies"></a>
#### Variadic Tag Dependencies
Expand Down
6 changes: 3 additions & 3 deletions controllers.md
Original file line number Diff line number Diff line change
Expand Up @@ -208,9 +208,9 @@ Typically, a 404 HTTP response will be generated if an implicitly bound resource
use Illuminate\Support\Facades\Redirect;

Route::resource('photos', PhotoController::class)
->missing(function (Request $request) {
return Redirect::route('photos.index');
});
->missing(function (Request $request) {
return Redirect::route('photos.index');
});

<a name="soft-deleted-models"></a>
#### Soft Deleted Models
Expand Down
8 changes: 4 additions & 4 deletions database.md
Original file line number Diff line number Diff line change
Expand Up @@ -464,10 +464,10 @@ public function boot(): void
{
Event::listen(function (DatabaseBusy $event) {
Notification::route('mail', '[email protected]')
->notify(new DatabaseApproachingMaxConnections(
$event->connectionName,
$event->connections
));
->notify(new DatabaseApproachingMaxConnections(
$event->connectionName,
$event->connections
));
});
}
```
Loading

0 comments on commit 0790883

Please sign in to comment.