• 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

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)) {
3✔
19
    class_alias(
3✔
20
        \ApiPlatform\Api\ResourceClassResolverInterface::class,
3✔
21
        __NAMESPACE__.'\ResourceClassResolverInterface'
3✔
22
    );
3✔
23

24
    if (false) { // @phpstan-ignore-line
3✔
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