Skip to content

Commit

Permalink
Merge origin master
Browse files Browse the repository at this point in the history
  • Loading branch information
gulien committed Dec 18, 2020
2 parents db739fe + 38d9e04 commit 314ca1d
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 20 deletions.
10 changes: 5 additions & 5 deletions docs/docs/05_Database/2_Doctrine Migrations.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public function getDescription() : string
}
```

And throw the following exception the `down` method:
And throw the following exception in the `down` method:

```php
public function down(Schema $schema) : void
Expand Down Expand Up @@ -82,7 +82,7 @@ a new migration.

:::note

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

:::

Expand Down Expand Up @@ -110,7 +110,7 @@ php bin/console doctrine:migrations:migrate -n

:::note

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

:::

:::
2 changes: 1 addition & 1 deletion docs/docs/07_i18n/2_API.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ Let's take a look at the `CreateXLSXExport` use case:
public function create(string $locale, array $headerIds, array $values): Xlsx
```

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

For values, you should translate them directly in your use cases before calling the `create` method.
4 changes: 2 additions & 2 deletions docs/docs/08_Security/2_Authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ We initialize these values with empty strings or `null` for the profile picture.

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

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

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

1. Set the header `Cookie` for every server-side GraphQL requests.
2. Call the `me` action to fetch (or not) the user data (useful when the user refreshes the page).
2. Call the `me` action to fetch (or not) the user data (useful when the user refreshes the page).
4 changes: 2 additions & 2 deletions docs/docs/08_Security/3_Access Control.md
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ It comes in two parts:

#### GraphQL

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

```php title="src/api/src/UseCase/Product/UpdateProduct.php"
use TheCodingMachine\GraphQLite\Annotations\Logged;
Expand Down Expand Up @@ -354,4 +354,4 @@ use the *src/webapp/middleware/redirect-if-not- authenticated.js* middleware to
export default {
middleware: ['redirect-if-not-authenticated'],
}
```
```
17 changes: 11 additions & 6 deletions docs/docs/09_Files/2_Temporary Files.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,19 @@ use function Safe\unlink;

protected function createResponseWithXLSXAttachment(string $filename, Xlsx $xlsx): Response
{
$tmpFilename = Uuid::uuid4()->toString() . '.xlsx';
$xlsx->save($tmpFilename);
$fileContent = file_get_contents($tmpFilename); // Get the file content.
unlink($tmpFilename); // Delete the file.

try {
$tmpFilename = Uuid::uuid4()->toString() . '.xlsx';
$xlsx->save($tmpFilename);
$fileContent = file_get_contents($tmpFilename); // Get the file content.
} finally {
if (file_exists($tmpFilename)) {
unlink($tmpFilename); // Delete the file.
}
}

return $this->createResponseWithAttachment(
$filename,
$fileContent
);
}
```
```
4 changes: 2 additions & 2 deletions docs/docs/16_Deployments/3_CICD.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ stages:

api_tests:
stage: tests
image: thecodingmachine/php:7.4-v3-apache
image: thecodingmachine/php:7.4-v3-cli
services:
- name: mysql:8.0
command: ["--default-authentication-plugin=mysql_native_password"]
Expand Down Expand Up @@ -141,4 +141,4 @@ webapp_build_push_docker_image_prod:
variables:
NUXTJS_ENV_CONTENT: "$NUXTJS_ENV_CONTENT_PROD" # .env file content for prod (from GitLab CI/CD variables).
ENV_NAME: "prod"
```
```
4 changes: 2 additions & 2 deletions src/api/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ public function getDescription() : string
}
```

And throw the following exception the `down` method:
And throw the following exception in the `down` method:

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

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

You should edit according to your needs.
You should edit according to your needs.

0 comments on commit 314ca1d

Please sign in to comment.