Ondrej Mirtes. Use Generics in PHP. Today

preview_player
Показать описание

Developers in other languages like Java, C#, or TypeScript, have been enjoying the benefits of generics for a long time. They allow us to describe precise types of values included in a collection object or to work around type system limitations without the need for unsafe type casting. PHP does not support generics natively but with the help of PHPDocs, we’re able to simulate them. Static analysers like PHPStan or Psalm are able to interpret generics and take advantage of them to find more bugs thanks to strongly-typed code.
In this talk I’ll introduce the concept of generics, show several useful use cases to the audience, and even dive into how they’re implemented in PHPStan and what had to be considered during the development.

Ondřej likes pointing out mistakes in other people’s code so much that he created PHPStan, a popular static analyzer that focuses on finding bugs in code without running it.

Рекомендации по теме
Комментарии
Автор

Very good talk. 30 minutes of hard knowledge and good examples. Thank you.

jacekkowalski
Автор

I like this very much, but the price for a team of two or three people seems a bit salty compared to the price of a full IDE like PHP Storm.

lfbarni
join shbcf.ru