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

api-platform / core / 14304969316

07 Apr 2025 08:53AM UTC coverage: 7.281% (-1.2%) from 8.52%
14304969316

push

github

soyuka
Merge 4.1

13 of 244 new or added lines in 12 files covered. (5.33%)

222 existing lines in 2 files now uncovered.

10878 of 149412 relevant lines covered (7.28%)

6.5 hits per line

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

0.0
/tests/Fixtures/TestBundle/Entity/SecuredDummyCollection.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\Tests\Fixtures\TestBundle\Entity;
15

16
use ApiPlatform\Metadata\ApiProperty;
17
use ApiPlatform\Metadata\ApiResource;
18
use ApiPlatform\Metadata\GraphQl\Query;
19
use ApiPlatform\Metadata\GraphQl\QueryCollection;
20
use ApiPlatform\Metadata\NotExposed;
21
use Doctrine\ORM\Mapping as ORM;
22

23
/**
24
 * Secured resource.
25
 */
26
#[ApiResource(
NEW
27
    operations: [
×
NEW
28
        new NotExposed(),
×
NEW
29
    ],
×
NEW
30
    graphQlOperations: [
×
NEW
31
        new Query(),
×
NEW
32
        new QueryCollection(),
×
NEW
33
    ],
×
NEW
34
    security: 'is_granted(\'ROLE_USER\')'
×
NEW
35
)]
×
36
#[ORM\Entity]
37
class SecuredDummyCollection
38
{
39
    #[ORM\Column(type: 'integer')]
40
    #[ORM\Id]
41
    #[ORM\GeneratedValue(strategy: 'AUTO')]
42
    public ?int $id = null;
43

44
    /**
45
     * @var string The title
46
     */
47
    #[ORM\Column]
48
    public string $title;
49

50
    /**
51
     * @var string Secret property, only readable/writable by owners
52
     */
53
    #[ApiProperty(security: 'object == null or object.owner == user', securityPostDenormalize: 'object.owner == user')]
54
    #[ORM\Column]
55
    public ?string $ownerOnlyProperty = null;
56

57
    /**
58
     * @var string The owner
59
     */
60
    #[ORM\Column]
61
    public string $owner;
62
}
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