Skip to content

Apply some fixes suggested by proselint #657

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Nov 15, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions admin/handling-relations-to-collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,6 @@ class Book

The admin handles this `to-many` relation automatically!

But we can go further:

## Customizing a Property

Let's customize the components used for the `authors` property, to display them by their 'name' instead 'id' (the default behavior).
Expand Down
2 changes: 1 addition & 1 deletion client-generator/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# The API Platform Client Generator

Client Generator is the fastest way to scaffold fully-featured webapps and native mobile apps from APIs supporting the [Hydra](http://www.hydra-cg.com/) format.
Client Generator is the fastest way to scaffold fully featured webapps and native mobile apps from APIs supporting the [Hydra](http://www.hydra-cg.com/) format.

![Screencast](images/client-generator-demo.gif)

Expand Down
2 changes: 1 addition & 1 deletion core/file-upload.md
Original file line number Diff line number Diff line change
Expand Up @@ -252,5 +252,5 @@ uploaded cover, you can have a nice illustrated book record!
}
```

Voila! You can now send files to your API, and link them to any other resources
Voilà! You can now send files to your API, and link them to any other resources
in your app.
16 changes: 8 additions & 8 deletions core/serialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ all set!

It is simple to specify what groups to use in the API system:

1. Add the `normalizationContext` and `denormalizationContext` annotation properties to the `@ApiResource` annotation, and specify which groups to use. Here you see that we add `read` and `write`, respectively. You can use any group names you wish.
1. Add the `normalizationContext` and `denormalizationContext` annotation properties to the `@ApiResource` annotation, and specify which groups to use. Here you see that we add `read` and `write`, respectively. You can use any group names you wish.
2. Apply the `@Groups` annotation to properties in the object.

```php
Expand Down Expand Up @@ -129,7 +129,7 @@ App\Entity\Book:
```

In the previous example, the `name` property will be visible when reading (`GET`) the object, and it will also be available
to write (`PUT/POST`). The `author` property will be write-only; it will not be visible when serialized responses are
to write (`PUT/POST`). The `author` property will be write-only; it will not be visible when serialized responses are
returned by the API.

Internally, API Platform passes the value of the `normalization_context` to the Symfony Serializer during the normalization
Expand Down Expand Up @@ -415,7 +415,7 @@ final class BookContextBuilder implements SerializerContextBuilderInterface
```

If the user has the `ROLE_ADMIN` permission and the subject is an instance of Book, `admin_input` group will be dynamically added to the
denormalization context. The `$normalization` variable lets you check whether the context is for normalization (if `TRUE`) or denormalization
denormalization context. The `$normalization` variable lets you check whether the context is for normalization (if `TRUE`) or denormalization
(`FALSE`).

## Changing the Serialization Context on a Per-item Basis
Expand Down Expand Up @@ -500,8 +500,8 @@ class BookAttributeNormalizer implements ContextAwareNormalizerInterface, Normal
This will add the serialization group `can_retrieve_book` only if the currently logged-in user has access to the given book
instance.

Note: In this example, we use the `TokenStorageInterface` to verify access to the book instance. However, Symfony
provides many useful other services that might be better suited to your use case. For example, the [`AuthorizationChecker`](https://symfony.com/doc/current/components/security/authorization.html#authorization-checker).
Note: In this example, we use the `TokenStorageInterface` to verify access to the book instance. However, Symfony
provides many useful other services that might be better suited to your use case. For example, the [`AuthorizationChecker`](https://symfony.com/doc/current/components/security/authorization.html#authorization-checker).

## Name Conversion

Expand All @@ -524,7 +524,7 @@ api_platform:

## Decorating a Serializer and Adding Extra Data

In the following example, we will see how we add extra informations to the serialized output. Here is how we add the
In the following example, we will see how we add extra informations to the serialized output. Here is how we add the
date on each request in `GET`:

```yaml
Expand Down Expand Up @@ -599,7 +599,7 @@ API Platform is able to guess the entity identifier using [Doctrine metadata](ht
It also supports composite identifiers.

If you are not using the Doctrine ORM Provider, you must explicitly mark the identifier using the `identifier` attribute of
the `ApiPlatform\Core\Annotation\ApiProperty` annotation. For example:
the `ApiPlatform\Core\Annotation\ApiProperty` annotation. For example:


```php
Expand Down Expand Up @@ -644,7 +644,7 @@ App\Entity\Book:
```

In some cases, you will want to set the identifier of a resource from the client (e.g. a client-side generated UUID, or a slug).
In such cases, you must make the identifier property a writable class property. Specifically, to use client-generated IDs, you
In such cases, you must make the identifier property a writable class property. Specifically, to use client-generated IDs, you
must do the following:

1. create a setter for the identifier of the entity (e.g. `public function setId(string $id)`) or make it a `public` property ,
Expand Down
2 changes: 1 addition & 1 deletion deployment/kubernetes.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ Before running your application for the first time, be sure to create the databa

## Tiller RBAC Issue

We noticed that some tiller RBAC trouble occured, you generally can resolve it running:
We noticed that some tiller RBAC trouble occurred, you generally can resolve it running:

kubectl create serviceaccount --namespace kube-system tiller
serviceaccount "tiller" created
Expand Down
4 changes: 2 additions & 2 deletions distribution/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
> - Fabien Potencier (creator of Symfony), SymfonyCon 2017

[API Platform](https://api-platform.com) is a powerful but easy to use **full stack** framework dedicated to API-driven projects.
It contains a **PHP** library to create fully-featured APIs supporting industry-leading standards (JSON-LD, GraphQL, OpenAPI...),
It contains a **PHP** library to create fully featured APIs supporting industry-leading standards (JSON-LD, GraphQL, OpenAPI...),
provides ambitious **JavaScript** tooling to consume those APIs in a snap (admin, PWA and mobile apps generators, hypermedia
client...) and is shipped with a nice **Docker** and **Kubernetes** integration to develop and deploy instantly in the cloud.

Expand Down Expand Up @@ -510,7 +510,7 @@ Now try to add another book by issuing a `POST` request to `/books` with the fol
}
```

Oops, we missed to add the title. But submit the request anyway. You should get a 500 error with the following message:
Oops, we missed to add the title. Submit the request anyway, you should get a 500 error with the following message:

An exception occurred while executing 'INSERT INTO book [...] VALUES [...]' with params [...]:
SQLSTATE[23000]: Integrity constraint violation: 1048 Column 'title' cannot be null
Expand Down