<commit_before><?php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Event\TestRunner;

use function array_merge;
use function asort;
use function extension_loaded;
use function get_loaded_extensions;
use ArrayIterator;
use IteratorAggregate;

final class Extensions implements IteratorAggregate
{
    public function loaded(string $name): bool
    {
        return extension_loaded($name);
    }

    public function getIterator()
    {
        $all = array_merge(
            get_loaded_extensions(true),
            get_loaded_extensions(false)
        );

        asort($all);

        return new ArrayIterator($all);
    }
}
<commit_msg>Enhancement: Add return type declaration and DocBlock<commit_after><?php declare(strict_types=1);
/*
 * This file is part of PHPUnit.
 *
 * (c) <NAME> <<EMAIL>>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
namespace PHPUnit\Event\TestRunner;

use function array_merge;
use function asort;
use function extension_loaded;
use function get_loaded_extensions;
use ArrayIterator;
use IteratorAggregate;

final class Extensions implements IteratorAggregate
{
    public function loaded(string $name): bool
    {
        return extension_loaded($name);
    }

    /**
     * @return ArrayIterator<int, string>
     */
    public function getIterator(): ArrayIterator
    {
        $all = array_merge(
            get_loaded_extensions(true),
            get_loaded_extensions(false)
        );

        asort($all);

        return new ArrayIterator($all);
    }
}

{'fraction_non_alphanumeric': 0.08871420550252666, 'fraction_numerical': 0.0011229646266142617, 'mean_word_length': 3.2836538461538463, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 10, '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': '3500784', 'n_tokens_mistral': 492, 'n_tokens_neox': 490, 'n_words': 152}