1 | <?php |
||
5 | abstract class AbstractAdapter implements AdapterInterface |
||
6 | { |
||
7 | |||
8 | protected $file; |
||
9 | |||
10 | 24 | public function __construct( |
|
11 | $file |
||
12 | ) |
||
13 | { |
||
14 | 24 | $this->file = realpath($file); |
|
15 | 24 | if ($this->file === false) { |
|
16 | 3 | throw new InvalidFileException('Unable to find file: ' . $file); |
|
17 | } |
||
18 | 21 | } |
|
19 | |||
20 | /* |
||
21 | * @return string The location of the file |
||
22 | */ |
||
23 | |||
24 | 17 | public function getFile() |
|
25 | { |
||
26 | 17 | return $this->file; |
|
27 | } |
||
28 | |||
29 | abstract protected function configureSchema(\DOMElement $element); |
||
30 | |||
31 | /** |
||
32 | * @param \DOMDocument $doc |
||
33 | * @throws InvalidFileStructureException |
||
34 | */ |
||
35 | |||
36 | 16 | protected function validateSchema(\DOMDocument $doc) |
|
53 | } |
||
54 |