sweetchuck/robo-stringy
Composer 安装命令:
composer require sweetchuck/robo-stringy
包简介
Exposes Stringy string manipulation methods
关键字:
README 文档
README
This Robo task is useful when you need to do string manipulation in a
\Robo\State\Data.
Install
composer require sweetchuck/robo-stringy
Task - taskStringy()
<?php class RoboFile extends \Robo\Tasks { use \Sweetchuck\Robo\Stringy\StringyTaskLoader; /** * @command stringy:simple */ public function cmdStringySimple(string $text = 'Hello', string $suffix = 'World') { return $this ->collectionBuilder() ->addTask( $this ->taskStringy() ->setString($text) ->callIsUpperCase() ->callAppend(" $suffix") ->callUnderscored() ) ->addCode(function (\Robo\State\Data $data): int { $output = $this->output(); $output->writeln('Is upper case: ' . var_export($data['stringy.isUpperCase'], true)); $output->writeln("Result: {$data['stringy']}"); return 0; }); } }
Run vendor/bin/robo stringy:simple
Output:
Is upper case: false Result: hello_world
Run vendor/bin/robo stringy:simple FOO
Output:
Is upper case: true Result: f_o_o_world
统计信息
- 总下载量: 97.06k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2018-05-06