{"id":15068522,"url":"https://github.com/tiny-blocks/country","last_synced_at":"2026-02-14T18:03:20.758Z","repository":{"id":49747984,"uuid":"517889555","full_name":"tiny-blocks/country","owner":"tiny-blocks","description":"Value Object representing a country using ISO-3166 specifications.","archived":false,"fork":false,"pushed_at":"2026-01-15T11:55:18.000Z","size":45,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-15T16:30:26.809Z","etag":null,"topics":["country","country-codes","hacktoberfest","iso-3166","open-source","php","tiny-blocks","value-object"],"latest_commit_sha":null,"homepage":"https://packagist.org/packages/tiny-blocks/country","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/tiny-blocks.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2022-07-26T02:43:39.000Z","updated_at":"2026-01-15T11:54:02.000Z","dependencies_parsed_at":"2024-10-13T04:40:52.534Z","dependency_job_id":"a5d64bab-8225-461e-a79b-5f1d4934f829","html_url":"https://github.com/tiny-blocks/country","commit_stats":{"total_commits":3,"total_committers":1,"mean_commits":3.0,"dds":0.0,"last_synced_commit":"86df04836d563f2d753ad84dba0179d4968996db"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/tiny-blocks/country","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiny-blocks%2Fcountry","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiny-blocks%2Fcountry/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiny-blocks%2Fcountry/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiny-blocks%2Fcountry/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tiny-blocks","download_url":"https://codeload.github.com/tiny-blocks/country/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tiny-blocks%2Fcountry/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29451942,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: 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":["country","country-codes","hacktoberfest","iso-3166","open-source","php","tiny-blocks","value-object"],"created_at":"2024-09-25T01:37:56.274Z","updated_at":"2026-02-14T18:03:20.731Z","avatar_url":"https://github.com/tiny-blocks.png","language":"PHP","readme":"# Country\n\n[![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)\n\n* [Overview](#overview)\n* [Installation](#installation)\n* [How to use](#how-to-use)\n* [License](#license)\n* [Contributing](#contributing)\n\n\u003cdiv id='overview'\u003e\u003c/div\u003e \n\n## Overview\n\nValue Object representing a country using ISO-3166 specifications.\n\n\u003cdiv id='installation'\u003e\u003c/div\u003e\n\n## Installation\n\n```bash\ncomposer require tiny-blocks/country\n```\n\n\u003cdiv id='how-to-use'\u003e\u003c/div\u003e\n\n## How to use\n\nThe library exposes country codes according to ISO-3166 specifications. Also, it is possible to create a\nrepresentation of a country that groups the codes and its name.\n\n### Alpha2Code\n\n**Alpha-2 code**: a two-letter code that represents a country name, recommended as the general purpose code.\n\n```php\n$alpha2Code = Alpha2Code::UNITED_STATES_OF_AMERICA;\n\n$alpha2Code-\u003ename;              # UNITED_STATES_OF_AMERICA\n$alpha2Code-\u003evalue;             # US\n$alpha2Code-\u003etoAlpha3()-\u003evalue; # USA\n```\n\n### Alpha3Code\n\n**Alpha-3 code**: a three-letter code that represents a country name, which is usually more closely related to the\ncountry name.\n\n```php\n$alpha3Code = Alpha3Code::UNITED_STATES_OF_AMERICA;\n\n$alpha3Code-\u003ename;              # UNITED_STATES_OF_AMERICA\n$alpha3Code-\u003evalue;             # USA\n$alpha3Code-\u003etoAlpha2()-\u003evalue; # US\n```\n\n### Country\n\nA country might change a significant part of its name, so there is no specific ISO for this case.\n\nYou can create an instance of `Country`, using the `from` method, informing an alpha code (`Alpha2Code`or `Alpha3Code`),\nwhere they can be of type `AlphaCode` or just `strings`. Optionally, you can enter the name of the country. If the\ncountry name is not given in the `from` method, then the default is to assume an English version of the country name.\n\n```php\n$country = Country::from(alphaCode: Alpha2Code::UNITED_STATES_OF_AMERICA);\n\n$country-\u003ename;          # United States of America\n$country-\u003ealpha2-\u003evalue; # US\n$country-\u003ealpha3-\u003evalue; # USA\n```\n\nor\n\n```php\n$country = Country::from(alphaCode: 'US');\n\n$country-\u003ename;          # United States of America\n$country-\u003ealpha2-\u003evalue; # US\n$country-\u003ealpha3-\u003evalue; # USA\n```\n\nCreating an instance passing the country name.\n\n```php\n$country = Country::from(alphaCode: Alpha3Code::UNITED_STATES_OF_AMERICA, name: 'United States');\n\n$country-\u003ename;          # United States\n$country-\u003ealpha2-\u003evalue; # US\n$country-\u003ealpha3-\u003evalue; # USA\n```\n\n\u003cdiv id='license'\u003e\u003c/div\u003e\n\n## License\n\nCountry is licensed under [MIT](LICENSE).\n\n\u003cdiv id='contributing'\u003e\u003c/div\u003e\n\n## Contributing\n\nPlease follow the [contributing guidelines](https://github.com/tiny-blocks/tiny-blocks/blob/main/CONTRIBUTING.md) to\ncontribute to the project.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiny-blocks%2Fcountry","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftiny-blocks%2Fcountry","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftiny-blocks%2Fcountry/lists"}