<commit_before><?php

namespace Firebase\Auth\Token\Tests;

use Lcobucci\JWT\Signature;
use Lcobucci\JWT\Signer;

class TestCase extends \PHPUnit\Framework\TestCase
{
    /**
     * @return Signer|\PHPUnit_Framework_MockObject_MockObject
     */
    public function createMockSigner()
    {
        $signer = $this->createMock(Signer::class);

        $signer->method('getAlgorithmId')
            ->willReturn('mock');

        $signer->method('modifyHeader')
            ->willReturnCallback(function (&$headers) {
                $headers['alg'] = 'mock';
            });

        $signer->method('sign')
            ->willReturnCallback(function ($payload, $key) {
                return new Signature($payload.$key);
            });

        $signer->method('verify')
            ->willReturnCallback(function ($expected, $payload, $key) {
                return $expected === $payload.$key;<commit_msg>Ensure the given key value is of type Key<commit_after><?php

namespace Firebase\Auth\Token\Tests;

use Lcobucci\JWT\Signature;
use Lcobucci\JWT\Signer;

class TestCase extends \PHPUnit\Framework\TestCase
{
    /**
     * @return Signer|\PHPUnit_Framework_MockObject_MockObject
     */
    public function createMockSigner()
    {
        $signer = $this->createMock(Signer::class);

        $signer->method('getAlgorithmId')
            ->willReturn('mock');

        $signer->method('modifyHeader')
            ->willReturnCallback(function (&$headers) {
                $headers['alg'] = 'mock';
            });

        $signer->method('sign')
            ->willReturnCallback(function ($payload, $key) {
                $key = is_string($key) ? new Signer\Key($key) : $key;

                return new Signature($payload.$key->getContent());
            });

        $signer->method('verify')
            ->willReturnCallback(function ($expected, $payload, $key) {
                $key = is_string($key) ? new Signer\Key($key) : $key;

                return $expected === $payload.$key->getContent();
{'fraction_non_alphanumeric': 0.14895729890764647, 'fraction_numerical': 0.0, 'mean_word_length': 2.397976391231029, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 23, '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': '873947', 'n_tokens_mistral': 590, 'n_tokens_neox': 567, 'n_words': 97}