Skip to content

Commit

Permalink
Fixed the issue of casts not getting the whole expression
Browse files Browse the repository at this point in the history
  • Loading branch information
nikolaindjic committed Oct 16, 2024
1 parent 04700ed commit 65a4276
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 7 deletions.
6 changes: 3 additions & 3 deletions src/PhpPresentation/Reader/PowerPoint2007.php
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Check failure on line 1217 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.3)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1217 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.2)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1217 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.0)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1217 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.1)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1217 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.2)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1217 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.4)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1217 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.3)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1217 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.1)

Binary operation "/" between string and 100 results in an error.
}
$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));

Check failure on line 1221 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.3)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1221 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.2)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1221 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.0)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1221 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.1)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1221 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.2)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1221 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.4)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1221 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.3)

Binary operation "/" between string and 100 results in an error.

Check failure on line 1221 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.1)

Binary operation "/" between string and 100 results in an error.
}

$oParagraph->getBulletStyle()->setBulletType(Bullet::TYPE_NONE);
Expand Down Expand Up @@ -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));

Check failure on line 1407 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.3)

Binary operation "/" between string and 1000 results in an error.

Check failure on line 1407 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.2)

Binary operation "/" between string and 1000 results in an error.

Check failure on line 1407 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.0)

Binary operation "/" between string and 1000 results in an error.

Check failure on line 1407 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (8.1)

Binary operation "/" between string and 1000 results in an error.

Check failure on line 1407 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.2)

Binary operation "/" between string and 1000 results in an error.

Check failure on line 1407 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.4)

Binary operation "/" between string and 1000 results in an error.

Check failure on line 1407 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.3)

Binary operation "/" between string and 1000 results in an error.

Check failure on line 1407 in src/PhpPresentation/Reader/PowerPoint2007.php

View workflow job for this annotation

GitHub Actions / PHP Static Analysis (7.1)

Binary operation "/" between string and 1000 results in an error.
$oColor->setRGB($oElement->getAttribute('val'), $alpha);
}

Expand Down
4 changes: 0 additions & 4 deletions src/PhpPresentation/Style/Font.php
Original file line number Diff line number Diff line change
Expand Up @@ -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)) {
Expand Down

0 comments on commit 65a4276

Please sign in to comment.