Exposes string manipulation methods from the symfony/string package

2.x-dev 2023-11-10 18:35 UTC

This package is auto-updated.

Last update: 2023-12-10 18:53:38 UTC


CircleCI codecov

This Robo task is useful when you need to do string manipulation in a \Robo\State\Data.


composer require sweetchuck/robo-string

Task - taskStringUnicode()


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
                    ->callAppend(" $suffix")
            ->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

Is empty: false
Snake: hello_world
Result: hello_world