1 | <?php |
||
23 | abstract class AbstractDefinition implements Definition |
||
24 | { |
||
25 | use Serializable; |
||
26 | |||
27 | /** |
||
28 | * @var Document |
||
29 | */ |
||
30 | protected $document; |
||
31 | |||
32 | /** |
||
33 | * @var int |
||
34 | */ |
||
35 | protected $offset; |
||
36 | |||
37 | /** |
||
38 | * AbstractDefinition constructor. |
||
39 | * @param Document $document |
||
40 | * @param int $offset |
||
41 | */ |
||
42 | public function __construct(Document $document, int $offset) |
||
47 | |||
48 | /** |
||
49 | * @return DocumentInterface |
||
50 | */ |
||
51 | public function getDocument(): DocumentInterface |
||
55 | |||
56 | /** |
||
57 | * @return int |
||
58 | */ |
||
59 | public function getLine(): int |
||
63 | |||
64 | /** |
||
65 | * @return Readable |
||
66 | */ |
||
67 | public function getFile(): Readable |
||
71 | |||
72 | /** |
||
73 | * @return int |
||
74 | */ |
||
75 | public function getColumn(): int |
||
79 | |||
80 | /** |
||
81 | * @param TypeInterface $type |
||
82 | * @return bool |
||
83 | */ |
||
84 | public function typeOf(TypeInterface $type): bool |
||
88 | |||
89 | /** |
||
90 | * @return string |
||
91 | */ |
||
92 | public function __toString(): string |
||
100 | |||
101 | /** |
||
102 | * @param string $type |
||
103 | * @return TypeDefinition |
||
104 | * @throws ExternalFileException |
||
105 | */ |
||
106 | protected function fetch(string $type): TypeDefinition |
||
110 | } |
||
111 |