Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is part of the Symfony package. |
| 5 | * |
| 6 | * (c) Fabien Potencier <fabien@symfony.com> |
| 7 | * |
| 8 | * For the full copyright and license information, please view the LICENSE |
| 9 | * file that was distributed with this source code. |
| 10 | */ |
| 11 | |
| 12 | namespace Symfony\Component\Translation\Catalogue; |
| 13 | |
| 14 | use Symfony\Component\Translation\MessageCatalogueInterface; |
| 15 | |
| 16 | /** |
| 17 | * Represents an operation on catalogue(s). |
| 18 | * |
| 19 | * An instance of this interface performs an operation on one or more catalogues and |
| 20 | * stores intermediate and final results of the operation. |
| 21 | * |
| 22 | * The first catalogue in its argument(s) is called the 'source catalogue' or 'source' and |
| 23 | * the following results are stored: |
| 24 | * |
| 25 | * Messages: also called 'all', are valid messages for the given domain after the operation is performed. |
| 26 | * |
| 27 | * New Messages: also called 'new' (new = all ∖ source = {x: x ∈ all ∧ x ∉ source}). |
| 28 | * |
| 29 | * Obsolete Messages: also called 'obsolete' (obsolete = source ∖ all = {x: x ∈ source ∧ x ∉ all}). |
| 30 | * |
| 31 | * Result: also called 'result', is the resulting catalogue for the given domain that holds the same messages as 'all'. |
| 32 | * |
| 33 | * @author Jean-François Simon <jeanfrancois.simon@sensiolabs.com> |
| 34 | */ |
| 35 | interface OperationInterface |
| 36 | { |
| 37 | /** |
| 38 | * Returns domains affected by operation. |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 39 | */ |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame^] | 40 | public function getDomains(): array; |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 41 | |
| 42 | /** |
| 43 | * Returns all valid messages ('all') after operation. |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 44 | */ |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame^] | 45 | public function getMessages(string $domain): array; |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 46 | |
| 47 | /** |
| 48 | * Returns new messages ('new') after operation. |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 49 | */ |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame^] | 50 | public function getNewMessages(string $domain): array; |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 51 | |
| 52 | /** |
| 53 | * Returns obsolete messages ('obsolete') after operation. |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 54 | */ |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame^] | 55 | public function getObsoleteMessages(string $domain): array; |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 56 | |
| 57 | /** |
| 58 | * Returns resulting catalogue ('result'). |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 59 | */ |
Matthias Andreas Benkard | 1ba5381 | 2022-12-27 17:32:58 +0100 | [diff] [blame^] | 60 | public function getResult(): MessageCatalogueInterface; |
Matthias Andreas Benkard | 7b2a3a1 | 2021-08-16 10:57:25 +0200 | [diff] [blame] | 61 | } |