Disclaimer: I assume someone has already suggested this and there are good reasons it hasn't happened!
Inspired by a conversation with @pronskiy after my talk "PHP Generics Today (Almost)" at IPC Munich
Examples:
class Queue #
| I want this project to support PHP 8.3, 8.4, and 8.5 with a CI matrix. Right | |
| now it probably only supports one version. Here's the plan: | |
| ## Goals | |
| - Support PHP 8.3, 8.4, and 8.5 | |
| - Local Docker services for each version | |
| - GitHub Actions matrix that runs CI against all three | |
| - Infection (mutation testing) runs only on 8.5 in a dedicated job | |
| - Single `composer.lock` that works on all three versions (project, not | |
| library — locked dependencies only) |
| <?php | |
| namespace Foo { | |
| class Telephone | |
| { | |
| #[NamespaceVisibility] | |
| public function ring(): void | |
| { | |
| } |
Disclaimer: I assume someone has already suggested this and there are good reasons it hasn't happened!
Inspired by a conversation with @pronskiy after my talk "PHP Generics Today (Almost)" at IPC Munich
Examples:
class Queue #
| // Example of the #[Friend] attribute available from https://github.com/DaveLiddament/php-language-extensions | |
| class Person { | |
| #[Friend(PersonBuilder::class)] | |
| public function __construct() {} | |
| } | |
| class PersonBuilder { | |
| public function build(): Person { |
Clone https://github.com/bristol-php-training/php7-phpunit-password-validator
Run composer install and then vendor/bin/phpunit. Make sure basic test works.