mf/symfony-console-subscriber 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

mf/symfony-console-subscriber

最新稳定版本:3.0.0

Composer 安装命令:

composer require mf/symfony-console-subscriber

包简介

Console Subscriber for Symfony Console

README 文档

README

Latest Stable Version Tests and linting Coverage Status Total Downloads License

Console Subscriber for Symfony Console.

Installation

composer require mf/symfony-console-subscriber

Usage

Comparision

It is same as using SymfonyStyle directly, you just use EventDispatcher to handle your events.

SymfonyStyle

$io->note('note');
    
// vs Dispatching
    
$eventDispatcher->dispatch(new NoteEvent('Some note.'));

initialization

$io = new SymfonyStyle();
$subscriber = new ConsoleSubscriber();

$subscriber->setIo($io);

$eventDispatcher->addSubscriber($subscriber);

dispatch

Note

$eventDispatcher->dispatch(new NoteEvent('Some note.'));

Progress

$items = [1, 2, 3];
    
$eventDispatcher->dispatch(new ProgressStartEvent($items));

foreach($items as $i) {
    // do something
    
    $eventDispatcher->dispatch(new ProgressAdvanceEvent());
}

$eventDispatcher->dispatch(new ProgressFinishedEvent('All items were iterated!'));

统计信息

  • 总下载量: 1.21k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-10-29