Mac OS X  2°âATTR à☘com.apple.quarantine0001;54427f57;Firefox;This resource fork intentionally left blank ÿÿs passed * * @param string $elementName * @return \PhpOffice\PhpWord\Element\AbstractElement */ protected function addElement($elementName) { $elementClass = __NAMESPACE__ . '\\' . $elementName; $this->checkValidity($elementName); // Get arguments $args = func_get_args(); $withoutP = in_array($this->container, array('TextRun', 'Footnote', 'Endnote', 'ListItemRun', 'Field')); if ($withoutP && ($elementName == 'Text' || $elementName == 'PreserveText')) { $args[3] = null; // Remove paragraph style for texts in textrun } $source = ''; if (count($args) > 1) { $source = $args[1]; } // Create element using reflection $reflection = new \ReflectionClass($elementClass); $elementArgs = $args; array_shift($elementArgs); // Shift the $elementName off the beginning of array /** @var \PhpOffice\PhpWord\Element\AbstractElement $element Type hint */ $element = $reflection->newInstanceArgs($elementArgs); // Set nested level and relation Id $this->setElementNestedLevel($element); $this->setElementRelationId($element, $elementName, $source); // Set other properties and add element into collection $element->setDocPart($this->getDocPart(), $this->getDocPartId()); $element->setElementIndex($this->countElements() + 1); $element->setElementId(); $element->setPhpWord($this->phpWord); $this->elements[] = $element; return $element; } /** * Get all elements * * @return array */ public function getElements() { return $this->elements; } /** * Count elements * * @return int */ public function countElements() { return count($this->elements); } /** * Set element nested level based on container; add one when it's inside a cell */ private function setElementNestedLevel(AbstractElement $el