PHP code example of emeraldinspirations / lib-helper-pipe

1. Go to this page and download the library: Download emeraldinspirations/lib-helper-pipe library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

emeraldinspirations / lib-helper-pipe example snippets




return new \ArrayObject(
    [
        implode(
            '',
            array_reverse(
                str_split(
                    strtoupper(
                        'test string'
                    )
                )
            )
        )
    ]
);



use emeraldinspirations\library\helper\pipe\Pipe;

return (new Pipe('test string'))
    ->to('strtoupper')
    ->thenTo('str_split')
    ->thenTo('array_reverse')
    ->thenTo(
        Pipe::delegateWithParamMask('implode', ['', Pipe::here()])
    )
    ->thenTo(
        function ($Param) {
            return [$Param];
        }
    )
    ->thenTo(
        Pipe::delegateConstructor(\ArrayObject::class)
    )
    ->return();



// Example with (callable $Function, array $Prepend = [], array $Append = [])
    // ...
    ->thenTo('implode', [''], [])
    // ...


// Example with (callable $Function, array $ParameterMask = [self::Here])
    // ...
    ->thenTo('implode', ['', Pipe::Here])
    // ...