PluginProbe
Code Snippets / 3.10.1
Code Snippets v3.10.1
3.10.2 3.10.1 3.10.0 3.10.0-beta.2 3.10.0-beta.1 4.0.0-beta.1 3.9.6 trunk 2.10.0 2.10.1 2.12.0 2.12.1 2.13.0 2.13.1 2.13.2 2.13.3 2.14.0 2.14.1 2.14.2 2.14.3 2.14.4 2.14.5 2.14.6 3.0.0 3.0.1 All 64 releases
code-snippets / php / Flat_Files / Interfaces / Snippet_Config_Repository.php

Snippet_Config_Repository.php in Code Snippets 3.10.1, at php/Flat_Files/Interfaces/Snippet_Config_Repository.php

42 lines 1.1 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Code_Snippets\Flat_Files\Interfaces;
4
5 use Code_Snippets\Model\Snippet;
6
7 /**
8 * Interface for storing snippet configuration within a flat file.
9 */
10 interface Snippet_Config_Repository {
11
12 /**
13 * Load configuration from a directory.
14 *
15 * @param string $base_dir Full filesystem path to directory.
16 *
17 * @return array Loaded configuration.
18 */
19 public function load( string $base_dir ): array;
20
21 /**
22 * Store configuration.
23 *
24 * @param string $base_dir Full filesystem path to configuration directory.
25 * @param array $active_snippets List of active snippets.
26 *
27 * @return void
28 */
29 public function save( string $base_dir, array $active_snippets ): void;
30
31 /**
32 * Update stored configuration for a snippet.
33 *
34 * @param string $base_dir Full filesystem path to configuration directory.
35 * @param Snippet $snippet Snippet to update.
36 * @param bool|null $remove Whether to remove the snippet from the configuration.
37 *
38 * @return void
39 */
40 public function update( string $base_dir, Snippet $snippet, ?bool $remove = false ): void;
41 }
42