-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathUpdate.php
More file actions
34 lines (26 loc) · 800 Bytes
/
Copy pathUpdate.php
File metadata and controls
34 lines (26 loc) · 800 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?php
declare(strict_types=1);
/*
* This file is part of the QuidPHP package <https://quidphp.com>
* Author: Pierre-Philippe Emond <emondpph@gmail.com>
* License: https://github.com/quidphp/main/blob/master/LICENSE
*/
namespace Quid\Main;
// update
// class for a collection containing an update-only array (cannot insert after initialization)
class Update extends Map
{
// config
protected static array $config = [];
// dynamique
protected ?array $mapAllow = ['set','serialize','clone']; // méthode permises
// set
// comme set, mais vérifie que la clé existe
final public function set($key,$value):self
{
if($key === null || !$this->exists($key))
static::throw('cannotInsertNewKey');
return parent::set($key,$value);
}
}
?>