<commit_before><?php

namespace Phantestic;

trait TestAssertions
{
    public function assertInstanceOf($expected, $actual, $message = '')
    {
        if (!$actual instanceof $expected) {
            if (empty($message)) {
                $message = 'Object '
                    . var_export($actual, true)
                    . ' is not an instance of class '
                    . $expected;
            }
            throw new \DomainException($message);
        }
    }

    public function assertSame($expected, $actual, $message = '')
    {
        if ($expected !== $actual) {
            if (empty($message)) {
                $message = var_export($expected, true)
                    . ' is not identical to '
                    . var_export($actual, true);
            }
            throw new \DomainException($message);
        }
    }

    public function assertRegExp($pattern, $string, $message)
    {
        if (preg_match($pattern, $string) === 0) {
            if (empty($message)) {
                $message = 'String '
                    . var_export($string, true)
                    . ' does not match pattern '
                    . var_export($pattern, true);
            }
            throw new \DomainException($message);
        }
    }
}
<commit_msg>Modified TestAssertion methods to match signatures of corresponding PHPUnit methods<commit_after><?php

namespace Phantestic;

trait TestAssertions
{
    public function assertInstanceOf($expected, $actual, $message = '')
    {
        if (!$actual instanceof $expected) {
            if (empty($message)) {
                $message = 'Object '
                    . var_export($actual, true)
                    . ' is not an instance of class '
                    . $expected;
            }
            throw new \DomainException($message);
        }
    }

    public function assertSame($expected, $actual, $message = '')
    {
        if ($expected !== $actual) {
            if (empty($message)) {
                $message = var_export($expected, true)
                    . ' is not identical to '
                    . var_export($actual, true);
            }
            throw new \DomainException($message);
        }
    }

    public function assertRegExp($pattern, $string, $message = '')
    {
        if (preg_match($pattern, $string) === 0) {
            if (empty($message)) {
                $message = 'String '
                    . var_export($string, true)
                    . ' does not match pattern '
                    . var_export($pattern, true);
            }
            throw new \DomainException($message);
        }
    }
}

{'fraction_non_alphanumeric': 0.11673592746505478, 'fraction_numerical': 0.0007555723460521345, 'mean_word_length': 1.4428044280442804, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 3, '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': '2935537', 'n_tokens_mistral': 673, 'n_tokens_neox': 649, 'n_words': 161}