Skip to content

[12.x] Fix hyphenation of closure-based for grammatical correctness and consistency #10406

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

Merged
merged 1 commit into from
May 19, 2025
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
6 changes: 3 additions & 3 deletions artisan.md
Original file line number Diff line number Diff line change
Expand Up @@ -184,9 +184,9 @@ $this->fail('Something went wrong.');
<a name="closure-commands"></a>
### Closure Commands

Closure based commands provide an alternative to defining console commands as classes. In the same way that route closures are an alternative to controllers, think of command closures as an alternative to command classes.
Closure-based commands provide an alternative to defining console commands as classes. In the same way that route closures are an alternative to controllers, think of command closures as an alternative to command classes.

Even though the `routes/console.php` file does not define HTTP routes, it defines console based entry points (routes) into your application. Within this file, you may define all of your closure based console commands using the `Artisan::command` method. The `command` method accepts two arguments: the [command signature](#defining-input-expectations) and a closure which receives the command's arguments and options:
Even though the `routes/console.php` file does not define HTTP routes, it defines console based entry points (routes) into your application. Within this file, you may define all of your closure-based console commands using the `Artisan::command` method. The `command` method accepts two arguments: the [command signature](#defining-input-expectations) and a closure which receives the command's arguments and options:

```php
Artisan::command('mail:send {user}', function (string $user) {
Expand All @@ -213,7 +213,7 @@ Artisan::command('mail:send {user}', function (DripEmailer $drip, string $user)
<a name="closure-command-descriptions"></a>
#### Closure Command Descriptions

When defining a closure based command, you may use the `purpose` method to add a description to the command. This description will be displayed when you run the `php artisan list` or `php artisan help` commands:
When defining a closure-based command, you may use the `purpose` method to add a description to the command. This description will be displayed when you run the `php artisan list` or `php artisan help` commands:

```php
Artisan::command('mail:send {user}', function (string $user) {
Expand Down
6 changes: 3 additions & 3 deletions eloquent-factories.md
Original file line number Diff line number Diff line change
Expand Up @@ -365,7 +365,7 @@ $user = User::factory()
->create();
```

Of course, you may perform state manipulations on the related models. In addition, you may pass a closure based state transformation if your state change requires access to the parent model:
Of course, you may perform state manipulations on the related models. In addition, you may pass a closure-based state transformation if your state change requires access to the parent model:

```php
$user = User::factory()
Expand Down Expand Up @@ -400,7 +400,7 @@ $user = User::factory()
->create();
```

You may provide a closure based state transformation if your state change requires access to the parent model:
You may provide a closure-based state transformation if your state change requires access to the parent model:

```php
$user = User::factory()
Expand Down Expand Up @@ -483,7 +483,7 @@ $user = User::factory()
->create();
```

You may provide a closure based state transformation if your state change requires access to the related model:
You may provide a closure-based state transformation if your state change requires access to the related model:

```php
$user = User::factory()
Expand Down
2 changes: 1 addition & 1 deletion events.md
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ public function boot(): void
<a name="queuable-anonymous-event-listeners"></a>
#### Queueable Anonymous Event Listeners

When registering closure based event listeners, you may wrap the listener closure within the `Illuminate\Events\queueable` function to instruct Laravel to execute the listener using the [queue](/docs/{{version}}/queues):
When registering closure-based event listeners, you may wrap the listener closure within the `Illuminate\Events\queueable` function to instruct Laravel to execute the listener using the [queue](/docs/{{version}}/queues):

```php
use App\Events\PodcastProcessed;
Expand Down
2 changes: 1 addition & 1 deletion pennant.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ For convenience, if a feature definition only returns a lottery, you may omit th
<a name="class-based-features"></a>
### Class Based Features

Pennant also allows you to define class based features. Unlike closure based feature definitions, there is no need to register a class based feature in a service provider. To create a class based feature, you may invoke the `pennant:feature` Artisan command. By default the feature class will be placed in your application's `app/Features` directory:
Pennant also allows you to define class based features. Unlike closure-based feature definitions, there is no need to register a class based feature in a service provider. To create a class based feature, you may invoke the `pennant:feature` Artisan command. By default the feature class will be placed in your application's `app/Features` directory:

```shell
php artisan pennant:feature NewApi
Expand Down
2 changes: 1 addition & 1 deletion structure.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ The `routes` directory contains all of the route definitions for your applicatio

The `web.php` file contains routes that Laravel places in the `web` middleware group, which provides session state, CSRF protection, and cookie encryption. If your application does not offer a stateless, RESTful API then all your routes will most likely be defined in the `web.php` file.

The `console.php` file is where you may define all of your closure based console commands. Each closure is bound to a command instance allowing a simple approach to interacting with each command's IO methods. Even though this file does not define HTTP routes, it defines console based entry points (routes) into your application. You may also [schedule](/docs/{{version}}/scheduling) tasks in the `console.php` file.
The `console.php` file is where you may define all of your closure-based console commands. Each closure is bound to a command instance allowing a simple approach to interacting with each command's IO methods. Even though this file does not define HTTP routes, it defines console based entry points (routes) into your application. You may also [schedule](/docs/{{version}}/scheduling) tasks in the `console.php` file.

Optionally, you may install additional route files for API routes (`api.php`) and broadcasting channels (`channels.php`), via the `install:api` and `install:broadcasting` Artisan commands.

Expand Down
2 changes: 1 addition & 1 deletion views.md
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ class AppServiceProvider extends ServiceProvider
// Using class based composers...
Facades\View::composer('profile', ProfileComposer::class);

// Using closure based composers...
// Using closure-based composers...
Facades\View::composer('welcome', function (View $view) {
// ...
});
Expand Down