<commit_before><?php
namespace Concrete\DocumentationGenerator\Generator\Asset;

use Concrete\DocumentationGenerator\Config\CommentRepositoryFactory;
use Concrete\DocumentationGenerator\Generator\AbstractGenerator;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class AssetListGenerator extends AbstractGenerator
{

    public function getHandle()
    {
        return "asset_list";
    }

    public function generate(InputInterface $input, OutputInterface $output)
    {
        $file_loader = \Config::getLoader();
        $app_config = $file_loader->load('', 'app', 'core');

        /** @type CommentRepositoryFactory $comment_repository_factory */
        $comment_repository_factory = \Core::make('documentation_generator/comment_repository_factory');
        $comment_repository = $comment_repository_factory->makeCommentRepository(DIR_BASE_CORE . "/config/app.php");

        $asset_groups = array_get($app_config, 'asset_groups', array());

        $markdown = array("# Asset Groups", "");
        foreach ($asset_groups as $handle => $asset_group) {
            $block = $comment_repository->getDocblock("app.asset_groups.{$handle}");
            $description = $block ? $block->getShortDescription() : '';
            $output->writeln("Generating {$handle}");
            $markdown[] = "* `{$handle}`" . ($description ? ": {$description}" : "");
        }

        $markdown[] = "";
        $markdown[] = "# Individual Assets";
        $markdown[] = "";

        $assets = array_get($app_config, 'assets', array());
        foreach (array_keys($assets) as $handle) {
            $block = $comment_repository->getDocblock("app.assets.{$handle}");
            $description = $block ? $block->getShortDescription() : '';
            $output->writeln("Generating {$handle}");
            $markdown[] = "* `{$handle}`" . ($description ? ": {$description}" : "");
        }

        $markdown_string = implode("\n", $markdown);

        $output->writeln($markdown_string);
    }

}
<commit_msg>Further improve code quality, remove debug output<commit_after><?php
namespace Concrete\DocumentationGenerator\Generator\Asset;

use Concrete\DocumentationGenerator\Config\CommentRepository;
use Concrete\DocumentationGenerator\Config\CommentRepositoryFactory;
use Concrete\DocumentationGenerator\Generator\AbstractGenerator;
use Symfony\Component\Console\Input\InputDefinition;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

class AssetListGenerator extends AbstractGenerator
{

    public function getHandle()
    {
        return "asset_list";
    }

    public function generate(InputInterface $input, OutputInterface $output)
    {
        $file_loader = \Config::getLoader();
        $app_config = $file_loader->load('', 'app', 'core');

        /** @type CommentRepositoryFactory $comment_repository_factory */
        $comment_repository_factory = \Core::make('documentation_generator/comment_repository_factory');
        $comment_repository = $comment_repository_factory->makeCommentRepository(DIR_BASE_CORE . "/config/app.php");

        $asset_groups = array_get($app_config, 'asset_groups', array());

        $markdown = array("# Asset Groups", "");
        $markdown = array_merge($markdown, $this->getMarkdown(
            array_keys($asset_groups),
            'app.asset_groups',
            $comment_repository));

        $markdown[] = "";
        $markdown[] = "# Individual Assets";
        $markdown[] = "";

        $assets = array_get($app_config, 'assets', array());
        $markdown = array_merge($markdown, $this->getMarkdown(array_keys($assets), 'app.assets', $comment_repository));

        $markdown_string = implode("\n", $markdown);

        $output->writeln($markdown_string);
    }

    protected function getMarkdown($list, $item, CommentRepository $repository)
    {
        $markdown = array();
        foreach ($list as $handle) {
            $block = $repository->getDocblock("{$item}.{$handle}");
            $description = $block ? $block->getShortDescription() : '';
            $markdown[] = "* `{$handle}`" . ($description ? ": {$description}" : "");
        }

        return $markdown;
    }
}

{'fraction_non_alphanumeric': 0.14626796476587853, 'fraction_numerical': 0.0, 'mean_word_length': 3.5709745762711864, 'pattern_counts': {'":': 3, '<': 5, '<?xml version=': 0, '>': 20, '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': '1072903', 'n_tokens_mistral': 1168, 'n_tokens_neox': 1122, 'n_words': 199}