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