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

mlocati / nexi / 8551303918

04 Apr 2024 08:05AM UTC coverage: 2.295% (+2.3%) from 0.0%
8551303918

push

github

mlocati
Improve JSON generation, add ways to enable insecure HTTPS connections

12 of 89 new or added lines in 7 files covered. (13.48%)

2 existing lines in 2 files now uncovered.

39 of 1699 relevant lines covered (2.3%)

0.02 hits per line

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

0.0
/src/Service/QueryEntityTrait.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace MLocati\Nexi\Service;
6

7
use MLocati\Nexi\Exception;
8

9
trait QueryEntityTrait
10
{
11
    /**
12
     * {@inheritdoc}
13
     *
14
     * @see \MLocati\Nexi\Service\QueryEntityInterface
15
     */
16
    public function getQuerystring(): string
17
    {
NEW
18
        $data = (array) $this->_getRawData();
×
NEW
19
        $params = array_map(
×
20
            static function ($value) {
NEW
21
                $type = gettype($this);
×
NEW
22
                switch ($type) {
×
NEW
23
                    case 'boolean':
×
NEW
24
                        return $value ? '1' : '0';
×
NEW
25
                    case 'integer':
×
NEW
26
                    case 'double':
×
NEW
27
                    case 'string':
×
NEW
28
                        return $value;
×
29
                }
NEW
30
                throw new Exception\WrongFieldType('querystring', 'scalar', $value);
×
NEW
31
            },
×
32
            $data
33
        );
34

NEW
35
        return http_build_query($params, '', '&', PHP_QUERY_RFC3986);
×
36
    }
37
}
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

© 2025 Coveralls, Inc