• 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

85.71
/src/Metadata/ResourceClassResolverInterface.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\Metadata\Exception\InvalidArgumentException;
17

18
if (interface_exists(\ApiPlatform\Api\ResourceClassResolverInterface::class)) {
4✔
19
    class_alias(
4✔
20
        \ApiPlatform\Api\ResourceClassResolverInterface::class,
4✔
21
        __NAMESPACE__.'\ResourceClassResolverInterface'
4✔
22
    );
4✔
23

24
    if (false) { // @phpstan-ignore-line
4✔
25
        interface ResourceClassResolverInterface extends \ApiPlatform\Api\ResourceClassResolverInterface
26
        {
27
        }
28
    }
29
} else {
30
    /**
31
     * Guesses which resource is associated with a given object.
32
     *
33
     * @author Kévin Dunglas <dunglas@gmail.com>
34
     */
35
    interface ResourceClassResolverInterface
36
    {
37
        /**
38
         * Guesses the associated resource.
39
         *
40
         * @param string $resourceClass The expected resource class
41
         * @param bool   $strict        If true, value must match the expected resource class
42
         *
43
         * @throws InvalidArgumentException
44
         */
45
        public function getResourceClass(mixed $value, ?string $resourceClass = null, bool $strict = false): string;
46

47
        /**
48
         * Is the given class a resource class?
49
         */
50
        public function isResourceClass(string $type): bool;
51
    }
52

53
    class_alias(ResourceClassResolverInterface::class, \ApiPlatform\Api\ResourceClassResolverInterface::class);
×
54
}
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