lib/3rdParty/composer/symfony/http-foundation/Session/Attribute/AttributeBagInterface.php
raw symbols SCIP| 1 | <?php |
| 2 | |
| 3 | /* |
| 4 | * This file is part of the Symfony package. |
| 5 | * |
| 6 | * (c) Fabien Potencier <[email protected]> |
| 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\HttpFoundation\Session\Attribute; |
| 13 | |
| 14 | use Symfony\Component\HttpFoundation\Session\SessionBagInterface; |
| 15 | |
| 16 | /** |
| 17 | * Attributes store. |
| 18 | * |
| 19 | * @author Drak <[email protected]> |
| 20 | */ |
| 21 | interface AttributeBagInterface extends SessionBagInterface |
| 22 | { |
| 23 | /** |
| 24 | * Checks if an attribute is defined. |
| 25 | */ |
| 26 | public function has(string $name): bool; |
| 27 | |
| 28 | /** |
| 29 | * Returns an attribute. |
| 30 | */ |
| 31 | public function get(string $name, mixed $default = null): mixed; |
| 32 | |
| 33 | /** |
| 34 | * Sets an attribute. |
| 35 | */ |
| 36 | public function set(string $name, mixed $value): void; |
| 37 | |
| 38 | /** |
| 39 | * Returns attributes. |
| 40 | * |
| 41 | * @return array<string, mixed> |
| 42 | */ |
| 43 | public function all(): array; |
| 44 | |
| 45 | public function replace(array $attributes): void; |
| 46 | |
| 47 | /** |
| 48 | * Removes an attribute. |
| 49 | * |
| 50 | * @return mixed The removed value or null when it does not exist |
| 51 | */ |
| 52 | public function remove(string $name): mixed; |
| 53 | } |