| Total Complexity | 1 |
| Total Lines | 21 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | <?php declare(strict_types=1); |
||
| 25 | class TemplateEntityIsValidConstraint extends Constraint |
||
| 26 | { |
||
| 27 | public const VALUE_TYPE = 'TemplateEntity'; |
||
| 28 | |||
| 29 | public const MESSAGE = 'The value {{ string }} is not a valid ' . self::VALUE_TYPE; |
||
| 30 | |||
| 31 | public $message = self::MESSAGE; |
||
| 32 | |||
| 33 | |||
| 34 | /** |
||
| 35 | * Returns whether the constraint can be put onto classes, properties or |
||
| 36 | * both. |
||
| 37 | * |
||
| 38 | * This method should return one or more of the constants |
||
| 39 | * self::CLASS_CONSTRAINT and self::PROPERTY_CONSTRAINT. |
||
| 40 | * |
||
| 41 | * @return string|array One or more constant values |
||
| 42 | */ |
||
| 43 | public function getTargets(): string |
||
| 46 | } |
||
| 47 | } |
For hinted functions/methods where all return statements with the correct type are only reachable via conditions, ?null? gets implicitly returned which may be incompatible with the hinted type. Let?s take a look at an example: