Find this useful? Enter your email to receive occasional updates for securing PHP code.

Signing you up...

Thank you for signing up!

PHP Decode

<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@..

Decoded Output download

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Translation\Tests\Formatter;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Translation\Formatter\MessageFormatter;

class MessageFormatterTest extends TestCase
{
    /**
     * @dataProvider getTransMessages
     */
    public function testFormat($expected, $message, $parameters = [])
    {
        $this->assertEquals($expected, $this->getMessageFormatter()->format($message, 'en', $parameters));
    }

    public static function getTransMessages()
    {
        return [
            [
                'There is one apple',
                'There is one apple',
            ],
            [
                'There are 5 apples',
                'There are %count% apples',
                ['%count%' => 5],
            ],
            [
                'There are 5 apples',
                'There are {{count}} apples',
                ['{{count}}' => 5],
            ],
        ];
    }

    private function getMessageFormatter()
    {
        return new MessageFormatter();
    }
}
 ?>

Did this file decode correctly?

Original Code

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <[email protected]>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Translation\Tests\Formatter;

use PHPUnit\Framework\TestCase;
use Symfony\Component\Translation\Formatter\MessageFormatter;

class MessageFormatterTest extends TestCase
{
    /**
     * @dataProvider getTransMessages
     */
    public function testFormat($expected, $message, $parameters = [])
    {
        $this->assertEquals($expected, $this->getMessageFormatter()->format($message, 'en', $parameters));
    }

    public static function getTransMessages()
    {
        return [
            [
                'There is one apple',
                'There is one apple',
            ],
            [
                'There are 5 apples',
                'There are %count% apples',
                ['%count%' => 5],
            ],
            [
                'There are 5 apples',
                'There are {{count}} apples',
                ['{{count}}' => 5],
            ],
        ];
    }

    private function getMessageFormatter()
    {
        return new MessageFormatter();
    }
}

Function Calls

None

Variables

None

Stats

MD5 a701125952af4358b2accfef25fcf748
Eval Count 0
Decode Time 88 ms