Docker-in-Docker (DinD) capabilities of public runners deactivated. More info

StringHydrator.php 369 Bytes
Newer Older
Olivier Lequeux's avatar
Olivier Lequeux committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<?php

namespace Lavoisier\Hydrators;

use \Lavoisier\IHydrator;

class StringHydrator implements IHydrator{

    public function hydrate($str) {

        $sxObject = new \SimpleXMLElement($str, 0, false, 'e', true);
        if ($sxObject === false) {
            throw new \Exception('Unable to parse XML');
        }
        return (strval($sxObject->entry));
    }
}