Skip to content
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

✨ New article : Generics in PHP #980

Merged
merged 34 commits into from
Jan 10, 2024

Conversation

ArthurJCQ
Copy link
Member

No description provided.

@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php August 18, 2023 09:58 Destroyed
@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php August 18, 2023 09:59 Destroyed
@github-actions
Copy link
Contributor

github-actions bot commented Aug 18, 2023

⚡️🏠 Lighthouse report

Here's the summary:

Path Performance Accessibility Best practices SEO PWA
/feat/add-post-typage-generique-en-php/ 🟠 80 🟢 100 🟢 92 🟢 92 🟠 70
/feat/add-post-typage-generique-en-php/fr/authors/ajacquemin/ 🟠 88 🟢 100 🟠 83 🟢 92 🟠 70
/feat/add-post-typage-generique-en-php/fr/comment-construire-site-web-avec-nextjs/ 🟠 79 🟢 98 🟠 83 🟢 100 🟠 70
/feat/add-post-typage-generique-en-php/fr/nestjs-le-cycle-de-vie-dune-requete/ 🟠 73 🟢 98 🟠 83 🟢 97 🟠 70

Here's the audits:

Path FCP
1800 <=
LCP
2500 <=
Speed Index
3400 <=
TTI
3800 <=
TBT
200 <=
CLS
0.1 <=
/feat/add-post-typage-generique-en-php/ 🔴 2483 🔴 3674 🟢 2483 🔴 8737 🟢 24 🟢 0
/feat/add-post-typage-generique-en-php/fr/authors/ajacquemin/ 🟢 1777 🔴 2970 🟢 1777 🔴 7974 🟢 20 🟢 0
/feat/add-post-typage-generique-en-php/fr/comment-construire-site-web-avec-nextjs/ 🔴 2432 🔴 3629 🟢 2432 🔴 10169 🟢 22 🟢 0
/feat/add-post-typage-generique-en-php/fr/nestjs-le-cycle-de-vie-dune-requete/ 🔴 2203 🔴 4773 🟢 2203 🔴 8873 🟢 20 🟢 0.07

…even-labs/blog.eleven-labs.com into feat/add-post-typage-generique-en-php
@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php August 18, 2023 10:17 Destroyed
@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php August 18, 2023 10:43 Destroyed
_posts/fr/2023-08-23-typage-generique-en-php.md Outdated Show resolved Hide resolved
_posts/fr/2023-08-23-typage-generique-en-php.md Outdated Show resolved Hide resolved
_posts/fr/2023-08-23-typage-generique-en-php.md Outdated Show resolved Hide resolved
_posts/fr/2023-08-23-typage-generique-en-php.md Outdated Show resolved Hide resolved
_posts/fr/2023-08-23-typage-generique-en-php.md Outdated Show resolved Hide resolved
_posts/fr/2023-08-23-typage-generique-en-php.md Outdated Show resolved Hide resolved
_posts/fr/2023-08-23-typage-generique-en-php.md Outdated Show resolved Hide resolved
_posts/fr/2023-08-23-typage-generique-en-php.md Outdated Show resolved Hide resolved
_posts/fr/2023-08-23-typage-generique-en-php.md Outdated Show resolved Hide resolved
_posts/fr/2023-08-23-typage-generique-en-php.md Outdated Show resolved Hide resolved
@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php August 21, 2023 07:12 Destroyed
@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php November 6, 2023 14:55 Destroyed
@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php November 6, 2023 15:03 Destroyed
@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php November 6, 2023 15:03 Destroyed
@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php November 6, 2023 15:39 Destroyed
@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php November 6, 2023 15:41 Destroyed
@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php November 6, 2023 16:26 Destroyed
@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php November 8, 2023 09:05 Destroyed
@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php November 28, 2023 12:59 Destroyed
@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php November 28, 2023 13:00 Destroyed
@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php December 6, 2023 09:59 Destroyed
@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php December 6, 2023 10:24 Destroyed
@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php January 3, 2024 13:01 Destroyed
@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php January 10, 2024 10:10 Destroyed
@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php January 10, 2024 10:16 Destroyed
contentType: article
lang: fr
date: 2024-01-10
slug: typage-generique-en-php
Copy link
Contributor

@Cindyvlv Cindyvlv Jan 10, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
slug: typage-generique-en-php
slug: typage-generique-php

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typage & Typage générique ne doivent pas être confondus, surtout en PHP

lang: fr
date: 2024-01-10
slug: typage-generique-en-php
title: Typage générique en php
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
title: Typage générique en php
title: Typage générique en php : définitions, bonne pratiques et exemple

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Je préfère un titre court et impactant

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Dans le titre de ton article, tu dois donner des indications au lecteur des informations qu'il va trouver dans ton contenu. Juste "Typage générique en PHP", on s'attend à une définition et pas à une explications complète et un exemple pratique.

date: 2024-01-10
slug: typage-generique-en-php
title: Typage générique en php
excerpt: Le typage générique en php, c'est impossible ? Pas si sûr...
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
excerpt: Le typage générique en php, c'est impossible ? Pas si sûr...
excerpt: Découvrez comment réaliser du typage générique en PHP : introduction et définition du concept, conseils et explications pas à pas d'un cas pratique.

- ajacquemin
---

### Introduction
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Introduction
## Introduction au typage générique en PHP

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pareil pour les titres c'est redondant avec le titre


Alors, pourquoi ces types ne sont-ils pas déjà disponibles dans notre langage préféré ?

### Pourquoi c'est impossible en pratique
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Pourquoi c'est impossible en pratique
### En quoi le typage générique en PHP est impossible dans la pratique ?


Pour une mise en application plus poussée et un accompagnement pas à pas de la vérification de ces types avec PHPStan, référez-vous au [Tutoriel](https://blog.eleven-labs.com/fr/composition-over-inheritance-et-typage-generique-avec-symfony-et-doctrine) cité plus haut dans cet article.

### Conclusion
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
### Conclusion
## Conclusion : le typage générique PHP est possible

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pas véritablement justement 😅

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tu ne peux pas mettre juste "Conclusion"

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pourquoi ? C'est la conclusion

categories:
- php
keywords:
- typage générique
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ajouter Typage PHP


### Introduction

Le typage générique, non seulement c'est super, mais en plus, c'est classe. Dans un monde idéal, voilà à quoi ça ressemblerait en PHP :
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Le typage générique, non seulement c'est super, mais en plus, c'est classe. Dans un monde idéal, voilà à quoi ça ressemblerait en PHP :
Le typage générique, non seulement c'est super, mais en plus, c'est classe. Dans un monde idéal, voilà à quoi ça ressemblerait en [PHP](https://eleven-labs.com/dev-web/php-symfony/) :

... Ou alors, on se tourne vers un des super pouvoirs de PHP : son écosystème d'analyseurs statiques.
En effet, nous avons la chance en PHP d'avoir pléthore d'*analyseurs statiques*, tous extrêmement bien développés.

Grâce à eux, notre IDE favori (PhpStorm bien entendu) est en mesure de nous crier dessus à la moindre erreur décelable avant l'exécution.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Grâce à eux, notre IDE favori (PhpStorm bien entendu) est en mesure de nous crier dessus à la moindre erreur décelable avant l'exécution.
Grâce à eux, [notre IDE favori, PhpStorm](https://blog.eleven-labs.com/fr/phpstorm-tips-config-extensions/), est en mesure de nous crier dessus à la moindre erreur décelable avant l'exécution.

Cela signifie que notre instance de collection `$users` ne peut accepter que des objets de type `User`.
Nous aurions alors, notamment grâce à nos IDE intelligents, des informations plus strictes sur le type de données admises par une instance de Collection, sans avoir à simplement le déduire de par le nom de la variable. L'analyse statique de notre code serait encore plus performante, ce qui est important en PHP, qui ne possède pas d'étape de compilation à proprement parler.

Pour de nombreux langages, cette étape de compilation permet de soulever des erreurs dans le code, voire de parser ces types génériques.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Pour de nombreux langages, cette étape de compilation permet de soulever des erreurs dans le code, voire de parser ces types génériques.
Pour de nombreux [langages en développement web](https://eleven-labs.com/dev-web/), cette étape de compilation permet de soulever des erreurs dans le code, voire de parser ces types génériques.

@github-actions github-actions bot temporarily deployed to dev-feat/add-post-typage-generique-en-php January 10, 2024 16:19 Destroyed
@ElevenTom ElevenTom merged commit 2aef60b into master Jan 10, 2024
2 checks passed
@ElevenTom ElevenTom deleted the feat/add-post-typage-generique-en-php branch January 10, 2024 17:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants