{"id":18323632,"url":"https://github.com/mortalflesh/symfony-console-subscriber","last_synced_at":"2026-02-03T20:04:22.490Z","repository":{"id":26393084,"uuid":"108745125","full_name":"MortalFlesh/symfony-console-subscriber","owner":"MortalFlesh","description":"Console Subscriber for Symfony Console","archived":false,"fork":false,"pushed_at":"2022-07-25T14:08:16.000Z","size":37,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-06T13:58:29.308Z","etag":null,"topics":["symfony","symfony-console","symfony-eventdispatcher","symfony-style"],"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/MortalFlesh.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-10-29T15:14:47.000Z","updated_at":"2022-07-26T06:10:57.000Z","dependencies_parsed_at":"2022-08-07T12:00:28.463Z","dependency_job_id":null,"html_url":"https://github.com/MortalFlesh/symfony-console-subscriber","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MortalFlesh%2Fsymfony-console-subscriber","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MortalFlesh%2Fsymfony-console-subscriber/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MortalFlesh%2Fsymfony-console-subscriber/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MortalFlesh%2Fsymfony-console-subscriber/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MortalFlesh","download_url":"https://codeload.github.com/MortalFlesh/symfony-console-subscriber/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240059314,"owners_count":19741631,"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":["symfony","symfony-console","symfony-eventdispatcher","symfony-style"],"created_at":"2024-11-05T18:28:56.336Z","updated_at":"2026-02-03T20:04:22.457Z","avatar_url":"https://github.com/MortalFlesh.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"Symfony Console Subscriber\n==========================\n\n[![Latest Stable Version](https://img.shields.io/packagist/v/mf/symfony-console-subscriber.svg)](https://packagist.org/packages/mf/symfony-console-subscriber)\n[![Tests and linting](https://github.com/MortalFlesh/symfony-console-subscriber/actions/workflows/tests.yaml/badge.svg)](https://github.com/MortalFlesh/symfony-console-subscriber/actions/workflows/tests.yaml)\n[![Coverage Status](https://coveralls.io/repos/github/MortalFlesh/symfony-console-subscriber/badge.svg?branch=master)](https://coveralls.io/github/MortalFlesh/symfony-console-subscriber?branch=master)\n[![Total Downloads](https://img.shields.io/packagist/dt/mf/symfony-console-subscriber.svg)](https://packagist.org/packages/mf/symfony-console-subscriber)\n[![License](https://img.shields.io/packagist/l/mf/symfony-console-subscriber.svg)](https://packagist.org/packages/mf/symfony-console-subscriber)\n\nConsole Subscriber for Symfony Console.\n\n\n## Installation\n```bash\ncomposer require mf/symfony-console-subscriber\n```\n\n\n## Usage\n\n### Comparision\nIt is same as using `SymfonyStyle` directly, you just use `EventDispatcher` to handle your events.\n\n`SymfonyStyle`\n```php\n$io-\u003enote('note');\n    \n// vs Dispatching\n    \n$eventDispatcher-\u003edispatch(new NoteEvent('Some note.'));\n```\n\n\n### initialization\n```php\n$io = new SymfonyStyle();\n$subscriber = new ConsoleSubscriber();\n\n$subscriber-\u003esetIo($io);\n\n$eventDispatcher-\u003eaddSubscriber($subscriber);\n```\n\n### dispatch\nNote\n```php\n$eventDispatcher-\u003edispatch(new NoteEvent('Some note.'));\n```\n\nProgress\n```php\n$items = [1, 2, 3];\n    \n$eventDispatcher-\u003edispatch(new ProgressStartEvent($items));\n\nforeach($items as $i) {\n    // do something\n    \n    $eventDispatcher-\u003edispatch(new ProgressAdvanceEvent());\n}\n\n$eventDispatcher-\u003edispatch(new ProgressFinishedEvent('All items were iterated!'));\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmortalflesh%2Fsymfony-console-subscriber","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmortalflesh%2Fsymfony-console-subscriber","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmortalflesh%2Fsymfony-console-subscriber/lists"}