Skip to content

Commit e3f02f3

Browse files
committed
Fix typos and update code formatting in documentation
1 parent ee293c9 commit e3f02f3

26 files changed

Lines changed: 77 additions & 73 deletions

docs/guide/artisan-generators.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ php artisan sharp:make:policy <class_name> [--entity-only]
3434
php artisan sharp:make:entity-command <class_name> [--model=<model_name>,--wizard,--form]
3535

3636
# Generate an Instance Command
37-
php artisan sharp:make:intance-command <class_name> [--model=<model_name>,--wizard,--form]
37+
php artisan sharp:make:instance-command <class_name> [--model=<model_name>,--wizard,--form]
3838

3939
# Generate a Entity List Filter
4040
php artisan sharp:make:entity-list-filter <class_name> [--required,--multiple,--date-range,--check]

docs/guide/authentication-2fa.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class SharpServiceProvider extends SharpAppServiceProvider
1111
->enable2faByNotification()
1212
// or ->enable2faByTotp()
1313
// or ->enable2faCustom()
14-
// [...]
14+
// ...
1515
}
1616
}
1717
```
@@ -36,7 +36,7 @@ class SharpServiceProvider extends SharpAppServiceProvider
3636
{
3737
$config
3838
->enable2faCustom(\App\Sharp\My2faNotificationHandler::class)
39-
// [...]
39+
// ...
4040
}
4141
}
4242
```
@@ -75,7 +75,7 @@ class SharpServiceProvider extends SharpAppServiceProvider
7575
{
7676
$config
7777
->enable2faByTotp()
78-
// [...]
78+
// ...
7979
}
8080
}
8181
```

docs/guide/authentication-passkeys.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ class SharpServiceProvider extends SharpAppServiceProvider
1818
{
1919
$config
2020
->enablePasskeys()
21-
// [...]
21+
// ...
2222
}
2323
}
2424
```
@@ -45,7 +45,7 @@ class ProfileSingleShow extends SharpSingleShow
4545
protected function buildShowFields(FieldsContainer $showFields): void
4646
{
4747
$showFields
48-
// [...]
48+
// ...
4949
->addField(
5050
SharpShowEntityListField::make(PasskeyEntity::class)
5151
->setLabel('Passkeys')
@@ -56,7 +56,7 @@ class ProfileSingleShow extends SharpSingleShow
5656
{
5757
$showLayout
5858
->addSection('', function (ShowLayoutSection $section) {
59-
// [...]
59+
// ...
6060
})
6161
->addEntityListSection(PasskeyEntity::class);
6262
}

docs/guide/authentication.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ class SharpServiceProvider extends SharpAppServiceProvider
1515
->setLoginAttributes('login', 'pwd')
1616
->setUserDisplayAttribute('last_name')
1717
->setUserAvatarAttribute('avatar_url')
18-
// [...]
18+
// ...
1919
}
2020
}
2121
```
@@ -37,7 +37,7 @@ class SharpServiceProvider extends SharpAppServiceProvider
3737
$config
3838
->suggestRememberMeOnLoginForm()
3939
->enableLoginRateLimiting(maxAttemps: 3)
40-
// [...]
40+
// ...
4141
}
4242
}
4343
```
@@ -53,7 +53,7 @@ A simple way to restrict access to Sharp is to define the `viewSharp` global Gat
5353
```php
5454
class SharpServiceProvider extends SharpAppServiceProvider
5555
{
56-
// [...]
56+
// ...
5757

5858
public function declareAccessGate(): void
5959
{
@@ -75,7 +75,7 @@ class SharpServiceProvider extends SharpAppServiceProvider
7575
{
7676
$config
7777
->setAuthCustomGuard('sharp')
78-
// [...]
78+
// ...
7979
}
8080
}
8181
```
@@ -93,7 +93,7 @@ class SharpServiceProvider extends SharpAppServiceProvider
9393
{
9494
$config
9595
->enableForgottenPassword()
96-
// [...]
96+
// ...
9797
}
9898
}
9999
```
@@ -112,7 +112,7 @@ class SharpServiceProvider extends SharpAppServiceProvider
112112
->enableForgottenPassword(resetCallback: function ($user, $password) {
113113
$user->updatePasswordAfterReset($password);
114114
})
115-
// [...]
115+
// ...
116116
}
117117
}
118118
```
@@ -126,7 +126,7 @@ class SharpServiceProvider extends SharpAppServiceProvider
126126
{
127127
$config
128128
->enableForgottenPassword(broker: MyPasswordBroker::class)
129-
// [...]
129+
// ...
130130
}
131131
}
132132
```
@@ -140,7 +140,7 @@ class SharpServiceProvider extends SharpAppServiceProvider
140140
{
141141
$config
142142
->enableForgottenPassword(showResetLinkInLoginForm: false)
143-
// [...]
143+
// ...
144144
}
145145
}
146146
```
@@ -215,7 +215,7 @@ class SharpServiceProvider extends SharpAppServiceProvider
215215
{
216216
$config
217217
->enableImpersonation()
218-
// [...]
218+
// ...
219219
}
220220
}
221221
```
@@ -286,7 +286,7 @@ class SharpServiceProvider extends SharpAppServiceProvider
286286
$config
287287
->redirectLoginToUrl('/my_login')
288288
->redirectLogoutToUrl('/my_logout')
289-
// [...]
289+
// ...
290290
}
291291
}
292292
```

docs/guide/building-dashboard.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ This method is meant to host the code responsible for the declaration and config
2727
```php
2828
class SalesDashboard extends SharpDashboard
2929
{
30-
// [...]
30+
// ...
3131
function buildWidgets(WidgetsContainer $widgetsContainer): void
3232
{
3333
$widgetsContainer

docs/guide/building-entity-list.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ First let's write the applicative class, and make it extend `Code16\Sharp\Entity
2222
- `buildList(EntityListFieldsContainer $fields)` for the structure,
2323
- and `getListData()` for the actual data of the list.
2424

25-
There are a two more optional methods, for the list config and instance deletion.
25+
There are two more optional methods, for the list config and instance deletion.
2626
Each one is detailed here:
2727

2828
### `buildList(EntityListFieldsContainer $fields)`
@@ -44,7 +44,7 @@ class ProductList extends SharpEntityList
4444
)
4545
->addField(/* ... */);
4646
}
47-
// [...]
47+
// ...
4848
}
4949
```
5050

@@ -103,7 +103,7 @@ class ProductList extends SharpEntityList
103103
]
104104
];
105105
}
106-
// [...]
106+
// ...
107107
}
108108
```
109109

@@ -229,7 +229,7 @@ Here is the full list of available methods:
229229

230230
- `configureDefaultSort(string $sortBy, string $sortDir = "asc")`: `EntityListQueryParams $queryParams` will be filled with this default value (see above)
231231

232-
- `configureEntityMap(string $attribute, EntityListEntities $entities)`: configure an Entity Map to display multiple entities in a single Entity List; [see detailed section](#entity-map) above.
232+
- `configureEntityMap(string $attribute, EntityListEntities $entities)`: configure an Entity Map to display multiple entities in a single Entity List; [see detailed section](#entity-map) below.
233233

234234
- `configurePageAlert(string $template, string $alertLevel = null, string $fieldKey = null, bool $declareTemplateAsPath = false)`: display a dynamic message above the list; [see detailed doc](page-alerts.md)
235235

@@ -239,7 +239,7 @@ Here is the full list of available methods:
239239

240240
- `configureQuickCreationForm(?array $fields = null)`: show the creation form in a modal instead of a full page ([see detailed doc](quick-creation-form.md))
241241

242-
- `configureDelete(bool $hide = false, ?string $onfirmationText = null)`: the first argument is to show / hide the delete command on each instance (shown by default); this is only useful to hide the link if you want to only display the delete action in the Show Page (if you have defined one), this is NOT to be used for authorization purpose (see [dedicated documentation on this topic](entity-authorizations.md)). The second argument is the message to display in the confirmation dialog (a sensible default will be used).
242+
- `configureDelete(bool $hide = false, ?string $confirmationText = null)`: the first argument is to show / hide the delete command on each instance (shown by default); this is only useful to hide the link if you want to only display the delete action in the Show Page (if you have defined one), this is NOT to be used for authorization purpose (see [dedicated documentation on this topic](entity-authorizations.md)). The second argument is the message to display in the confirmation dialog (a sensible default will be used).
243243

244244
- `configureCreateButtonLabel(string $label)` to set a custom "New..." button label.
245245

docs/guide/building-form.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ sidebarDepth: 3
44

55
# Create a Form
66

7-
Forms as used to create or update instances.
7+
Forms are used to create or update instances.
88

99
## Generator
1010

@@ -423,7 +423,7 @@ class ProductForm extends SharpForm
423423
public function buildFormConfig(): void
424424
{
425425
$this->configureBreadcrumbCustomLabelAttribute('name')
426-
->setDisplayShowPageAfterCreation();
426+
->configureDisplayShowPageAfterCreation();
427427
}
428428
}
429429
```

docs/guide/building-menu.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class SharpServiceProvider extends SharpAppServiceProvider
4141
```
4242

4343
::: info
44-
The `SharpServiceProvider` class is created bye the `sharp:install` artisan command; in case you don't have it, you can create it by yourself in the `App\Providers` namespace, or use the `sharp:make:provider` command.
44+
The `SharpServiceProvider` class is created by the `sharp:install` artisan command; in case you don't have it, you can create it by yourself in the `App\Providers` namespace, or use the `sharp:make:provider` command.
4545
:::
4646

4747
### Link to an Entity List, a Dashboard or to a single Show Page

docs/guide/building-show-page.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ First we build a class dedicated to our Show Page extending `Code16\Sharp\Show\S
2424

2525
- `buildShowFields(FieldsContainer $showFields)` and `buildShowLayout(ShowLayout $showLayout)` to declare the fields presenting the instance.
2626
- `find($id): array` to retrieve the instance.
27-
- `delete($id): void` to delete the instance.
27+
- [optional] `delete($id): void` to delete the instance.
2828
- `buildShowConfig()` (optional).
2929

3030
In detail:
@@ -262,7 +262,8 @@ class MyShow extends SharpShow
262262
->setCustomTransformer(
263263
'picture',
264264
new SharpUploadModelThumbnailUrlTransformer(600)
265-
);
265+
)
266+
->transform(Product::findOrFail($id));
266267
}
267268
}
268269
```

docs/guide/commands-wizard.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Instead of `execute()`, you must implement `executeFirstStep(array $data): array
3232
```php
3333
class SendEmailWithPostsWizardCommand extends EntityWizardCommand
3434
{
35-
// [...]
35+
// ...
3636

3737
public function executeFirstStep(array $data): array
3838
{
@@ -50,7 +50,7 @@ Wizard Commands needs forms, one for each step. To build the forms, we use the s
5050
```php
5151
class SendEmailWithPostsWizardCommand extends EntityWizardCommand
5252
{
53-
// [...]
53+
// ...
5454

5555
public function buildFormFieldsForFirstStep(FieldsContainer $formFields): void
5656
{
@@ -109,7 +109,7 @@ If your Wizard is small, this could be the right way to proceed. Simply extend t
109109
```php
110110
class SendEmailWithPostsWizardCommand extends EntityWizardCommand
111111
{
112-
// [...]
112+
// ...
113113

114114
protected function buildFormFieldsForStep(string $step, FieldsContainer $formFields): void
115115
{
@@ -133,7 +133,7 @@ This should be a better option in many cases, to clarify things in the Wizard cl
133133
```php
134134
class SendEmailWithPostsWizardCommand extends EntityWizardCommand
135135
{
136-
// [...]
136+
// ...
137137

138138
public function buildFormFieldsForStepComposeMessage(FieldsContainer $formFields): void
139139
{
@@ -200,7 +200,7 @@ Entity and Dashboard case:
200200
```php
201201
class SendEmailWithPostsWizardCommand extends EntityWizardCommand
202202
{
203-
// [...]
203+
// ...
204204

205205
public function executeStep(string $step, array $data = []): array
206206
{
@@ -277,7 +277,7 @@ Consider the following example; first we build and execute the first step; in th
277277
```php
278278
class SendEmailWithPostsWizardCommand extends EntityWizardCommand
279279
{
280-
// [...]
280+
// ...
281281

282282
public function buildFormFieldsForFirstStep(FieldsContainer $formFields): void
283283
{
@@ -303,7 +303,7 @@ For the `compose_message` step, we initialize data based on what is in the conte
303303
```php
304304
class SendEmailWithPostsWizardCommand extends EntityWizardCommand
305305
{
306-
// [...]
306+
// ...
307307

308308
protected function initialDataForStepComposeMessage(): array
309309
{
@@ -328,7 +328,7 @@ We build the form, and store a result useful for the next step in the context (a
328328
```php
329329
class SendEmailWithPostsWizardCommand extends EntityWizardCommand
330330
{
331-
// [...]
331+
// ...
332332

333333
public function buildFormFieldsForStepComposeMessage(FieldsContainer $formFields): void
334334
{

0 commit comments

Comments
 (0)