<commit_before><?php

use yii\apidoc\models\MethodDoc;

/* @var $method MethodDoc */
/* @var $highlighter \Highlight\Highlighter */

$sourceCode = $method->sourceCode;
?>

<?php if ($sourceCode) {
    $collapseId = 'collapse' . ucfirst($method->name); ?>

    <p>
        <a class="btn btn-link" data-toggle="collapse" href="#<?= $collapseId ?>" role="button" aria-expanded="false"
           aria-controls="<?= $collapseId ?>">
            Source code
        </a>
    </p>
    <div class="collapse" id="<?= $collapseId ?>">
        <div class="card card-body">
            <pre>
                <code class="hljs php language-php"><?= $highlighter->highlight('php', $sourceCode)->value ?></code>
            </pre>
        </div>
    </div>
<?php } ?><commit_msg>Fix #147: Prevent scroll when opening a method's source code (#272)<commit_after><?php

use yii\apidoc\models\MethodDoc;

/* @var $method MethodDoc */
/* @var $highlighter \Highlight\Highlighter */

$sourceCode = $method->sourceCode;
?>

<?php if ($sourceCode) {
    $collapseId = 'collapse' . ucfirst($method->name); ?>

    <p>
        <a class="btn btn-link" data-toggle="collapse" data-target="#<?= $collapseId ?>" role="button"
           aria-expanded="false" aria-controls="<?= $collapseId ?>">
            Source code
        </a>
    </p>
    <div class="collapse" id="<?= $collapseId ?>">
        <div class="card card-body">
            <pre>
                <code class="hljs php language-php"><?= $highlighter->highlight('php', $sourceCode)->value ?></code>
            </pre>
        </div>
    </div>
<?php } ?>
{'fraction_non_alphanumeric': 0.20050282840980516, 'fraction_numerical': 0.003771213073538655, 'mean_word_length': 2.6682027649769586, 'pattern_counts': {'":': 0, '<': 41, '<?xml version=': 0, '>': 49, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7379757', 'n_tokens_mistral': 521, 'n_tokens_neox': 506, 'n_words': 112}