https://github.com/sweetchuck/robo-stringy
https://github.com/sweetchuck/robo-stringy
robo-task string-manipulation stringy
Last synced: 5 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/sweetchuck/robo-stringy
- Owner: Sweetchuck
- Created: 2018-05-05T20:56:54.000Z (almost 8 years ago)
- Default Branch: 2.x
- Last Pushed: 2024-11-06T19:55:52.000Z (over 1 year ago)
- Last Synced: 2025-08-29T23:52:29.650Z (6 months ago)
- Topics: robo-task, string-manipulation, stringy
- Language: PHP
- Size: 207 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Robo Stringy
[](https://circleci.com/gh/Sweetchuck/robo-stringy/?branch=2.x)
[](https://app.codecov.io/gh/Sweetchuck/robo-stringy/branch/2.x)
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
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