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

api-platform / core / 9710836697

28 Jun 2024 09:35AM UTC coverage: 63.285% (+1.2%) from 62.122%
9710836697

push

github

soyuka
docs: changelog v3.3.7

11104 of 17546 relevant lines covered (63.29%)

52.26 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)) {
4✔
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