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

api-platform / core / 10869372816

15 Sep 2024 08:07AM UTC coverage: 63.36% (-0.08%) from 63.437%
10869372816

push

github

soyuka
test: doctrine auto mapping controller is deprecated

11176 of 17639 relevant lines covered (63.36%)

53.4 hits per line

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

0.0
/src/Api/QueryParameterValidator/Validator/MultipleOf.php
1
<?php
2

3
/*
4
 * This file is part of the API Platform project.
5
 *
6
 * (c) Kévin Dunglas <dunglas@gmail.com>
7
 *
8
 * For the full copyright and license information, please view the LICENSE
9
 * file that was distributed with this source code.
10
 */
11

12
declare(strict_types=1);
13

14
namespace ApiPlatform\Api\QueryParameterValidator\Validator;
15

16
use ApiPlatform\ParameterValidator\Validator\CheckFilterDeprecationsTrait;
17
use ApiPlatform\ParameterValidator\Validator\ValidatorInterface;
18

19
/**
20
 * @deprecated use \ApiPlatform\ParameterValidator\Validator\MultipleOf instead
21
 */
22
final class MultipleOf implements ValidatorInterface
23
{
24
    use CheckFilterDeprecationsTrait;
25

26
    /**
27
     * {@inheritdoc}
28
     */
29
    public function validate(string $name, array $filterDescription, array $queryParameters): array
30
    {
31
        $value = $queryParameters[$name] ?? null;
×
32
        if (empty($value) && '0' !== $value || !\is_string($value)) {
×
33
            return [];
×
34
        }
35

36
        $this->checkFilterDeprecations($filterDescription);
×
37

38
        $multipleOf = $filterDescription['openapi']['multipleOf'] ?? $filterDescription['swagger']['multipleOf'] ?? null;
×
39

40
        if (null !== $multipleOf && 0 !== ($value % $multipleOf)) {
×
41
            return [
×
42
                \sprintf('Query parameter "%s" must multiple of %s', $name, $multipleOf),
×
43
            ];
×
44
        }
45

46
        return [];
×
47
    }
48
}
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