Skip to content

Commit

Permalink
refactor(core): ♻️ remove unnessecary params
Browse files Browse the repository at this point in the history
  • Loading branch information
alistair3149 committed Nov 15, 2023
1 parent 6f5b761 commit c50a0cd
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions includes/Partials/BodyContent.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,10 +157,7 @@ private function makeSections( DOMDocument $doc, array $headingWrappers ) {
// If we've found a top level heading, insert the previous section if
// necessary and clear the container div.
if ( $firstHeadingName && $this->getHeadingName( $node ) === $firstHeadingName ) {
// The heading we are transforming is always 1 section ahead of the
// section we are currently processing
/** @phan-suppress-next-line PhanTypeMismatchArgument DOMNode vs. DOMElement */
$this->prepareHeading( $doc, $node, $sectionNumber + 1 );
$this->prepareHeading( $doc, $node );
// Insert the previous section body and reset it for the new section
$container->insertBefore( $sectionBody, $node );

Expand All @@ -185,9 +182,8 @@ private function makeSections( DOMDocument $doc, array $headingWrappers ) {
*
* @param DOMDocument $doc
* @param DOMElement $heading
* @param int $sectionNumber
*/
private function prepareHeading( DOMDocument $doc, DOMElement $heading, $sectionNumber ) {
private function prepareHeading( DOMDocument $doc, DOMElement $heading ) {
$className = $heading->hasAttribute( 'class' ) ? $heading->getAttribute( 'class' ) . ' ' : '';
$heading->setAttribute( 'class', $className . 'citizen-section-heading' );

Expand Down

0 comments on commit c50a0cd

Please sign in to comment.