for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace Dgame\Soap\Hydrator;
use Dgame\Soap\Attribute\Attribute;
use Dgame\Soap\Element;
/**
* Class AttributeHydration
* @package Dgame\Soap\Hydrator
*/
final class AttributeHydration
{
* @var Hydrate
private $hydrate;
* AttributeHydration constructor.
*
* @param Hydrate $facade
public function __construct(Hydrate $facade)
$this->hydrate = $facade;
}
* @return Hydrate
public function getHydrate(): Hydrate
return $this->hydrate;
* @param Element $element
public function hydrate(Element $element)
$this->assignValue($element);
$this->assignAttributes($element);
private function assignValue(Element $element)
if ($element->hasValue()) {
$this->hydrate->assign('value', $element->getValue());
private function assignAttributes(Element $element)
foreach ($element->getAttributes() as $attribute) {
$this->assignAttribute($attribute);
* @param Attribute $attribute
private function assignAttribute(Attribute $attribute)
if ($attribute->hasValue()) {
$this->hydrate->assign($attribute->getName(), $attribute->getValue());