Scrutinizer Again

Cascading series of unused unused parameters.
This commit is contained in:
Owen Leibman 2020-06-25 23:39:28 -07:00
parent 752a0a5a6c
commit 9f1a33cc8a
1 changed files with 24 additions and 24 deletions

View File

@ -298,7 +298,7 @@ class Html extends BaseReader
$cellContent = (string) ''; $cellContent = (string) '';
} }
private function processDomElementBody(DOMNode $element, Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child): void private function processDomElementBody(Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child): void
{ {
$attributeArray = []; $attributeArray = [];
foreach ($child->attributes as $attribute) { foreach ($child->attributes as $attribute) {
@ -312,24 +312,24 @@ class Html extends BaseReader
$this->tableLevel = 0; $this->tableLevel = 0;
$this->processDomElement($child, $sheet, $row, $column, $cellContent); $this->processDomElement($child, $sheet, $row, $column, $cellContent);
} else { } else {
$this->processDomElementTitle($element, $sheet, $row, $column, $cellContent, $child, $attributeArray); $this->processDomElementTitle($sheet, $row, $column, $cellContent, $child, $attributeArray);
} }
} }
private function processDomElementTitle(DOMNode $element, Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void private function processDomElementTitle(Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void
{ {
if ($child->nodeName === 'title') { if ($child->nodeName === 'title') {
$this->processDomElement($child, $sheet, $row, $column, $cellContent); $this->processDomElement($child, $sheet, $row, $column, $cellContent);
$sheet->setTitle($cellContent, true, false); $sheet->setTitle($cellContent, true, false);
$cellContent = ''; $cellContent = '';
} else { } else {
$this->processDomElementSpanEtc($element, $sheet, $row, $column, $cellContent, $child, $attributeArray); $this->processDomElementSpanEtc($sheet, $row, $column, $cellContent, $child, $attributeArray);
} }
} }
private static $spanEtc = ['span', 'div', 'font', 'i', 'em', 'strong', 'b']; private static $spanEtc = ['span', 'div', 'font', 'i', 'em', 'strong', 'b'];
private function processDomElementSpanEtc(DOMNode $element, Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void private function processDomElementSpanEtc(Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void
{ {
if (in_array($child->nodeName, self::$spanEtc)) { if (in_array($child->nodeName, self::$spanEtc)) {
if (isset($attributeArray['class']) && $attributeArray['class'] === 'comment') { if (isset($attributeArray['class']) && $attributeArray['class'] === 'comment') {
@ -343,11 +343,11 @@ class Html extends BaseReader
$sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]); $sheet->getStyle($column . $row)->applyFromArray($this->formats[$child->nodeName]);
} }
} else { } else {
$this->processDomElementHr($element, $sheet, $row, $column, $cellContent, $child, $attributeArray); $this->processDomElementHr($sheet, $row, $column, $cellContent, $child, $attributeArray);
} }
} }
private function processDomElementHr(DOMNode $element, Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void private function processDomElementHr(Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void
{ {
if ($child->nodeName === 'hr') { if ($child->nodeName === 'hr') {
$this->flushCell($sheet, $column, $row, $cellContent); $this->flushCell($sheet, $column, $row, $cellContent);
@ -358,10 +358,10 @@ class Html extends BaseReader
++$row; ++$row;
} }
// fall through to br // fall through to br
$this->processDomElementBr($element, $sheet, $row, $column, $cellContent, $child, $attributeArray); $this->processDomElementBr($sheet, $row, $column, $cellContent, $child, $attributeArray);
} }
private function processDomElementBr(DOMNode $element, Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void private function processDomElementBr(Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void
{ {
if ($child->nodeName === 'br' || $child->nodeName === 'hr') { if ($child->nodeName === 'br' || $child->nodeName === 'hr') {
if ($this->tableLevel > 0) { if ($this->tableLevel > 0) {
@ -374,11 +374,11 @@ class Html extends BaseReader
++$row; ++$row;
} }
} else { } else {
$this->processDomElementA($element, $sheet, $row, $column, $cellContent, $child, $attributeArray); $this->processDomElementA($sheet, $row, $column, $cellContent, $child, $attributeArray);
} }
} }
private function processDomElementA(DOMNode $element, Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void private function processDomElementA(Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void
{ {
if ($child->nodeName === 'a') { if ($child->nodeName === 'a') {
foreach ($attributeArray as $attributeName => $attributeValue) { foreach ($attributeArray as $attributeName => $attributeValue) {
@ -400,13 +400,13 @@ class Html extends BaseReader
//$cellContent .= ' '; //$cellContent .= ' ';
$this->processDomElement($child, $sheet, $row, $column, $cellContent); $this->processDomElement($child, $sheet, $row, $column, $cellContent);
} else { } else {
$this->processDomElementH1Etc($element, $sheet, $row, $column, $cellContent, $child, $attributeArray); $this->processDomElementH1Etc($sheet, $row, $column, $cellContent, $child, $attributeArray);
} }
} }
private static $h1Etc = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ol', 'ul', 'p']; private static $h1Etc = ['h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'ol', 'ul', 'p'];
private function processDomElementH1Etc(DOMNode $element, Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void private function processDomElementH1Etc(Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void
{ {
if (in_array($child->nodeName, self::$h1Etc)) { if (in_array($child->nodeName, self::$h1Etc)) {
if ($this->tableLevel > 0) { if ($this->tableLevel > 0) {
@ -430,11 +430,11 @@ class Html extends BaseReader
$column = 'A'; $column = 'A';
} }
} else { } else {
$this->processDomElementLi($element, $sheet, $row, $column, $cellContent, $child, $attributeArray); $this->processDomElementLi($sheet, $row, $column, $cellContent, $child, $attributeArray);
} }
} }
private function processDomElementLi(DOMNode $element, Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void private function processDomElementLi(Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void
{ {
if ($child->nodeName === 'li') { if ($child->nodeName === 'li') {
if ($this->tableLevel > 0) { if ($this->tableLevel > 0) {
@ -451,20 +451,20 @@ class Html extends BaseReader
$column = 'A'; $column = 'A';
} }
} else { } else {
$this->processDomElementImg($element, $sheet, $row, $column, $cellContent, $child, $attributeArray); $this->processDomElementImg($sheet, $row, $column, $cellContent, $child, $attributeArray);
} }
} }
private function processDomElementImg(DOMNode $element, Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void private function processDomElementImg(Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void
{ {
if ($child->nodeName === 'img') { if ($child->nodeName === 'img') {
$this->insertImage($sheet, $column, $row, $attributeArray); $this->insertImage($sheet, $column, $row, $attributeArray);
} else { } else {
$this->processDomElementTable($element, $sheet, $row, $column, $cellContent, $child, $attributeArray); $this->processDomElementTable($sheet, $row, $column, $cellContent, $child, $attributeArray);
} }
} }
private function processDomElementTable(DOMNode $element, Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void private function processDomElementTable(Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void
{ {
if ($child->nodeName === 'table') { if ($child->nodeName === 'table') {
$this->flushCell($sheet, $column, $row, $cellContent); $this->flushCell($sheet, $column, $row, $cellContent);
@ -480,11 +480,11 @@ class Html extends BaseReader
++$row; ++$row;
} }
} else { } else {
$this->processDomElementTr($element, $sheet, $row, $column, $cellContent, $child, $attributeArray); $this->processDomElementTr($sheet, $row, $column, $cellContent, $child, $attributeArray);
} }
} }
private function processDomElementTr(DOMNode $element, Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void private function processDomElementTr(Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void
{ {
if ($child->nodeName === 'tr') { if ($child->nodeName === 'tr') {
$column = $this->getTableStartColumn(); $column = $this->getTableStartColumn();
@ -497,11 +497,11 @@ class Html extends BaseReader
++$row; ++$row;
} else { } else {
$this->processDomElementThTdOther($element, $sheet, $row, $column, $cellContent, $child, $attributeArray); $this->processDomElementThTdOther($sheet, $row, $column, $cellContent, $child, $attributeArray);
} }
} }
private function processDomElementThTdOther(DOMNode $element, Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void private function processDomElementThTdOther(Worksheet $sheet, int &$row, string &$column, string &$cellContent, DOMElement $child, array &$attributeArray): void
{ {
if ($child->nodeName !== 'td' && $child->nodeName !== 'th') { if ($child->nodeName !== 'td' && $child->nodeName !== 'th') {
$this->processDomElement($child, $sheet, $row, $column, $cellContent); $this->processDomElement($child, $sheet, $row, $column, $cellContent);
@ -622,7 +622,7 @@ class Html extends BaseReader
// but if we have a rich text run instead, we need to append it correctly // but if we have a rich text run instead, we need to append it correctly
// TODO // TODO
} elseif ($child instanceof DOMElement) { } elseif ($child instanceof DOMElement) {
$this->processDomElementBody($element, $sheet, $row, $column, $cellContent, $child); $this->processDomElementBody($sheet, $row, $column, $cellContent, $child);
} }
} }
} }