Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
3 / 3 |
CRAP | |
100.00% |
7 / 7 |
ShippingMethodCollectionTrait | |
100.00% |
1 / 1 |
|
100.00% |
3 / 3 |
3 | |
100.00% |
7 / 7 |
getShippingMethodCollection() | |
100.00% |
1 / 1 |
1 | |
100.00% |
1 / 1 |
|||
setShippingMethodCollection( ShippingMethodCollectionInterface $shippingMethodCollection ) | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
|||
setShippingMethodCollectionFromDeserialization( array $shippingMethods ) | |
100.00% |
1 / 1 |
1 | |
100.00% |
4 / 4 |
<?php | |
/** | |
* @author Krzysztof Gzocha <krzysztof.gzocha@xsolve.pl> | |
*/ | |
namespace Team3\PayU\Order\Model\Traits; | |
use Team3\PayU\Order\Model\ShippingMethods\ShippingMethodCollection; | |
use Team3\PayU\Order\Model\ShippingMethods\ShippingMethodCollectionInterface; | |
trait ShippingMethodCollectionTrait | |
{ | |
/** | |
* @var ShippingMethodCollectionInterface | |
* @JMS\Type("array<Team3\PayU\Order\Model\ShippingMethods\ShippingMethod>") | |
* @JMS\SerializedName("shippingMethods") | |
* @JMS\Accessor( | |
* getter="getShippingMethodCollection", | |
* setter="setShippingMethodCollectionFromDeserialization" | |
* ) | |
* @JMS\Groups({"shippingMethods"}) | |
*/ | |
protected $shippingCollection; | |
/** | |
* @return ShippingMethodCollectionInterface | |
*/ | |
public function getShippingMethodCollection() | |
{ | |
return $this->shippingCollection; | |
} | |
/** | |
* @param ShippingMethodCollectionInterface $shippingMethodCollection | |
* | |
* @return $this | |
*/ | |
public function setShippingMethodCollection( | |
ShippingMethodCollectionInterface $shippingMethodCollection | |
) { | |
$this->shippingCollection = $shippingMethodCollection; | |
return $this; | |
} | |
/** | |
* @param array $shippingMethods | |
* | |
* @return $this | |
*/ | |
public function setShippingMethodCollectionFromDeserialization( | |
array $shippingMethods | |
) { | |
$this->setShippingMethodCollection( | |
new ShippingMethodCollection($shippingMethods) | |
); | |
return $this; | |
} | |
} |