e61268ba1d1ebd2168b34f7bd7dcdaa7daa92f33
[GitHub/WoltLab/WCF.git] /
1 <?php
2
3 declare(strict_types=1);
4
5 namespace CuyZ\Valinor\Type\Parser\Exception\Generic;
6
7 use CuyZ\Valinor\Type\Parser\Exception\InvalidType;
8 use CuyZ\Valinor\Type\Type;
9 use ReflectionClass;
10 use RuntimeException;
11
12 /** @internal */
13 final class InvalidExtendTagClassName extends RuntimeException implements InvalidType
14 {
15 /**
16 * @param ReflectionClass<object> $reflection
17 */
18 public function __construct(ReflectionClass $reflection, Type $invalidExtendTag)
19 {
20 /** @var ReflectionClass<object> $parentClass */
21 $parentClass = $reflection->getParentClass();
22
23 parent::__construct(
24 "The `@extends` tag of the class `$reflection->name` has invalid class `{$invalidExtendTag->toString()}`, it should be `$parentClass->name`.",
25 1670183564
26 );
27 }
28 }