PhpOffice\PhpPresentation\Shape\RichText::setParagraphs PHP Méthode

setParagraphs() public méthode

Set paragraphs
public setParagraphs ( Paragraph[] $paragraphs = null ) : RichText
$paragraphs PhpOffice\PhpPresentation\Shape\RichText\Paragraph[] Array of paragraphs
Résultat RichText
    public function setParagraphs($paragraphs = null)
    {
        if (!is_array($paragraphs)) {
            throw new \Exception("Invalid \\PhpOffice\\PhpPresentation\\Shape\\RichText\\Paragraph[] array passed.");
        }
        $this->richTextParagraphs = $paragraphs;
        $this->activeParagraph = count($this->richTextParagraphs) - 1;
        return $this;
    }

Usage Example

 /**
  * @expectedException \Exception
  * expectedExceptionMessage Invalid \PhpOffice\PhpPresentation\Shape\RichText\Paragraph[] array passed.
  */
 public function testParagraphsException()
 {
     $object = new RichText();
     $object->setParagraphs(1000);
 }