<commit_before><?php
/**
 * This file is part of Railt package.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
declare(strict_types=1);

namespace Railt\Tests\SDL\Language\Arguments;

use Railt\Io\File;
use Railt\Tests\SDL\Helpers\CompilerStubs;

/**
 * Trait CoercionStubs
 */
trait ArgumentDefaultsStubs
{
    use CompilerStubs;

    /**
     * @param iterable $arguments
     * @param string $pattern
     * @return \Traversable
     * @throws \Exception
     */
    protected function scalarArgumentsDataProvider(iterable $arguments, string $pattern): \Traversable
    {
        foreach ($arguments as $argument) {
            $sources = File::fromSources(\sprintf($pattern, $argument));

            foreach ($this->getCompilers() as $compiler) {
                yield $sources => $compiler;
            }
        }
    }

    /**
     * @return iterable
     */
    private function getScalarDefaults(): iterable
    {
        yield 'String'   => '"String"';
        yield 'String'   => '"""' . "\n" . 'Multiline String' . "\n" . '"""';

        yield 'DateTime' => '"2018-01-15 08:23:03"';
        yield 'DateTime' => '"08:23:03"';
        yield 'DateTime' => '"2018-01-15"';
        yield 'DateTime' => '"2002-10-02T10:00:00-05:00"';
        yield 'DateTime' => '"2002-10-02T15:00:00.05Z"';

        yield 'Float'    => '0.23';
        yield 'Float'    => '.42';
        yield 'Float'    => '-.023';

        yield 'Int'      => '-23';<commit_msg>Add floats leading zero<commit_after><?php
/**
 * This file is part of Railt package.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
declare(strict_types=1);

namespace Railt\Tests\SDL\Language\Arguments;

use Railt\Io\File;
use Railt\Tests\SDL\Helpers\CompilerStubs;

/**
 * Trait CoercionStubs
 */
trait ArgumentDefaultsStubs
{
    use CompilerStubs;

    /**
     * @param iterable $arguments
     * @param string $pattern
     * @return \Traversable
     * @throws \Exception
     */
    protected function scalarArgumentsDataProvider(iterable $arguments, string $pattern): \Traversable
    {
        foreach ($arguments as $argument) {
            $sources = File::fromSources(\sprintf($pattern, $argument));

            foreach ($this->getCompilers() as $compiler) {
                yield $sources => $compiler;
            }
        }
    }

    /**
     * @return iterable
     */
    private function getScalarDefaults(): iterable
    {
        yield 'String'   => '"String"';
        yield 'String'   => '"""' . "\n" . 'Multiline String' . "\n" . '"""';

        yield 'DateTime' => '"2018-01-15 08:23:03"';
        yield 'DateTime' => '"08:23:03"';
        yield 'DateTime' => '"2018-01-15"';
        yield 'DateTime' => '"2002-10-02T10:00:00-05:00"';
        yield 'DateTime' => '"2002-10-02T15:00:00.05Z"';

        yield 'Float'    => '0.23';
        yield 'Float'    => '-0.23';

        yield 'Int'      => '-23';
{'fraction_non_alphanumeric': 0.15822164105916967, 'fraction_numerical': 0.04707420725727362, 'mean_word_length': 2.3626373626373627, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 28, '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': '1213293', 'n_tokens_mistral': 1033, 'n_tokens_neox': 933, 'n_words': 227}