{"id":20731599,"url":"https://github.com/ginopane/php-nano-http-status","last_synced_at":"2025-04-23T22:05:44.489Z","repository":{"id":27425817,"uuid":"113852903","full_name":"GinoPane/php-nano-http-status","owner":"GinoPane","description":"Truly minimalistic and self-contained package to handle HTTP statuses and relevant description messages","archived":false,"fork":false,"pushed_at":"2022-03-26T00:33:14.000Z","size":91,"stargazers_count":4,"open_issues_count":2,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-23T22:05:36.015Z","etag":null,"topics":["http","http-status-code","http-status-codes","http-statuscodes","httpstatus"],"latest_commit_sha":null,"homepage":null,"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/GinoPane.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-12-11T11:52:59.000Z","updated_at":"2022-06-28T12:11:18.000Z","dependencies_parsed_at":"2022-08-07T12:16:42.046Z","dependency_job_id":null,"html_url":"https://github.com/GinoPane/php-nano-http-status","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GinoPane%2Fphp-nano-http-status","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GinoPane%2Fphp-nano-http-status/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GinoPane%2Fphp-nano-http-status/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/GinoPane%2Fphp-nano-http-status/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/GinoPane","download_url":"https://codeload.github.com/GinoPane/php-nano-http-status/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250522300,"owners_count":21444511,"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":["http","http-status-code","http-status-codes","http-statuscodes","httpstatus"],"created_at":"2024-11-17T05:16:05.065Z","updated_at":"2025-04-23T22:05:43.983Z","avatar_url":"https://github.com/GinoPane.png","language":"PHP","readme":"PHP Nano Http Status\n============\n\n[![Latest Stable Version](https://poser.pugx.org/gino-pane/nano-http-status/v/stable)](https://packagist.org/packages/gino-pane/nano-http-status)\n[![Build Status](https://travis-ci.org/GinoPane/php-nano-rest.svg?branch=master)](https://travis-ci.org/GinoPane/php-nano-rest)\n[![Maintainability](https://api.codeclimate.com/v1/badges/fdabec77a1195d3611cf/maintainability)](https://codeclimate.com/github/GinoPane/php-nano-http-status/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/fdabec77a1195d3611cf/test_coverage)](https://codeclimate.com/github/GinoPane/php-nano-http-status/test_coverage)\n[![Scrutinizer Code Quality](https://scrutinizer-ci.com/g/GinoPane/php-nano-http-status/badges/quality-score.png?b=master)](https://scrutinizer-ci.com/g/GinoPane/php-nano-http-status/?branch=master)\n[![License](https://poser.pugx.org/gino-pane/nano-http-status/license)](https://packagist.org/packages/gino-pane/nano-http-status)\n[![Total Downloads](https://poser.pugx.org/gino-pane/nano-http-status/downloads)](https://packagist.org/packages/gino-pane/nano-http-status)\n\nTruly minimalistic and self-contained package to handle HTTP statuses and relevant description messages. Such packages as \n[Teapot](https://github.com/shrikeh/teapot) or [Httpstatus](https://github.com/lukasoppermann/http-status) are nice and famous, but still\neither too heavy and over-complicated or simply does not fit to Gino Pane's high code quality standards.\n\nRequirements\n============\n\n* PHP \u003e= 7.0;\n\nFeatures\n========\n\n* The full list of HTTP status codes as readable constants;\n* relevant status messages;\n* ability to customize messages;\n* ability to easily detect the class of the status;\n* no dependencies in production;\n* integrated tools for code quality, testing and building docs.\n\nInstallation\n============\n\n    composer require gino-pane/nano-http-status\n\nBasic Usage\n===========\n\nCheck existence of the code (using numeric codes or nice readable constants):\n\n    (new NanoHttpStatus())-\u003estatusExists(200); //true\n    (new NanoHttpStatus())-\u003estatusExists(400); //true\n    (new NanoHttpStatus())-\u003estatusExists(451); //true\n    (new NanoHttpStatus())-\u003estatusExists(511); //true\n    (new NanoHttpStatus())-\u003estatusExists(522); //false\n    \nDetect the class of the code using code numbers:\n\n    (new NanoHttpStatus())-\u003eisInformational(NanoHttpStatus::HTTP_OK); //false\n    (new NanoHttpStatus())-\u003eisSuccess(202);         //true\n    (new NanoHttpStatus())-\u003eisRedirection(301);     //true\n    (new NanoHttpStatus())-\u003eisClientError(404);     //true\n    (new NanoHttpStatus())-\u003eisServerError(NanoHttpStatus::HTTP_BAD_REQUEST); //false\n    \nGet status message by status code:\n\n    (new NanoHttpStatus())-\u003egetMessage(200); //OK\n    (new NanoHttpStatus())-\u003egetMessage(451); //Unavailable For Legal Reasons\n    (new NanoHttpStatus())-\u003egetMessage(452); //Undefined Status\n    \nSet localization mapping and get custom status messages:\n\n    $status = new NanoHttpStatus([\n        NanoHttpStatus::HTTP_BAD_REQUEST =\u003e 'Very bad request',\n        NanoHttpStatus::HTTP_BAD_GATEWAY =\u003e 'Not so bad gateway'\n    ]);\n    \n    $status-\u003egetMessage(400); //'Very bad request'\n    $status-\u003egetMessage(502); //'Not so bad gateway'\n    \nPlease note, that ```NanoHttpStatus``` itself does not throw any exceptions for invalid statuses.\n\nUseful Tools\n============\n\nRunning Tests:\n--------\n\n    php vendor/bin/phpunit\n \n or \n \n    composer test\n\nCode Sniffer Tool:\n------------------\n\n    php vendor/bin/phpcs --standard=PSR2 src/\n \n or\n \n    composer psr2check\n\nCode Auto-fixer:\n----------------\n\n    php vendor/bin/phpcbf --standard=PSR2 src/ \n    \n or\n \n    composer psr2autofix\n \n \nBuilding Docs:\n--------\n\n    php vendor/bin/phpdoc -d \"src\" -t \"docs\"\n \n or \n \n    composer docs\n\nChangelog\n=========\n\nTo keep track, please refer to [CHANGELOG.md](https://github.com/GinoPane/php-nano-http-status/blob/master/CHANGELOG.md).\n\nContributing\n============\n\n1. Fork it.\n2. Create your feature branch (git checkout -b my-new-feature).\n3. Make your changes.\n4. Run the tests, adding new ones for your own code if necessary (phpunit).\n5. Commit your changes (git commit -am 'Added some feature').\n6. Push to the branch (git push origin my-new-feature).\n7. Create new pull request.\n\nAlso please refer to [CONTRIBUTION.md](https://github.com/GinoPane/php-nano-http-status/blob/master/CONTRIBUTION.md).\n\nLicense\n=======\n\nPlease refer to [LICENSE](https://github.com/GinoPane/php-nano-http-status/blob/master/LICENSE).\n \nNotes\n=====\n \nPowered by [composer-package-template](https://github.com/GinoPane/composer-package-template)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fginopane%2Fphp-nano-http-status","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fginopane%2Fphp-nano-http-status","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fginopane%2Fphp-nano-http-status/lists"}