{"id":15068584,"url":"https://github.com/xp-lang/php-compact-methods","last_synced_at":"2026-03-07T12:37:16.340Z","repository":{"id":57084843,"uuid":"207409067","full_name":"xp-lang/php-compact-methods","owner":"xp-lang","description":"Compact methods for PHP","archived":false,"fork":false,"pushed_at":"2025-05-29T11:03:04.000Z","size":23,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-10-11T14:11:27.196Z","etag":null,"topics":["arrow-functions","compact","compiler-plugin","php7","php8","xp-compiler","xp-framework"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/xp-lang.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-09-09T21:34:57.000Z","updated_at":"2025-05-29T11:03:08.000Z","dependencies_parsed_at":"2024-03-01T21:31:33.370Z","dependency_job_id":"35f9639c-3510-4876-9851-38faf75f7f6a","html_url":"https://github.com/xp-lang/php-compact-methods","commit_stats":{"total_commits":23,"total_committers":1,"mean_commits":23.0,"dds":0.0,"last_synced_commit":"b694429ec0db3af7365a8450c6b878a0a50c94d5"},"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/xp-lang/php-compact-methods","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-lang%2Fphp-compact-methods","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-lang%2Fphp-compact-methods/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-lang%2Fphp-compact-methods/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-lang%2Fphp-compact-methods/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/xp-lang","download_url":"https://codeload.github.com/xp-lang/php-compact-methods/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/xp-lang%2Fphp-compact-methods/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30213268,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T12:15:00.571Z","status":"ssl_error","status_checked_at":"2026-03-07T12:15:00.217Z","response_time":53,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arrow-functions","compact","compiler-plugin","php7","php8","xp-compiler","xp-framework"],"created_at":"2024-09-25T01:38:25.913Z","updated_at":"2026-03-07T12:37:16.286Z","avatar_url":"https://github.com/xp-lang.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Compact methods for PHP\n=======================\n\n[![Build status on GitHub](https://github.com/xp-lang/php-compact-methods/workflows/Tests/badge.svg)](https://github.com/xp-lang/php-compact-methods/actions)\n[![XP Framework Module](https://raw.githubusercontent.com/xp-framework/web/master/static/xp-framework-badge.png)](https://github.com/xp-framework/core)\n[![BSD Licence](https://raw.githubusercontent.com/xp-framework/web/master/static/licence-bsd.png)](https://github.com/xp-framework/core/blob/master/LICENCE.md)\n[![Requires PHP 7.4+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-7_4plus.svg)](http://php.net/)\n[![Supports PHP 8.0+](https://raw.githubusercontent.com/xp-framework/web/master/static/php-8_0plus.svg)](http://php.net/)\n[![Latest Stable Version](https://poser.pugx.org/xp-lang/php-compact-methods/version.svg)](https://packagist.org/packages/xp-lang/php-compact-methods)\n\nPlugin for the [XP Compiler](https://github.com/xp-framework/compiler/) which adds compact methods to the PHP language.\n\nExample\n-------\nCompact methods use the `fn` keyword, much like [PHP 7.4 arrow functions](https://wiki.php.net/rfc/arrow_functions_v2). The RFC suggests this in its *Future Scope* section.\n\n```php\nclass Person {\n  private $name;\n\n  public fn name(): string =\u003e $this-\u003ename;\n}\n```\n\nInstallation\n------------\nAfter installing the XP Compiler into your project, also include this plugin.\n\n```bash\n$ composer require xp-framework/compiler\n# ...\n\n$ composer require xp-lang/php-compact-methods\n# ...\n```\n\nNo further action is required.\n\nSee also\n--------\n* https://wiki.php.net/rfc/single-expression-functions\n* https://wiki.php.net/rfc/short-functions\n* https://wiki.php.net/rfc/arrow_functions_v2#allow_arrow_notation_for_real_functions\n* https://github.com/xp-framework/rfc/issues/241","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-lang%2Fphp-compact-methods","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fxp-lang%2Fphp-compact-methods","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fxp-lang%2Fphp-compact-methods/lists"}