Set or clear a color for one folder */
(string $folder, ?string $hex)
| 69 | |
| 70 | /** Set or clear a color for one folder */ |
| 71 | public static function setColor(string $folder, ?string $hex): array |
| 72 | { |
| 73 | $folder = self::normalizeFolder($folder); |
| 74 | $hex = self::normalizeHex($hex); |
| 75 | $map = self::getMap(); |
| 76 | |
| 77 | if ($hex === null) { |
| 78 | unset($map[$folder]); |
| 79 | } else { |
| 80 | $map[$folder] = $hex; |
| 81 | } |
| 82 | |
| 83 | self::writeMap($map); |
| 84 | return ['folder' => $folder, 'color' => $map[$folder] ?? null]; |
| 85 | } |
| 86 | |
| 87 | /** Migrate color entries for a whole subtree (used by move/rename) */ |
| 88 | public static function migrateSubtree(string $source, string $target): array |
no test coverage detected