Webmozart\Console\UI\Component\LabeledParagraph::setAlignment PHP Method

setAlignment() public method

Sets the alignment used to align the paragraph.
public setAlignment ( LabelAlignment $alignment )
$alignment Webmozart\Console\UI\Alignment\LabelAlignment The alignment.
    public function setAlignment(LabelAlignment $alignment)
    {
        $this->alignment = $alignment;
    }

Usage Example

Esempio n. 1
0
 public function testRenderWithAlignmentIgnoresIfTextOffsetToSmall()
 {
     $alignment = new LabelAlignment();
     $alignment->setTextOffset(5);
     $para = new LabeledParagraph('Label', 'Text');
     $para->setAlignment($alignment);
     $para->render($this->io);
     $this->assertSame("Label  Text\n", $this->io->fetchOutput());
 }