level = $level; $this->debugId = $debugId; $this->container = $ownerDoc->createElement( 'section' ); // Use named arguments here in PHP 8.0+ $this->metadata = new SectionMetadata( -1, /* tocLevel */ $level /* hLevel */ ); } public function setId( int $id ): void { $this->container->setAttribute( 'data-mw-section-id', (string)$id ); // $this->container->setAttribute( 'data-debug-id', (string)$this->debugId ); } public function setAboutId( string $aboutId ): void { $this->container->setAttribute( 'about', $aboutId ); } public function addNode( Node $node ): void { $this->container->appendChild( $node ); } public function addSection( Section $section ): void { // error_log( "Appending to " . $this->debugId . '\n' ); $this->container->appendChild( $section->container ); } /** * Does this section have a nesting level of $level? * @param int $level * @return bool */ public function hasNestedLevel( int $level ): bool { return $level > $this->level; } }