PhpOffice\PhpPresentation\Shape\RichText::getParagraph PHP Метод

getParagraph() публичный Метод

Get paragraph
public getParagraph ( integer $index ) : Paragraph
$index integer
Результат PhpOffice\PhpPresentation\Shape\RichText\Paragraph
    public function getParagraph($index = 0)
    {
        if ($index >= count($this->richTextParagraphs)) {
            throw new \Exception("Invalid paragraph count.");
        }
        return $this->richTextParagraphs[$index];
    }

Usage Example

Пример #1
0
 /**
  * @expectedException \Exception
  * expectedExceptionMessage Invalid paragraph count.
  */
 public function testGetParagraphException()
 {
     $object = new RichText();
     $object->getParagraph(1000);
 }