• 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

0.0
/src/ParameterValidator/Exception/ValidationException.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\ParameterValidator\Exception;
15

16
use ApiPlatform\Metadata\Exception\ProblemExceptionInterface;
17

18
/**
19
 * Filter validation exception.
20
 *
21
 * @author Julien DENIAU <julien.deniau@gmail.com>
22
 */
23
final class ValidationException extends \Exception implements ValidationExceptionInterface, ProblemExceptionInterface
24
{
25
    /**
26
     * @param string[] $constraintViolationList
27
     */
28
    public function __construct(private readonly array $constraintViolationList, string $message = '', int $code = 0, ?\Exception $previous = null)
29
    {
30
        parent::__construct($message ?: $this->__toString(), $code, $previous);
×
31
    }
32

33
    public function getConstraintViolationList(): array
34
    {
35
        return $this->constraintViolationList;
×
36
    }
37

38
    public function __toString(): string
39
    {
40
        return implode("\n", $this->constraintViolationList);
×
41
    }
42

43
    public function getType(): string
44
    {
45
        return '/parameter_validation/'.$this->code;
×
46
    }
47

48
    public function getTitle(): ?string
49
    {
50
        return $this->message ?: $this->__toString();
×
51
    }
52

53
    public function getStatus(): ?int
54
    {
55
        return 400;
×
56
    }
57

58
    public function getDetail(): ?string
59
    {
60
        return $this->message ?: $this->__toString();
×
61
    }
62

63
    public function getInstance(): ?string
64
    {
65
        return null;
×
66
    }
67
}
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