From d2b0b317e025d6e42bd8389258b3e6ca9d4dfed1 Mon Sep 17 00:00:00 2001 From: troosan Date: Mon, 4 Feb 2019 22:57:33 +0100 Subject: [PATCH] fix scrutinizer warnings --- src/PhpWord/TemplateProcessor.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/PhpWord/TemplateProcessor.php b/src/PhpWord/TemplateProcessor.php index 9e12028d..0a366617 100644 --- a/src/PhpWord/TemplateProcessor.php +++ b/src/PhpWord/TemplateProcessor.php @@ -1088,7 +1088,7 @@ class TemplateProcessor protected function replaceXmlBlock($macro, $block, $blockType = 'w:p') { $where = $this->findContainingXmlBlockForMacro($macro, $blockType); - if (false !== $where) { + if (is_array($where)) { $this->tempDocumentMainPart = $this->getSlice(0, $where['start']) . $block . $this->getSlice($where['end']); } @@ -1132,7 +1132,7 @@ class TemplateProcessor * Note that only the first instance of the macro will be found * * @param string $search Macro name - * @param string $offset Offset from which to start searching + * @param int $offset Offset from which to start searching * @return int -1 if macro not found */ protected function findMacro($search, $offset = 0)