1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-07-28 17:02:04 +03:00

PHPStan: Fixed larastan loading and address some level2 issues

This commit is contained in:
Dan Brown
2023-12-10 14:58:05 +00:00
parent 45ce7a7126
commit c13fd2a9e6
9 changed files with 14 additions and 10 deletions

View File

@ -62,6 +62,7 @@ class PageContent
// Get all img elements with image data blobs
$imageNodes = $doc->queryXPath('//img[contains(@src, \'data:image\')]');
/** @var DOMElement $imageNode */
foreach ($imageNodes as $imageNode) {
$imageSrc = $imageNode->getAttribute('src');
$newUrl = $this->base64ImageUriToUploadedImageUrl($imageSrc, $updater);

View File

@ -72,8 +72,8 @@ class PageIncludeParser
$includeTags = [];
/** @var DOMNode $node */
/** @var DOMNode $childNode */
foreach ($includeHosts as $node) {
/** @var DOMNode $childNode */
foreach ($node->childNodes as $childNode) {
if ($childNode->nodeName === '#text') {
array_push($includeTags, ...$this->splitTextNodesAtTags($childNode));
@ -174,8 +174,8 @@ class PageIncludeParser
$parentNode->parentNode->insertBefore($parentClone, $parentNode);
$parentClone->removeAttribute('id');
/** @var DOMNode $child */
for ($i = 0; $i < $splitPos; $i++) {
/** @var DOMNode $child */
$child = $children[$i];
$parentClone->appendChild($child);
}