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

mlocati / PayWay / 5272005549

pending completion
5272005549

Pull #4

github

web-flow
Merge d20a1048f into ada68d889
Pull Request #4: Multiple fixes

51 of 51 new or added lines in 8 files covered. (100.0%)

1603 of 2134 relevant lines covered (75.12%)

1.54 hits per line

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

73.68
/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
                    if ($value === null) {
2✔
36
                        $value = true;
×
37
                    }
38
                    break;
2✔
39
            }
40
            if (!method_exists($response, $setter)) {
2✔
41
                $response->addUnrecognizedXmlElement($child);
×
42
                continue;
×
43
            }
44
            $response->{$setter}($value);
2✔
45
        }
46

47
        return $response;
2✔
48
    }
49
}
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