{"id":16673622,"url":"https://github.com/nathan-fiscaletti/parameterparser","last_synced_at":"2025-10-30T09:11:17.751Z","repository":{"id":57023253,"uuid":"73029011","full_name":"nathan-fiscaletti/parameterparser","owner":"nathan-fiscaletti","description":"✔️An advanced parameter parser for PHP","archived":false,"fork":false,"pushed_at":"2019-07-14T00:56:26.000Z","size":140,"stargazers_count":8,"open_issues_count":1,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-09T20:06:33.545Z","etag":null,"topics":["cli","command-line","parameters","php","php-cli"],"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/nathan-fiscaletti.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}},"created_at":"2016-11-07T00:43:03.000Z","updated_at":"2021-08-28T11:31:17.000Z","dependencies_parsed_at":"2022-08-23T14:20:47.082Z","dependency_job_id":null,"html_url":"https://github.com/nathan-fiscaletti/parameterparser","commit_stats":null,"previous_names":[],"tags_count":23,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-fiscaletti%2Fparameterparser","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-fiscaletti%2Fparameterparser/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-fiscaletti%2Fparameterparser/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nathan-fiscaletti%2Fparameterparser/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nathan-fiscaletti","download_url":"https://codeload.github.com/nathan-fiscaletti/parameterparser/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248103872,"owners_count":21048245,"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":["cli","command-line","parameters","php","php-cli"],"created_at":"2024-10-12T12:27:32.236Z","updated_at":"2025-10-30T09:11:12.711Z","avatar_url":"https://github.com/nathan-fiscaletti.png","language":"PHP","readme":"# Parameter Parser\n\u003e **Parameter Parser** is a simple library used to parse intricate parameters from an array of strings.\n\n\u003e **Hint**: Parameter Parser is available through [Composer](https://getcomposer.org). `composer require nafisc/parameterparser`.\n\n[![StyleCI](https://styleci.io/repos/73029011/shield?style=flat)](https://styleci.io/repos/73029011)\n[![Latest Stable Version](https://poser.pugx.org/nafisc/parameterparser/v/stable?format=flat)](https://packagist.org/packages/nafisc/parameterparser)\n[![Total Downloads](https://poser.pugx.org/nafisc/parameterparser/downloads?format=flat)](https://packagist.org/packages/nafisc/parameterparser)\n[![Latest Unstable Version](https://poser.pugx.org/nafisc/parameterparser/v/unstable?format=flat)](https://packagist.org/packages/nafisc/parameterparser)\n[![License](https://poser.pugx.org/nafisc/parameterparser/license?format=flat)](https://packagist.org/packages/nafisc/parameterparser)\n\n[Documentation](./docs/) - [Advanced Code Examples](./examples/Example1.md) - [Looking for the Python version?](https://github.com/nathan-fiscaletti/parameterparser-py)\n\n### Features\n* Parse command line parameters.\n* Assign aliases to parameters.\n* Custom closures for each command line parameter.\n* Variadic closure support for arguments taking more than one value.\n* Customize the way the command line is parsed.\n\n### Example Usage\n```php\n// Initialize a new Cluster\n$parameters = new Cluster();\n\n// Add a Parameter to the Cluster\n$parameter = parameter('-', 'name', function ($name) {\n    return $name;\n});\n\n$parameter-\u003esetRequired(true)\n          -\u003esetDescription('Your name.');\n\n$parameters-\u003eadd($parameter);\n\n// Create a new Parser using the Cluster\n$parser = new Parser($argv, $parameters);\n\n// Parse the parameters using the Parser.\n$results = $parser-\u003eparse();\n\n// Verify that the parameters were valid after parsing.\nif (! $parser-\u003eisValid()) {\n\n    // Since it was not valid, output usage.\n    $parameters-\u003eprintFullUsage(\n        \"Parameter Parser\",\n        \"An advanced parameter parser for PHP\",\n        \"v1.0.0\"\n    );\n\n} else {\n\n    // Retrieve the name from the results\n    $name = $results['name'];\n\n    // Output the name\n    echo 'Your name is ' . $name . PHP_EOL;\n\n}\n```\n\n### Output\n```\n~/ php test.php -name 'Nathan Fiscaletti'\n\n   Your name is Nathan Fiscaletti\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathan-fiscaletti%2Fparameterparser","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnathan-fiscaletti%2Fparameterparser","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnathan-fiscaletti%2Fparameterparser/lists"}