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

api-platform / core / 10629909787

30 Aug 2024 09:03AM UTC coverage: 63.988% (-0.2%) from 64.198%
10629909787

push

github

web-flow
refactor(metadata): provide a trait in addition to the attribute (#6558)

Co-authored-by: Kévin Dunglas <kevin@dunglas.fr>

- provides an IsApiResource trait that can be used in place of the #[ApiResource] attribute
- enables #[ApiProperty(property: 'foo')] on a class

96 of 160 new or added lines in 11 files covered. (60.0%)

11539 of 18033 relevant lines covered (63.99%)

68.36 hits per line

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

0.0
/src/Metadata/IsApiResource.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
/**
17
 * @author Kévin Dunglas <kevin@dunglas.dev>
18
 */
19
trait IsApiResource
20
{
21
    public static function apiResource(): ApiResource
22
    {
NEW
23
        return new ApiResource();
×
24
    }
25
}
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