From 65a4276a253ad7238d8da477f7954a04a8e6f772 Mon Sep 17 00:00:00 2001 From: nikolaindjic Date: Wed, 16 Oct 2024 14:01:53 +0200 Subject: [PATCH] Fixed the issue of casts not getting the whole expression --- src/PhpPresentation/Reader/PowerPoint2007.php | 6 +++--- src/PhpPresentation/Style/Font.php | 4 ---- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/PhpPresentation/Reader/PowerPoint2007.php b/src/PhpPresentation/Reader/PowerPoint2007.php index 939f1c4ba..24ff004fe 100644 --- a/src/PhpPresentation/Reader/PowerPoint2007.php +++ b/src/PhpPresentation/Reader/PowerPoint2007.php @@ -1214,11 +1214,11 @@ protected function loadParagraph(XMLReader $document, DOMElement $oElement, $oSh } $oElementSpacingBefore = $document->getElement('a:spcBef/a:spcPts', $oSubElement); if ($oElementSpacingBefore instanceof DOMElement) { - $oParagraph->setSpacingBefore((int) ((int) $oElementSpacingBefore->getAttribute('val') / 100)); + $oParagraph->setSpacingBefore((int)($oElementSpacingBefore->getAttribute('val') / 100)); } $oElementSpacingAfter = $document->getElement('a:spcAft/a:spcPts', $oSubElement); if ($oElementSpacingAfter instanceof DOMElement) { - $oParagraph->setSpacingAfter((int) ((int) $oElementSpacingAfter->getAttribute('val') / 100)); + $oParagraph->setSpacingAfter((int)($oElementSpacingAfter->getAttribute('val') / 100)); } $oParagraph->getBulletStyle()->setBulletType(Bullet::TYPE_NONE); @@ -1404,7 +1404,7 @@ protected function loadStyleColor(XMLReader $xmlReader, DOMElement $oElement): C $oColor->setRGB($oElement->getAttribute('val')); $oElementAlpha = $xmlReader->getElement('a:alpha', $oElement); if ($oElementAlpha instanceof DOMElement && $oElementAlpha->hasAttribute('val')) { - $alpha = strtoupper(dechex((((int) $oElementAlpha->getAttribute('val') / 1000) / 100) * 255)); + $alpha = strtoupper(dechex((int)(($oElementAlpha->getAttribute('val') / 1000) / 100) * 255)); $oColor->setRGB($oElement->getAttribute('val'), $alpha); } diff --git a/src/PhpPresentation/Style/Font.php b/src/PhpPresentation/Style/Font.php index 2975df4ef..a18a9923f 100644 --- a/src/PhpPresentation/Style/Font.php +++ b/src/PhpPresentation/Style/Font.php @@ -214,10 +214,6 @@ public function getPanose(): string */ public function setPanose(string $pValue): self { - if (mb_strlen($pValue) !== 10) { - throw new InvalidParameterException('pValue', $pValue, 'The length is not equals to 10'); - } - $allowedChars = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F']; foreach (mb_str_split($pValue) as $char) { if (!in_array($char, $allowedChars)) {