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

api-platform / core / 10315659289

09 Aug 2024 07:49AM UTC coverage: 7.841% (-0.006%) from 7.847%
10315659289

push

github

soyuka
style: cs fixes

70 of 529 new or added lines in 176 files covered. (13.23%)

160 existing lines in 58 files now uncovered.

12688 of 161818 relevant lines covered (7.84%)

26.86 hits per line

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

0.0
/tests/Fixtures/TestBundle/Entity/Product.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\Tests\Fixtures\TestBundle\Model\ProductInterface;
17
use ApiPlatform\Tests\Fixtures\TestBundle\Model\TaxonInterface;
18
use Doctrine\ORM\Mapping as ORM;
19

20
#[ORM\Entity]
21
class Product implements ProductInterface
22
{
23
    #[ORM\Column(type: 'integer')]
24
    #[ORM\Id]
25
    #[ORM\GeneratedValue(strategy: 'AUTO')]
26
    private ?int $id = null;
27
    #[ORM\Column(type: 'string', unique: true)]
28
    private string $code;
29
    #[ORM\ManyToOne(targetEntity: Taxon::class)]
30
    private ?Taxon $mainTaxon = null;
31

32
    /**
33
     * {@inheritdoc}
34
     */
35
    public function getId(): ?int
36
    {
37
        return $this->id;
×
38
    }
39

40
    /**
41
     * {@inheritdoc}
42
     */
43
    public function getCode(): ?string
44
    {
45
        return $this->code;
×
46
    }
47

48
    /**
49
     * {@inheritdoc}
50
     */
51
    public function setCode(?string $code): void
52
    {
53
        $this->code = $code;
×
54
    }
55

56
    /**
57
     * {@inheritdoc}
58
     */
59
    public function getMainTaxon(): ?TaxonInterface
60
    {
61
        return $this->mainTaxon;
×
62
    }
63

64
    /**
65
     * {@inheritdoc}
66
     */
67
    public function setMainTaxon(?TaxonInterface $mainTaxon): void
68
    {
69
        if (!$mainTaxon instanceof Taxon) {
×
NEW
70
            throw new \InvalidArgumentException(\sprintf('$mainTaxon must be of type "%s".', Taxon::class));
×
71
        }
72

73
        $this->mainTaxon = $mainTaxon;
×
74
    }
75
}
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