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

mlocati / nexi / 8567127617

05 Apr 2024 08:25AM UTC coverage: 4.204%. Remained the same
8567127617

push

github

mlocati
Fix building querystring

0 of 1 new or added line in 1 file covered. (0.0%)

79 of 1879 relevant lines covered (4.2%)

0.05 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
    {
18
        $data = (array) $this->_getRawData();
×
19
        $params = array_map(
×
20
            static function ($value) {
NEW
21
                $type = gettype($value);
×
22
                switch ($type) {
×
23
                    case 'boolean':
×
24
                        return $value ? '1' : '0';
×
25
                    case 'integer':
×
26
                    case 'double':
×
27
                    case 'string':
×
28
                        return $value;
×
29
                }
30
                throw new Exception\WrongFieldType('querystring', 'scalar', $value);
×
31
            },
×
32
            $data
33
        );
34

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