Closes a row's open tags to be ready for the next one.

@param <type> $section

@return <type>
346135
private function wrapUp($section)
    {
        $html = $this->cell;
        $this->cell = '';
        switch ($section) {
            case 'head':
                if ($this->head) {
                    $html .= '</tr>';
                } else {
                    if ($this->foot) {
                        $html .= '</tr></tfoot>';
                        $this->foot = false;
                    } elseif ($this->body) {
                        $html .= '</tr></tbody>';
                        $this->body = false;
                    }
                    $html .= '<thead>';
                }
                break;
            case 'foot':
                if ($this->foot) {
                    $html .= '</tr>';
                } else {
                    if ($this->head) {
                        $html .= '</tr></thead>';
                        $this->head = false;
                    } elseif ($this->body) {
                        $html .= '</tr></tbody>';
                        $this->body = false;
                    }
                    $html .= '<tfoot>';
                }
                break;
            case 'row':
                if ($this->body) {
                    $html .= '</tr>';
                } else {
                    if ($this->head) {
                        $html .= '</tr></thead>';
                        $this->head = false;
                    } elseif ($this->foot) {
                        $html .= '</tr></tfoot>';
                        $this->foot = false;
                    }
                    $html .= '<tbody>';
                }
                break;
            case 'table':
                if ($this->head) {
                    $html .= '</tr></thead>';
                } elseif ($this->foot) {
                    $html .= '</tr></tfoot>';
                } elseif ($this->body) {
                    $html .= '</tr></tbody>';
                }
                break;
        }

        return $html;
    }
1027393
protected function extendSection($section, $content)
    {
        if (isset($this->sections[$section])) {
            $content = str_replace(static::parentPlaceholder($section), $content, $this->sections[$section]);
        }

        $this->sections[$section] = $content;
    }
1347073
public function close()
    {
        $tag = new Tag('form');
        $tag->closeMode = Tag::CLOSE_ONLY;

        $this->model = null;

        return $tag;
    }
169422
public function endSection(SectionInterface $section)
    {
        $this->newLine();

        if ($this->output->isVerbose()) {
            $message = sprintf('Section <fg=green>%s</> finished in <fg=green>%ss</>', $section->getName(), $this->timer->end($section));
            $this->writeln($message);
            $this->writeln(str_repeat('=', $this->lineLength));
            $this->newLine(3);
        }
    }
536241
private function storeSection($section, $content)
    {
        if (!isset($this->scope->sections[$section])) {
            $this->scope->sections[$section] = $content;
        }
    }
793870
public function is_section_object( $section ) {
		$types  = explode( '\\', get_class( $section ) );
		$excl   = array( 'help', 'header', 'footer', 'control' );
		$merge  = array_merge( $types, $excl );
		$unique = array_unique( $merge );

		return count( $merge ) === count( $unique );
	}
972532
public function renderSection(Section $section)
    {
        $output = sprintf("[%s]\n", $section->getName());

        foreach ($section->getProperties() as $key => $value) {
            $value = $this->normalizeValue($value);
            $output .= sprintf("%s = %s\n", $key, $value);
        }

        // Write a linefeed after sections
        $output .= "\n";

        return $output;
    }
953094
protected function getSection($section)
    {
        return isset($this->sections[$section])
            ? $this->sections[$section]
            : null;
    }
1217278
protected function autoclose($tag) {
        $working = $this->current;
        do {
            if ($working->nodeType != XML_ELEMENT_NODE) {
                return false;
            }
            if ($working->tagName == $tag) {
                $this->current = $working->parentNode;

                return true;
            }
        } while ($working = $working->parentNode);
        return false;
    }
333163
public function getSectionHistoryQuery(Section $section)
    {
        $queryBuilder = $this->createQueryBuilder('contribution')
            ->orderBy('contribution.creationDate', 'DESC')
            ->andWhere('contribution.section = :section')
            ->setParameter('section', $section);

        return $queryBuilder->getQuery();
    }
337956
public function make_section_globals($section) {
		if(!is_null($section) && strlen($section) && in_array($section, $this->get_valid_sections())) {
			foreach($this->fullConfig[$section] as $k=>$parsedValue) {
				//TODO: implement option to set a section/value as a GLOBAL
				$GLOBALS[$k] = $parsedValue;
			}
		}
		else {
			throw InvalidArgumentException("non-existent section, '". $section ."'");
		}
	}
219552
public function startSection($section, $content = null)
    {
        if ($content === null) {
            if (ob_start()) {
                $this->sectionStack[] = $section;
            }
        } else {
            $this->extendSection($section, e($content));
        }
    }
880535
public function lockSemaphore($id, string $section)
    {
        $key = $this->getSemaphoreKey($id, $section);

        $this->cache->put($key, 1, ['semaphore', $section], $this->lockingTime);
    }
604006
public static function createFromMultilingualSection(Section $section)
    {
        $parent = \Page::getByPath(STACKS_PAGE_PATH);
        $data = array();
        $data['name'] = $section->getLocale();
        $data['cHandle'] = $section->getLocale();
        $type = Type::getByHandle(STACK_CATEGORY_PAGE_TYPE);
        $page = $parent->add($type, $data);

        $sc = new self($page);

        return $sc;
    }
996053
public static function closeOpenTags($html)
    {
        preg_match_all("#<([a-z]+)( .*)?(?!/)>#iU", $html, $result);
        $openedTags = $result[1];
        preg_match_all("#</([a-z]+)>#iU", $html, $result);
        $closedTags = $result[1];
        $lenOpened = count($openedTags);

        if (count($closedTags) == $lenOpened) {
            return $html;
        }

        $openedTags = array_reverse($openedTags);
        for ($i = 0; $i < $lenOpened; $i++) {
            if (!in_array($openedTags[$i], $closedTags)) {
                $html .= '</' . $openedTags[$i] . '>';
            } else {
                unset($closedTags[array_search($openedTags[$i], $closedTags)]);
            }
        }

        return $html;
    }
1339749
public static function close()
    {
        //get the last opened tag
        $tag = self::$opened[count(self::$opened) - 1];

        //remove the last opened tag
        array_pop(self::$opened);

        return '</'.$tag.'>';
    }
514411
protected function _section_end()
    {
        $last = array_pop($this->_last_section);
        $this->_section_extend($last, ob_get_clean());

        return $last;
    }