Skip to content

Commit 189017e

Browse files
authored
Merge pull request #903 from codeigniter4/datamweb-fix-docs
docs: fix small items
2 parents 6c7ffb2 + fef4ff3 commit 189017e

File tree

6 files changed

+23
-9
lines changed

6 files changed

+23
-9
lines changed

docs/addons/jwt.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,10 @@ To use JWT Authentication, you need additional setup and configuration.
3333
2. Copy the **AuthJWT.php** from **vendor/codeigniter4/shield/src/Config/** into your project's config folder and update the namespace to `Config`. You will also need to have these classes extend the original classes. See the example below.
3434

3535
```php
36-
// new file - app/Config/AuthJWT.php
3736
<?php
38-
37+
38+
// app/Config/AuthJWT.php
39+
3940
declare(strict_types=1);
4041

4142
namespace Config;
@@ -140,7 +141,10 @@ $routes->post('auth/jwt', '\App\Controllers\Auth\LoginController::jwtLogin');
140141
```
141142

142143
```php
144+
<?php
145+
143146
// app/Controllers/Auth/LoginController.php
147+
144148
declare(strict_types=1);
145149

146150
namespace App\Controllers\Auth;
@@ -260,6 +264,7 @@ file itself:
260264
$routes->group('api', ['filter' => 'jwt'], static function ($routes) {
261265
// ...
262266
});
267+
263268
$routes->get('users', 'UserController::list', ['filter' => 'jwt']);
264269
```
265270

docs/customization/integrating_custom_view_libs.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ If your application uses a different method to convert view files to HTML than C
55
All controllers and actions use the `CodeIgniter\Shield\Traits\Viewable` trait which provides a simple `view()` method that takes the same arguments as the `view()` helper. This allows you to extend the Action or Controller and only change the single method of rendering the view, leaving all of the logic untouched so your app will not need to maintain Shield logic when it doesn't need to change it.
66

77
```php
8+
<?php
9+
10+
declare(strict_types=1);
11+
12+
namespace App\Controllers;
13+
814
use Acme\Themes\Traits\Themeable;
915
use CodeIgniter\Shield\Controllers\LoginController;
1016

docs/getting_started/concepts.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ systems that are appropriate for your application. The following Validators are
7070
You can choose which validators are used in `Config\Auth::$passwordValidators`:
7171

7272
```php
73-
public $passwordValidators = [
73+
public array $passwordValidators = [
7474
CompositionValidator::class,
7575
NothingPersonalValidator::class,
7676
DictionaryValidator::class,

docs/guides/mobile_apps.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,15 @@ Typically, a mobile application would issue a request from their login screen, p
99
Start by creating a route that would handle the request from the login screen on the mobile device. The device name can be any arbitrary string, but is typically used to identify the device the request is being made from, like "Johns iPhone 13".
1010

1111
```php
12-
1312
// Routes.php
1413
$routes->post('auth/token', '\App\Controllers\Auth\LoginController::mobileLogin');
14+
```
15+
16+
```php
17+
<?php
18+
19+
// app/Controllers/Auth/LoginController.php
1520

16-
// LoginController.php
1721
namespace App\Controllers\Auth;
1822

1923
use App\Controllers\BaseController;

docs/references/authentication/authentication.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ You can see the [Authenticator List](../../getting_started/authenticators.md).
1212
The available authenticators are defined in `Config\Auth`:
1313

1414
```php
15-
public $authenticators = [
15+
public array $authenticators = [
1616
// alias => classname
1717
'session' => Session::class,
1818
'tokens' => AccessTokens::class,
@@ -24,7 +24,7 @@ public $authenticators = [
2424
The default authenticator is also defined in the configuration file, and uses the alias given above:
2525

2626
```php
27-
public $defaultAuthenticator = 'session';
27+
public string $defaultAuthenticator = 'session';
2828
```
2929

3030
## Auth Helper

docs/references/events.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,8 +44,7 @@ Events::on('failedLogin', function($credentials) {
4444
dd($credentials);
4545
});
4646

47-
// Outputs:
48-
['email' => 'foo@example.com'];
47+
// Outputs: ['email' => 'foo@example.com'];
4948
```
5049

5150
When the magic link login fails, the following array will be provided:

0 commit comments

Comments
 (0)