Nelmio\SecurityBundle\Signer::getSignedValue PHP Method

getSignedValue() public method

public getSignedValue ( $value, $signature = null )
    public function getSignedValue($value, $signature = null)
    {
        if (null === $signature) {
            $signature = $this->generateSignature($value);
        }
        return $value . '.' . $signature;
    }

Usage Example

 public function testSignatureShouldDependOnSecret()
 {
     $signer1 = new Signer('secret1', 'sha1');
     $signer2 = new Signer('secret2', 'sha1');
     $this->assertNotSame($signer1->getSignedValue('foobar'), $signer2->getSignedValue('foobar'));
 }