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

api-platform / core / 6665644319

27 Oct 2023 09:57AM UTC coverage: 37.409% (+0.1%) from 37.305%
6665644319

push

github

soyuka
Merge 3.2

125 of 125 new or added lines in 32 files covered. (100.0%)

10319 of 27584 relevant lines covered (37.41%)

20.57 hits per line

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

16.67
/src/Metadata/UriVariableTransformerInterface.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\Metadata;
15

16
use ApiPlatform\Exception\InvalidUriVariableException;
17

18
if (class_exists(\ApiPlatform\Api\UriVariableTransformerInterface::class)) {
3✔
19
    class_alias(
×
20
        \ApiPlatform\Api\UriVariableTransformerInterface::class,
×
21
        __NAMESPACE__.'\UriVariableTransformerInterface'
×
22
    );
×
23

24
    if (false) { // @phpstan-ignore-line
×
25
        interface UriVariableTransformerInterface extends \ApiPlatform\Api\UriVariableTransformerInterface
26
        {
27
        }
28
    }
29
} else {
30
    interface UriVariableTransformerInterface
31
    {
32
        /**
33
         * Transforms the value of a URI variable (identifier) to its type.
34
         *
35
         * @param mixed $value   The URI variable value to transform
36
         * @param array $types   The guessed type behind the URI variable
37
         * @param array $context Options available to the transformer
38
         *
39
         * @throws InvalidUriVariableException Occurs when the URI variable could not be transformed
40
         */
41
        public function transform(mixed $value, array $types, array $context = []);
42

43
        /**
44
         * Checks whether the value of a URI variable can be transformed to its type by this transformer.
45
         *
46
         * @param mixed $value   The URI variable value to transform
47
         * @param array $types   The types to which the URI variable value should be transformed
48
         * @param array $context Options available to the transformer
49
         */
50
        public function supportsTransformation(mixed $value, array $types, array $context = []): bool;
51
    }
52
}
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