public function pipe($stages): void
    {
        if ($stages instanceof PipelineInterface) {
            $stages = $stages->stages();
        }

        if (!\is_array($stages)) {
            $this->stages[] = $stages;

            return;
        }

        foreach ($stages as $stage) {
            $this->pipe($stage);
        }
    }
public function pipe($stages): void
    {
        if ($stages instanceof PipelineInterface) {
            $stages = $stages->stages();
        }

        if (!\is_array($stages)) {
            $this->stages[] = $stages;

            return;
        }

        foreach ($stages as $stage) {
            $this->pipe($stage);
        }
    }
public function pipe ( $ stages ) : void { if ( $ stages instanceof PipelineInterface ) { $ stages = $ stages -> stages ( ) ; } if ( ! \ is_array ( $ stages ) ) { $ this -> stages [ ] = $ stages ; return ; } foreach ( $ stages as $ stage ) { $ this -> pipe ( $ stage ) ; } }
Add a stage to the Pipeline.

@param callable|string|PipelineInterface|array $stages
Add a stage to the Pipeline .