{"id":18834305,"url":"https://github.com/chubbyphp/chubbyphp-framework-router-fastroute","last_synced_at":"2025-04-14T04:32:22.393Z","repository":{"id":51376670,"uuid":"274209994","full_name":"chubbyphp/chubbyphp-framework-router-fastroute","owner":"chubbyphp","description":"Fastroute Router implementation for chubbyphp-framework.","archived":false,"fork":false,"pushed_at":"2025-03-12T14:09:32.000Z","size":84,"stargazers_count":1,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-27T18:55:25.456Z","etag":null,"topics":["chubbyphp-framework","psr-15","psr-7","routing"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chubbyphp.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2020-06-22T18:10:58.000Z","updated_at":"2025-03-12T14:09:36.000Z","dependencies_parsed_at":"2024-03-13T21:28:06.809Z","dependency_job_id":"73297b6d-53b7-48c3-958b-d9480ccfd9c2","html_url":"https://github.com/chubbyphp/chubbyphp-framework-router-fastroute","commit_stats":{"total_commits":47,"total_committers":3,"mean_commits":"15.666666666666666","dds":0.3191489361702128,"last_synced_commit":"5e5f11e20bad495fd6478a24ac11c673a84b55b2"},"previous_names":[],"tags_count":14,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp%2Fchubbyphp-framework-router-fastroute","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp%2Fchubbyphp-framework-router-fastroute/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp%2Fchubbyphp-framework-router-fastroute/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chubbyphp%2Fchubbyphp-framework-router-fastroute/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chubbyphp","download_url":"https://codeload.github.com/chubbyphp/chubbyphp-framework-router-fastroute/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248821992,"owners_count":21166988,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["chubbyphp-framework","psr-15","psr-7","routing"],"created_at":"2024-11-08T02:11:51.469Z","updated_at":"2025-04-14T04:32:22.386Z","avatar_url":"https://github.com/chubbyphp.png","language":"PHP","readme":"# chubbyphp-framework-router-fastroute\n\n[![CI](https://github.com/chubbyphp/chubbyphp-framework-router-fastroute/actions/workflows/ci.yml/badge.svg)](https://github.com/chubbyphp/chubbyphp-framework-router-fastroute/actions/workflows/ci.yml)\n[![Coverage Status](https://coveralls.io/repos/github/chubbyphp/chubbyphp-framework-router-fastroute/badge.svg?branch=master)](https://coveralls.io/github/chubbyphp/chubbyphp-framework-router-fastroute?branch=master)\n[![Mutation testing badge](https://img.shields.io/endpoint?style=flat\u0026url=https%3A%2F%2Fbadge-api.stryker-mutator.io%2Fgithub.com%2Fchubbyphp%2Fchubbyphp-framework-router-fastroute%2Fmaster)](https://dashboard.stryker-mutator.io/reports/github.com/chubbyphp/chubbyphp-framework-router-fastroute/master)\n[![Latest Stable Version](https://poser.pugx.org/chubbyphp/chubbyphp-framework-router-fastroute/v)](https://packagist.org/packages/chubbyphp/chubbyphp-framework-router-fastroute)\n[![Total Downloads](https://poser.pugx.org/chubbyphp/chubbyphp-framework-router-fastroute/downloads)](https://packagist.org/packages/chubbyphp/chubbyphp-framework-router-fastroute)\n[![Monthly Downloads](https://poser.pugx.org/chubbyphp/chubbyphp-framework-router-fastroute/d/monthly)](https://packagist.org/packages/chubbyphp/chubbyphp-framework-router-fastroute)\n\n[![bugs](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-framework-router-fastroute\u0026metric=bugs)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-framework-router-fastroute)\n[![code_smells](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-framework-router-fastroute\u0026metric=code_smells)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-framework-router-fastroute)\n[![coverage](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-framework-router-fastroute\u0026metric=coverage)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-framework-router-fastroute)\n[![duplicated_lines_density](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-framework-router-fastroute\u0026metric=duplicated_lines_density)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-framework-router-fastroute)\n[![ncloc](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-framework-router-fastroute\u0026metric=ncloc)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-framework-router-fastroute)\n[![sqale_rating](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-framework-router-fastroute\u0026metric=sqale_rating)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-framework-router-fastroute)\n[![alert_status](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-framework-router-fastroute\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-framework-router-fastroute)\n[![reliability_rating](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-framework-router-fastroute\u0026metric=reliability_rating)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-framework-router-fastroute)\n[![security_rating](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-framework-router-fastroute\u0026metric=security_rating)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-framework-router-fastroute)\n[![sqale_index](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-framework-router-fastroute\u0026metric=sqale_index)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-framework-router-fastroute)\n[![vulnerabilities](https://sonarcloud.io/api/project_badges/measure?project=chubbyphp_chubbyphp-framework-router-fastroute\u0026metric=vulnerabilities)](https://sonarcloud.io/dashboard?id=chubbyphp_chubbyphp-framework-router-fastroute)\n\n## Description\n\nFastroute Router implementation for [chubbyphp-framework][1].\n\n## Requirements\n\n * php: ^8.2\n * [chubbyphp/chubbyphp-framework][1]: ^5.2\n * [chubbyphp/chubbyphp-http-exception][2]: ^1.2\n * [nikic/fast-route][3]: ^1.3|2.0.0-beta1|^2.0\n * [psr/http-message][4]: ^1.1|^2.0\n\n## Installation\n\nThrough [Composer](http://getcomposer.org) as [chubbyphp/chubbyphp-framework-router-fastroute][10].\n\n```bash\ncomposer require chubbyphp/chubbyphp-framework-router-fastroute \"^2.2\"\n```\n\n## Usage\n\n```php\n\u003c?php\n\ndeclare(strict_types=1);\n\nnamespace App;\n\nuse Chubbyphp\\Framework\\Application;\nuse Chubbyphp\\Framework\\Middleware\\ExceptionMiddleware;\nuse Chubbyphp\\Framework\\Middleware\\RouteMatcherMiddleware;\nuse Chubbyphp\\Framework\\RequestHandler\\CallbackRequestHandler;\nuse Chubbyphp\\Framework\\Router\\FastRoute\\RouteMatcher;\nuse Chubbyphp\\Framework\\Router\\Route;\nuse Chubbyphp\\Framework\\Router\\RoutesByName;\nuse Psr\\Http\\Message\\ServerRequestInterface;\nuse Slim\\Psr7\\Factory\\ResponseFactory;\nuse Slim\\Psr7\\Factory\\ServerRequestFactory;\n\nrequire __DIR__.'/vendor/autoload.php';\n\n$responseFactory = new ResponseFactory();\n\n$app = new Application([\n    new ExceptionMiddleware($responseFactory, true),\n    new RouteMatcherMiddleware(new RouteMatcher(new RoutesByName([\n        Route::get('/hello/{name:[a-z]+}', 'hello', new CallbackRequestHandler(\n            static function (ServerRequestInterface $request) use ($responseFactory) {\n                $response = $responseFactory-\u003ecreateResponse();\n                $response-\u003egetBody()-\u003ewrite(sprintf('Hello, %s', $request-\u003egetAttribute('name')));\n\n                return $response;\n            }\n        ))\n    ]))),\n]);\n\n$app-\u003eemit($app-\u003ehandle((new ServerRequestFactory())-\u003ecreateFromGlobals()));\n```\n\n## Copyright\n\n2025 Dominik Zogg\n\n[1]: https://packagist.org/packages/chubbyphp/chubbyphp-framework\n[2]: https://packagist.org/packages/chubbyphp/chubbyphp-http-exception\n[3]: https://packagist.org/packages/nikic/fast-route\n[4]: https://packagist.org/packages/psr/http-message\n[10]: https://packagist.org/packages/chubbyphp/chubbyphp-framework-router-fastroute\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchubbyphp%2Fchubbyphp-framework-router-fastroute","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchubbyphp%2Fchubbyphp-framework-router-fastroute","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchubbyphp%2Fchubbyphp-framework-router-fastroute/lists"}