Skip to content

Commit 314ca1d

Browse files
author
Julien Neuhart
committed
Merge origin master
2 parents db739fe + 38d9e04 commit 314ca1d

File tree

7 files changed

+25
-20
lines changed

7 files changed

+25
-20
lines changed

docs/docs/05_Database/2_Doctrine Migrations.md

+5-5
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public function getDescription() : string
3535
}
3636
```
3737

38-
And throw the following exception the `down` method:
38+
And throw the following exception in the `down` method:
3939

4040
```php
4141
public function down(Schema $schema) : void
@@ -82,7 +82,7 @@ a new migration.
8282

8383
:::note
8484

85-
📣  You should **only** do that if a remote environment like your production did not already apply the migration.
85+
📣  **Do not** edit a migration if a remote environment like your production did apply the migration.
8686

8787
:::
8888

@@ -110,7 +110,7 @@ php bin/console doctrine:migrations:migrate -n
110110

111111
:::note
112112

113-
📣  Reminder: you should **only** do that if a remote environment like your production did not already
114-
apply the migration.
113+
📣  Reminder: **Do not** edit a migration if a remote environment like your production did apply the migration.
115114

116-
:::
115+
116+
:::

docs/docs/07_i18n/2_API.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ Let's take a look at the `CreateXLSXExport` use case:
152152
public function create(string $locale, array $headerIds, array $values): Xlsx
153153
```
154154

155-
The method `create` takes, among other arguments, a locale. It will use it to translates the spreadsheet's headers
155+
The method `create` takes, among other arguments, a locale. It will use it to translate the spreadsheet's headers
156156
accordingly.
157157

158158
For values, you should translate them directly in your use cases before calling the `create` method.

docs/docs/08_Security/2_Authentication.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ We initialize these values with empty strings or `null` for the profile picture.
7373

7474
**Getters:** *src/webapp/store/auth/getters.js*
7575

76-
* `isAuthenticated`: it returns `true` if the `user`'s `email` property from the state is empty. It might return `true`
76+
* `isAuthenticated`: it returns `true` if the `user`'s `email` property from the state is not empty. It might return `true`
7777
even if the user has no more session in the API, but we will see below how to handle such a case.
7878
* `isGranted`: it returns `true` if the user has the authorization level of the given role.
7979

@@ -124,4 +124,4 @@ there is an `nuxtServerInit` method, which Nuxt.js calls before server-rendering
124124
In this function, we:
125125

126126
1. Set the header `Cookie` for every server-side GraphQL requests.
127-
2. Call the `me` action to fetch (or not) the user data (useful when the user refreshes the page).
127+
2. Call the `me` action to fetch (or not) the user data (useful when the user refreshes the page).

docs/docs/08_Security/3_Access Control.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ It comes in two parts:
221221

222222
#### GraphQL
223223

224-
For instance, let's examine the following scenario: an administrator can delete a user, but only not if he is that user:
224+
For instance, let's examine the following scenario: an administrator can delete a user, but cannot delete himself:
225225

226226
```php title="src/api/src/UseCase/Product/UpdateProduct.php"
227227
use TheCodingMachine\GraphQLite\Annotations\Logged;
@@ -354,4 +354,4 @@ use the *src/webapp/middleware/redirect-if-not- authenticated.js* middleware to
354354
export default {
355355
middleware: ['redirect-if-not-authenticated'],
356356
}
357-
```
357+
```

docs/docs/09_Files/2_Temporary Files.md

+11-6
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,19 @@ use function Safe\unlink;
1616

1717
protected function createResponseWithXLSXAttachment(string $filename, Xlsx $xlsx): Response
1818
{
19-
$tmpFilename = Uuid::uuid4()->toString() . '.xlsx';
20-
$xlsx->save($tmpFilename);
21-
$fileContent = file_get_contents($tmpFilename); // Get the file content.
22-
unlink($tmpFilename); // Delete the file.
23-
19+
try {
20+
$tmpFilename = Uuid::uuid4()->toString() . '.xlsx';
21+
$xlsx->save($tmpFilename);
22+
$fileContent = file_get_contents($tmpFilename); // Get the file content.
23+
} finally {
24+
if (file_exists($tmpFilename)) {
25+
unlink($tmpFilename); // Delete the file.
26+
}
27+
}
28+
2429
return $this->createResponseWithAttachment(
2530
$filename,
2631
$fileContent
2732
);
2833
}
29-
```
34+
```

docs/docs/16_Deployments/3_CICD.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ stages:
1616

1717
api_tests:
1818
stage: tests
19-
image: thecodingmachine/php:7.4-v3-apache
19+
image: thecodingmachine/php:7.4-v3-cli
2020
services:
2121
- name: mysql:8.0
2222
command: ["--default-authentication-plugin=mysql_native_password"]
@@ -141,4 +141,4 @@ webapp_build_push_docker_image_prod:
141141
variables:
142142
NUXTJS_ENV_CONTENT: "$NUXTJS_ENV_CONTENT_PROD" # .env file content for prod (from GitLab CI/CD variables).
143143
ENV_NAME: "prod"
144-
```
144+
```

src/api/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ public function getDescription() : string
6666
}
6767
```
6868

69-
And throw the following exception the `down` method:
69+
And throw the following exception in the `down` method:
7070

7171
```php
7272
public function down(Schema $schema) : void
@@ -115,4 +115,4 @@ php bin/console app:fixtures:dev
115115

116116
It uses the class [AppFixtures.php](src/Infrastructure/Fixtures/AppFixtures.php) for that task.
117117

118-
You should edit according to your needs.
118+
You should edit according to your needs.

0 commit comments

Comments
 (0)