1<?php
2namespace TYPO3\CMS\Install\FolderStructure;
3
4/*
5 * This file is part of the TYPO3 CMS project.
6 *
7 * It is free software; you can redistribute it and/or modify it under
8 * the terms of the GNU General Public License, either version 2
9 * of the License, or any later version.
10 *
11 * For the full copyright and license information, please read the
12 * LICENSE.txt file that was distributed with this source code.
13 *
14 * The TYPO3 project - inspiring people to share!
15 */
16
17use TYPO3\CMS\Core\Messaging\FlashMessage;
18
19/**
20 * Interface for structure nodes root, link, file, ...
21 */
22interface NodeInterface
23{
24    /**
25     * Constructor gets structure and parent object defaulting to NULL
26     *
27     * @param array $structure Structure
28     * @param NodeInterface $parent Parent
29     */
30    public function __construct(array $structure, NodeInterface $parent = null);
31
32    /**
33     * Get node name
34     *
35     * @return string Node name
36     */
37    public function getName();
38
39    /**
40     * Get absolute path of node
41     *
42     * @return string Absolute path
43     */
44    public function getAbsolutePath();
45
46    /**
47     * Get the status of the object tree, recursive for directory and root node
48     *
49     * @return FlashMessage[]
50     */
51    public function getStatus(): array;
52
53    /**
54     * Check if node is writable - can be created and permission can be fixed
55     *
56     * @return bool TRUE if node is writable
57     */
58    public function isWritable();
59
60    /**
61     * Fix structure
62     *
63     * If there is nothing to fix, returns an empty array
64     *
65     * @return FlashMessage[]
66     */
67    public function fix(): array;
68}
69