Skip to content

Commit a64c5ba

Browse files
authored
Fix PHP code style issues in documentation code snippets (#8190)
Add trailing commas to multi-line arrays, fix 2-space to 4-space indentation, add missing semicolon, remove aligned => operators, and revert non-PHP blocks back to text language tag.
1 parent dd8987e commit a64c5ba

File tree

12 files changed

+44
-44
lines changed

12 files changed

+44
-44
lines changed

docs/en/appendices/5-0-upgrade-guide.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Once your application is running on latest CakePHP 4.x, enable deprecation warni
99
``` php
1010
'Error' => [
1111
'errorLevel' => E_ALL,
12-
]
12+
],
1313
```
1414

1515
Now that you can see all the warnings, make sure these are fixed before proceeding with the upgrade.

docs/en/contributing/backwards-compatibility.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ value:
277277
// ...
278278
'Error' => [
279279
'errorLevel' => E_ALL ^ E_USER_DEPRECATED,
280-
]
280+
],
281281
// ...
282282
```
283283

docs/en/core-libraries/email.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@ TransportFactory::setConfig('gmail', [
484484
'port' => 465,
485485
'username' => 'my@gmail.com',
486486
'password' => 'secret',
487-
'className' => 'Smtp'
487+
'className' => 'Smtp',
488488
]);
489489
```
490490

docs/en/core-libraries/internationalization-and-localization.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ The default locale can be set in your **config/app.php** file by setting
122122
...
123123
'defaultLocale' => env('APP_DEFAULT_LOCALE', 'en_US'),
124124
...
125-
]
125+
],
126126
```
127127

128128
This will control several aspects of the application, including the default

docs/en/core-libraries/xml.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ Examples of invalid arrays:
113113
// Multiple keys in top level
114114
[
115115
'key1' => 'first value',
116-
'key2' => 'other value'
116+
'key2' => 'other value',
117117
];
118118
```
119119

docs/en/development/debugging.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ additional editor formats if required during application bootstrap:
188188

189189
``` php
190190
// Generate links for vscode.
191-
Debugger::setEditor('vscode')
191+
Debugger::setEditor('vscode');
192192

193193
// Add a custom format
194194
// Format strings will have the {file} and {line}

docs/en/development/routing.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ syntax:
202202

203203
Some example string targets are:
204204

205-
``` php
205+
``` text
206206
// Application controller
207207
'Articles::view'
208208

docs/en/development/sessions.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ If you need to use a database to store your session data, configure as follows:
168168

169169
``` php
170170
'Session' => [
171-
'defaults' => 'database'
171+
'defaults' => 'database',
172172
]
173173
```
174174

@@ -354,7 +354,7 @@ In **config/app.php** make the session block look like:
354354
],
355355
// Make sure to add a apc cache config
356356
'Cache' => [
357-
'apc' => ['engine' => 'Apc']
357+
'apc' => ['engine' => 'Apc'],
358358
]
359359
```
360360

docs/en/development/testing.md

Lines changed: 30 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -475,36 +475,36 @@ An example table would be:
475475

476476
``` php
477477
return [
478-
'articles' => [
479-
'columns' => [
480-
'id' => [
481-
'type' => 'integer',
482-
],
483-
'author_id' => [
484-
'type' => 'integer',
485-
'null' => true,
486-
],
487-
'title' => [
488-
'type' => 'string',
489-
'null' => true,
490-
],
491-
'body' => 'text',
492-
'published' => [
493-
'type' => 'string',
494-
'length' => 1,
495-
'default' => 'N',
496-
],
497-
],
498-
'constraints' => [
499-
'primary' => [
500-
'type' => 'primary',
501-
'columns' => [
502-
'id',
503-
],
504-
],
505-
],
506-
],
507-
// More tables
478+
'articles' => [
479+
'columns' => [
480+
'id' => [
481+
'type' => 'integer',
482+
],
483+
'author_id' => [
484+
'type' => 'integer',
485+
'null' => true,
486+
],
487+
'title' => [
488+
'type' => 'string',
489+
'null' => true,
490+
],
491+
'body' => 'text',
492+
'published' => [
493+
'type' => 'string',
494+
'length' => 1,
495+
'default' => 'N',
496+
],
497+
],
498+
'constraints' => [
499+
'primary' => [
500+
'type' => 'primary',
501+
'columns' => [
502+
'id',
503+
],
504+
],
505+
],
506+
],
507+
// More tables
508508
];
509509
```
510510

docs/en/orm/behaviors/counter-cache.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ First, you need to add the `through` and `cascadeCallbacks` options to the
146146
`belongsToMany` association:
147147

148148
``` php
149-
'through' => 'CommentsArticles',
150-
'cascadeCallbacks' => true
149+
'through' => 'CommentsArticles',
150+
'cascadeCallbacks' => true,
151151
```
152152

153153
Also see [Using The Through Option](../../orm/associations#using-the-through-option) how to configure a custom join table.

0 commit comments

Comments
 (0)