{"id":15653120,"url":"https://github.com/icanhazstring/symfony-console-spinner","last_synced_at":"2025-04-14T16:17:39.140Z","repository":{"id":53759128,"uuid":"240551316","full_name":"icanhazstring/symfony-console-spinner","owner":"icanhazstring","description":"Custom symfony progressbar displaying a spinner","archived":false,"fork":false,"pushed_at":"2024-03-27T13:05:12.000Z","size":107,"stargazers_count":30,"open_issues_count":0,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-28T05:01:39.460Z","etag":null,"topics":[],"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/icanhazstring.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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-02-14T16:25:09.000Z","updated_at":"2023-03-30T02:50:05.000Z","dependencies_parsed_at":"2024-01-07T17:51:12.540Z","dependency_job_id":"7f8cafb9-f765-4795-a0ef-9a0bd6060fda","html_url":"https://github.com/icanhazstring/symfony-console-spinner","commit_stats":{"total_commits":9,"total_committers":7,"mean_commits":"1.2857142857142858","dds":0.6666666666666667,"last_synced_commit":"849c91a8ac19079d6f24c6b4f46540e96df45ead"},"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icanhazstring%2Fsymfony-console-spinner","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icanhazstring%2Fsymfony-console-spinner/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icanhazstring%2Fsymfony-console-spinner/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/icanhazstring%2Fsymfony-console-spinner/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/icanhazstring","download_url":"https://codeload.github.com/icanhazstring/symfony-console-spinner/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248710436,"owners_count":21149190,"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":[],"created_at":"2024-10-03T12:44:44.752Z","updated_at":"2025-04-14T16:17:39.115Z","avatar_url":"https://github.com/icanhazstring.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# symfony-console-spinner\n\nCustom symfony progressbar with a spinner.\n\nI wanted a progressbar displaying a long running task like\nwaiting for an external resource to be available. This is where I\nstumbled upon [alecrabbit/php-cli-snake](https://github.com/alecrabbit/php-cli-snake).\n\nI tried to mimic the the animation using symfony/console and this\nis the result:\n\n![example of multiple progress bars with this spinner component](docs/spinnerprogress.gif)\n\n## Installation\n\nUse composer to require the small package\n\n```bash\ncomposer require icanhazstring/symfony-console-spinner\n```\n\n## Usage\n\nTo use the spinner, just instantiate the `SpinnerProgress` like the\ndefault `ProgressBar` from symfony giving it the `OutputInterface` and\nthe maximum count of items to process:\n\n```php\npublic function execute(OutputInterface $output, InputInterface $input)\n{\n    $spinner = new SpinnerProgress($output, 100);\n\n    for($i = 0; $i \u003c 100; $i++) {\n\n        usleep(1000);\n\n        $spinner-\u003eadvance();\n\n    }\n\n    $spinner-\u003efinish();\n}\n```\n\nYou can also get the underlying `ProgressBar` instance if you want to change anything, for example adding the elapsed time to the output format:\n\n```php\n$spinner = new SpinnerProgress($output, 100);\n$spinner-\u003egetProgressBar()-\u003esetFormat('%bar% (%elapsed:6s%) %message%');\n```\n\n## License\n\nThis package is released under the [MIT license](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficanhazstring%2Fsymfony-console-spinner","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ficanhazstring%2Fsymfony-console-spinner","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ficanhazstring%2Fsymfony-console-spinner/lists"}