Converts wp.org readme section items to h4 style.

@param string $section Readme section.
@param array  $data Array of parsed readme data.

@return array $data
321672
public function readme_section_as_h4( $section, $data ) {
		if ( empty( $data['sections'][ $section ] ) || false !== strpos( $data['sections'][ $section ], '<h4>' ) ) {
			return $data;
		}
		$pattern = '~<p>=(.*)=</p>~';
		$replace = '<h4>$1</h4>';

		$data['sections'][ $section ] = preg_replace( $pattern, $replace, $data['sections'][ $section ] );

		return $data;
	}
101405
public function addSection( $section )
	{
		if ( !( isset( $this->data[$section] ) && is_array( $this->data[$section] ) ) )
			$this->data[$section]	= array();
		$this->currentSection	= $section;
	}
630623
private function arrayToHtml(array $data): string
    {
        $html = file_get_contents($this->path);

        foreach ($data as $key => $val) {
            $html = str_replace("{{ $$key }}", $val, $html);
        }

        return $html;
    }
921943
public function faq_as_h4( $data ) {
		if ( empty( $data['faq'] ) ) {
			return $data;
		}
		unset( $data['sections']['faq'] );
		$data['sections']['faq'] = '';
		foreach ( $data['faq'] as $question => $answer ) {
			$data['sections']['faq'] .= "<h4>{$question}</h4>\n{$answer}\n";
		}

		return $data;
	}
307407
public function setViewData(array $data): SectionInterface
    {
        $this->data = $data;

        // Add default variables to the section view.
        // We provide a copy of the section instance
        // so we can iterate over its items from the view.
        $this->data = array_merge($data, [
            '__section' => $this
        ]);

        return $this;
    }
1062281
protected function concat(string $section, string $key)
    {
        if ($section === '') {
            return $key;
        }
        if ($key === '') {
            return $section;
        }
        return $section . $this->sectionKeyDelimiter . $key;
    }
1226179
protected function _varExport($array, $section) {
		if (empty($array)) return '';

		$returner = "\n\t/* $section */\n";
		foreach ($array as $k => $v) {
			$key = str_replace("'", "\'", $k);
			$value = str_replace("'", "\'", $v);

			$returner .= str_pad("\t'$key'", 40, ' ');
			$returner .= '=> ';
			$returner .= "'$value',\n";
		}

		return $returner;
	}
454917
public static function fromArray(array $data)
    {
        $iniSections = IniParser::i()->parseArray($data);

        return self::fromIniSections($iniSections);
    }
1346621
public function validateSection($data, $section) {
    $pass = true;
    if (!empty($this->sectionValidation[$section])) {
      $modelValidation = $this->validate;
      $this->validate = $this->sectionValidation[$section];
      $this->set($data);
      if (!$this->validates()) {
        $pass = false;
      }
      $this->validate = $modelValidation;
    }
    return $pass;
  }
105273
protected function parseTexts(array $data)
    {
        foreach ($this->parseKeys as $key) {

            if (!isset($data[$key]) || !is_string($data[$key])) {
                continue;
            }

            $data[$key] = $this->textParser->parse($data[$key], $data);

        }

        return $data;
    }
1057448
protected function createSectionsFromArray(array $data)
    {
        $sections = array();
        foreach ($data as $sectionData) {
            $sections[] = $this->createSectionFromArray($sectionData);
        }

        return $sections;
    }
1087373
public static function fromArray(array $data)
    {
        return new static(
            $data['uri'],
            $data['title'],
            $data['date'],
            $data['type'],
            $data['content'],
            isset($data['template']) ? $data['template'] : null,
            isset($data['description']) ? $data['description'] : null,
            isset($data['seoTitle']) ? $data['seoTitle'] : null,
            isset($data['excerpt']) ? $data['excerpt'] : null,
            isset($data['isIndex']) ? $data['isIndex'] : false
        );
    }
426313
private function parseSection(array $section)
    {
        $config = [];

        foreach ($section as $key => $value) {
            $this->parseKey($key, $value, $config);
        }

        return $config;
    }
1214620
public static function format(array $data) {
        return array_map(function ($item) {
            $args = static::toArrOrNone($item);
            if (false !== $args) {
                return $args;
            }
            return $item;
        }, $data);
    }
1266753
public function section(string $section, array $default = []): array
    {
        if (isset($this->propertyData[$section])) {
            return $this->propertyData[$section];
        }

        return $default;
    }
178436
public function getWidgetsData(Section $section): array
    {
        switch ($this->config->widgetsStorageType) {
            
            case $this->config::STORAGE_TYPE_DB:
                $storage = new WidgetsDbStorage($this->db);
                break;
                
            case $this->config::STORAGE_TYPE_ARRAY:
                if (!empty($this->config->widgetsStoragePath) 
                && file_exists($this->config->projectPath . $this->config->widgetsStoragePath)) {
                    $storageData = require $this->config->projectPath . $this->config->widgetsStoragePath;
                } else {
                    $storageData = $this->config->widgetsStorageData;
                }
                $storage = new WidgetsArrayStorage($storageData);
                break;
                
            default:
                return [];
                
        }
        
        return $storage->getWidgets($section);
    }
257086
public static function getCategoryFromMultilingualSection(Section $section)
    {
        $sc = null;
        if ($section->isDefaultMultilingualSection()) {
            return static::getFromDefaultMultilingualSection();
        } else {
            // we find the stack category located at /paths/locale
            $text = Core::make('helper/text');
            $locale = $section->getLocale();
            $path = STACKS_PAGE_PATH . '/' . $locale;
            $page = \Page::getByPath($path);
            if (is_object($page) && !$page->isError()) {
                $sc = new self($page);
            }
        }

        return $sc;
    }