• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mlocati / PayWay / 5213927880

pending completion
5213927880

push

github

mlocati
Initial version

1803 of 1803 new or added lines in 47 files covered. (100.0%)

1313 of 1803 relevant lines covered (72.82%)

1.53 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

76.47
/src/Init/Response/Unserializer.php
1
<?php
2

3
namespace MLocati\PayWay\Init\Response;
4

5
use MLocati\PayWay\Init\Response;
6
use MLocati\PayWay\Service\UnserializerTrait;
7

8
class Unserializer
9
{
10
    use UnserializerTrait;
11

12
    const NS_SOAPENVELOPE = 'http://schemas.xmlsoap.org/soap/envelope/';
13

14
    const NS_IGFS = 'http://services.api.web.cg.igfs.apps.netsw.it/';
15

16
    /**
17
     * @param string $raw
18
     *
19
     * @throws \MLocati\PayWay\Exception\InvalidXml
20
     */
21
    public function unserialize($raw)
22
    {
23
        $xResponse = $this->loadDocument($raw, '/soap:Envelope/soap:Body/igfs:InitResponse/response');
5✔
24
        $response = new Response();
2✔
25
        foreach ($this->listDOMElements($xResponse) as $child) {
2✔
26
            $tagName = $child->tagName;
2✔
27
            $setter = 'set' . ucfirst($tagName);
2✔
28
            $value = (string) $child->nodeValue;
2✔
29
            switch ($tagName) {
30
                case 'reqTime':
2✔
31
                    $value = $this->unserializeDateTime($value);
×
32
                    break;
×
33
                case 'error':
2✔
34
                    $value = $this->unserializeBoolean($value);
2✔
35
                    break;
2✔
36
            }
37
            if (!method_exists($response, $setter)) {
2✔
38
                $response->addUnrecognizedXmlElement($child);
×
39
                continue;
×
40
            }
41
            $response->{$setter}($value);
2✔
42
        }
43

44
        return $response;
2✔
45
    }
46
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc