public function align(Formatter $formatter, $indentation = 0)
    {
        $this->textOffset = 0;

        foreach ($this->paragraphs as $i => $item) {
            $label = $formatter->removeFormat($item->getLabel());
            $textOffset = $this->indentations[$i] + strlen($label) + $item->getPadding();

            $this->textOffset = max($this->textOffset, $textOffset);
        }

        $this->textOffset += $indentation;
    }
public function align(Formatter $formatter, $indentation = 0)
    {
        $this->textOffset = 0;

        foreach ($this->paragraphs as $i => $item) {
            $label = $formatter->removeFormat($item->getLabel());
            $textOffset = $this->indentations[$i] + strlen($label) + $item->getPadding();

            $this->textOffset = max($this->textOffset, $textOffset);
        }

        $this->textOffset += $indentation;
    }
public function align ( Formatter $ formatter , $ indentation = 0 ) { $ this -> textOffset = 0 ; foreach ( $ this -> paragraphs as $ i => $ item ) { $ label = $ formatter -> removeFormat ( $ item -> getLabel ( ) ) ; $ textOffset = $ this -> indentations [ $ i ] + strlen ( $ label ) + $ item -> getPadding ( ) ; $ this -> textOffset = max ( $ this -> textOffset , $ textOffset ) ; } $ this -> textOffset += $ indentation ; }
Calculates the text offset based on all labels in the alignment.

The passed indentation is added to the indentations of all labeled
paragraphs.

@param Formatter $formatter   The formatter used to remove style tags when
calculating the label width.
@param int       $indentation The indentation.
Calculates the text offset based on all labels in the alignment .