<commit_before><?php

namespace PharBuilder;

class LibBuilder extends ABuilder
{
    protected function generateStubContent()
    {
        return '<?php
$l = new SplClassLoader("' . $this->name . '", "phar://" . __DIR__ . "/' . $this->file . '.phar");
$l->register();
__HALT_COMPILER();';
    }

    public function addFile($_srcPath, $_destPath)
    {<commit_msg>LibBuilder - add property $cliStub and $useSplClassLoader for control stub generation<commit_after><?php

namespace PharBuilder;

class LibBuilder extends ABuilder
{
    public $cliStub = null;
    public $useSplClassLoader = false;

    protected function generateStubContent()
    {
        $code = '<?php
';

        if ($this->cliStub) {
            $code .= 'if (php_sapi_name() === "cli" && $argv[0] === basename(__FILE__)) {
    ' . $this->cliStub . '
    return;
}
';
        }


        if ($this->useSplClassLoader) {
            $code .= '
$l = new SplClassLoader("' . $this->name . '", "phar://' . $this->alias . '");
$l->register();
';
        }

        $code .= '__HALT_COMPILER();';

        return $code;
    }

    public function addFile($_srcPath, $_destPath)
    {
{'fraction_non_alphanumeric': 0.17028670721112077, 'fraction_numerical': 0.0008688097306689834, 'mean_word_length': 2.657142857142857, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 12, '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': '7537224', 'n_tokens_mistral': 383, 'n_tokens_neox': 377, 'n_words': 81}