Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
CRAP | |
100.00% |
2 / 2 |
Md5Strategy | |
100.00% |
1 / 1 |
|
100.00% |
2 / 2 |
2 | |
100.00% |
2 / 2 |
supports(AlgorithmInterface $algorithm) | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
encode($data) | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
<?php | |
/** | |
* @author Krzysztof Gzocha <krzysztof.gzocha@xsolve.pl> | |
*/ | |
namespace Team3\PayU\SignatureCalculator\Encoder\Strategy; | |
use Team3\PayU\SignatureCalculator\Encoder\Algorithms\AlgorithmInterface; | |
use Team3\PayU\SignatureCalculator\Encoder\Algorithms\Md5Algorithm; | |
class Md5Strategy implements EncoderStrategyInterface | |
{ | |
/** | |
* @param AlgorithmInterface $algorithm | |
* | |
* @return bool | |
*/ | |
public function supports(AlgorithmInterface $algorithm) | |
{ | |
return $algorithm instanceof Md5Algorithm; | |
} | |
/** | |
* @param string $data | |
* | |
* @return string | |
*/ | |
public function encode($data) | |
{ | |
return md5($data); | |
} | |
} |