xp-lang / php-compact-methods
This package is abandoned and no longer maintained.
No replacement package was suggested.
Compact methods for PHP
v2.0.0
2024-03-24 12:47 UTC
Requires
- php: >=7.4.0
- xp-framework/compiler: ^9.0 | ^8.0
- xp-framework/core: ^12.0 | ^11.0 | ^10.0
Requires (Dev)
- xp-framework/test: ^2.0 | ^1.0
README
Plugin for the XP Compiler which adds compact methods to the PHP language.
Example
Compact methods use the fn keyword, much like PHP 7.4 arrow functions. The RFC suggests this in its Future Scope section.
class Person { private $name; public fn name(): string => $this->name; }
Installation
After installing the XP Compiler into your project, also include this plugin.
$ composer require xp-framework/compiler # ... $ composer require xp-lang/php-compact-methods # ...
No further action is required.

