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 #
| <?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.