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. |
| 39 | * |
| 40 | * @return array |
| 41 | */ |
| 42 | public function getDomains(); |
| 43 | |
| 44 | /** |
| 45 | * Returns all valid messages ('all') after operation. |
| 46 | * |
| 47 | * @return array |
| 48 | */ |
| 49 | public function getMessages(string $domain); |
| 50 | |
| 51 | /** |
| 52 | * Returns new messages ('new') after operation. |
| 53 | * |
| 54 | * @return array |
| 55 | */ |
| 56 | public function getNewMessages(string $domain); |
| 57 | |
| 58 | /** |
| 59 | * Returns obsolete messages ('obsolete') after operation. |
| 60 | * |
| 61 | * @return array |
| 62 | */ |
| 63 | public function getObsoleteMessages(string $domain); |
| 64 | |
| 65 | /** |
| 66 | * Returns resulting catalogue ('result'). |
| 67 | * |
| 68 | * @return MessageCatalogueInterface |
| 69 | */ |
| 70 | public function getResult(); |
| 71 | } |