sweetchuck/robo-string
Composer 安装命令:
composer require sweetchuck/robo-string
包简介
Exposes string manipulation methods from the symfony/string package
关键字:
README 文档
README
This Robo task is useful when you need to do string manipulation in a
\Robo\State\Data.
Install
composer require sweetchuck/robo-string
Task - taskStringUnicode()
<?php declare(strict_types = 1); use Robo\Tasks; use Robo\State\Data as StateData; use Sweetchuck\Robo\String\StringTaskLoader; class RoboFileExample extends Tasks { use StringTaskLoader; /** * @command string:simple */ public function cmdStringSimpleExecute(string $string = 'Hello', string $suffix = 'World') { return $this ->collectionBuilder() ->addTask( $this ->taskStringUnicode() ->setString($string) ->callIsEmpty() ->callAppend(" $suffix") ->callSnake() ) ->addCode(function (StateData $data): int { $output = $this->output(); $output->writeln('Is empty: ' . var_export($data['string.isEmpty'], true)); $output->writeln("Snake: {$data['string.snake']}"); $output->writeln("Result: {$data['string']}"); return 0; }); } }
Run vendor/bin/robo string:simple
Output:
Is empty: false Snake: hello_world Result: hello_world
统计信息
- 总下载量: 4.98k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: GPL-2.0-or-later
- 更新时间: 2023-07-25