@@ -593,10 +593,6 @@ abstract protected function internalSetItem(string $normalizedKey, mixed $value)
593
593
594
594
/**
595
595
* {@inheritDoc}
596
- *
597
- * @triggers setItems.pre(PreEvent)
598
- * @triggers setItems.post(PostEvent)
599
- * @triggers setItems.exception(ExceptionEvent)
600
596
*/
601
597
public function setItems (array $ keyValuePairs ): array
602
598
{
@@ -630,15 +626,15 @@ public function setItems(array $keyValuePairs): array
630
626
/**
631
627
* Internal method to store multiple items.
632
628
*
633
- * @param non-empty-array<non-empty-string,mixed> $normalizedKeyValuePairs
634
- * @return list<non-empty-string> Array of not stored keys
629
+ * @param non-empty-array<non-empty-string|int ,mixed> $normalizedKeyValuePairs
630
+ * @return list<non-empty-string|int > Array of not stored keys
635
631
* @throws Exception\ExceptionInterface
636
632
*/
637
633
protected function internalSetItems (array $ normalizedKeyValuePairs ): array
638
634
{
639
635
$ failedKeys = [];
640
636
foreach ($ normalizedKeyValuePairs as $ normalizedKey => $ value ) {
641
- if (! $ this ->internalSetItem ($ normalizedKey , $ value )) {
637
+ if (! $ this ->internalSetItem (( string ) $ normalizedKey , $ value )) {
642
638
$ failedKeys [] = $ normalizedKey ;
643
639
}
644
640
}
@@ -647,12 +643,7 @@ protected function internalSetItems(array $normalizedKeyValuePairs): array
647
643
}
648
644
649
645
/**
650
- * Add an item.
651
- *
652
- * @throws Exception\ExceptionInterface
653
- * @triggers addItem.pre(PreEvent)
654
- * @triggers addItem.post(PostEvent)
655
- * @triggers addItem.exception(ExceptionEvent)
646
+ * {@inheritDoc}
656
647
*/
657
648
public function addItem (string $ key , mixed $ value ): bool
658
649
{
@@ -702,10 +693,6 @@ protected function internalAddItem(string $normalizedKey, mixed $value): bool
702
693
703
694
/**
704
695
* {@inheritDoc}
705
- *
706
- * @triggers addItems.pre(PreEvent)
707
- * @triggers addItems.post(PostEvent)
708
- * @triggers addItems.exception(ExceptionEvent)
709
696
*/
710
697
public function addItems (array $ keyValuePairs ): array
711
698
{
@@ -740,15 +727,15 @@ public function addItems(array $keyValuePairs): array
740
727
/**
741
728
* Internal method to add multiple items.
742
729
*
743
- * @param non-empty-array<non-empty-string,mixed> $normalizedKeyValuePairs
744
- * @return list<non-empty-string> Array of not stored keys
730
+ * @param non-empty-array<non-empty-string|int ,mixed> $normalizedKeyValuePairs
731
+ * @return list<non-empty-string|int > Array of not stored keys
745
732
* @throws Exception\ExceptionInterface
746
733
*/
747
734
protected function internalAddItems (array $ normalizedKeyValuePairs ): array
748
735
{
749
736
$ result = [];
750
737
foreach ($ normalizedKeyValuePairs as $ normalizedKey => $ value ) {
751
- if (! $ this ->internalAddItem ($ normalizedKey , $ value )) {
738
+ if (! $ this ->internalAddItem (( string ) $ normalizedKey , $ value )) {
752
739
$ result [] = $ normalizedKey ;
753
740
}
754
741
}
@@ -757,12 +744,7 @@ protected function internalAddItems(array $normalizedKeyValuePairs): array
757
744
}
758
745
759
746
/**
760
- * Replace an existing item.
761
- *
762
- * @throws Exception\ExceptionInterface
763
- * @triggers replaceItem.pre(PreEvent)
764
- * @triggers replaceItem.post(PostEvent)
765
- * @triggers replaceItem.exception(ExceptionEvent)
747
+ * {@inheritDoc}
766
748
*/
767
749
public function replaceItem (string $ key , mixed $ value ): bool
768
750
{
@@ -812,10 +794,6 @@ protected function internalReplaceItem(string $normalizedKey, mixed $value): boo
812
794
813
795
/**
814
796
* {@inheritDoc}
815
- *
816
- * @triggers replaceItems.pre(PreEvent)
817
- * @triggers replaceItems.post(PostEvent)
818
- * @triggers replaceItems.exception(ExceptionEvent)
819
797
*/
820
798
public function replaceItems (array $ keyValuePairs ): array
821
799
{
@@ -847,15 +825,15 @@ public function replaceItems(array $keyValuePairs): array
847
825
/**
848
826
* Internal method to replace multiple existing items.
849
827
*
850
- * @param non-empty-array<non-empty-string,mixed> $normalizedKeyValuePairs
851
- * @return list<non-empty-string> Array of not stored keys
828
+ * @param non-empty-array<non-empty-string|int ,mixed> $normalizedKeyValuePairs
829
+ * @return list<non-empty-string|int > Array of not stored keys
852
830
* @throws Exception\ExceptionInterface
853
831
*/
854
832
protected function internalReplaceItems (array $ normalizedKeyValuePairs ): array
855
833
{
856
834
$ result = [];
857
835
foreach ($ normalizedKeyValuePairs as $ normalizedKey => $ value ) {
858
- if (! $ this ->internalReplaceItem ($ normalizedKey , $ value )) {
836
+ if (! $ this ->internalReplaceItem (( string ) $ normalizedKey , $ value )) {
859
837
$ result [] = $ normalizedKey ;
860
838
}
861
839
}
@@ -864,15 +842,7 @@ protected function internalReplaceItems(array $normalizedKeyValuePairs): array
864
842
}
865
843
866
844
/**
867
- * Set an item only if token matches
868
- *
869
- * It uses the token received from getItem() to check if the item has
870
- * changed before overwriting it.
871
- *
872
- * @see setItem()
873
- * @see getItem()
874
- *
875
- * @throws Exception\ExceptionInterface
845
+ * {@inheritDoc}
876
846
*/
877
847
public function checkAndSetItem (mixed $ token , string $ key , mixed $ value ): bool
878
848
{
@@ -906,9 +876,6 @@ public function checkAndSetItem(mixed $token, string $key, mixed $value): bool
906
876
/**
907
877
* Internal method to set an item only if token matches
908
878
*
909
- * @see getItem()
910
- * @see setItem()
911
- *
912
879
* @param non-empty-string $normalizedKey
913
880
* @throws Exception\ExceptionInterface
914
881
*/
@@ -923,12 +890,7 @@ protected function internalCheckAndSetItem(mixed $token, string $normalizedKey,
923
890
}
924
891
925
892
/**
926
- * Reset lifetime of an item
927
- *
928
- * @throws Exception\ExceptionInterface
929
- * @triggers touchItem.pre(PreEvent)
930
- * @triggers touchItem.post(PostEvent)
931
- * @triggers touchItem.exception(ExceptionEvent)
893
+ * {@inheritDoc}
932
894
*/
933
895
public function touchItem (string $ key ): bool
934
896
{
@@ -976,10 +938,6 @@ protected function internalTouchItem(string $normalizedKey): bool
976
938
977
939
/**
978
940
* {@inheritDoc}
979
- *
980
- * @triggers touchItems.pre(PreEvent)
981
- * @triggers touchItems.post(PostEvent)
982
- * @triggers touchItems.exception(ExceptionEvent)
983
941
*/
984
942
public function touchItems (array $ keys ): array
985
943
{
@@ -1029,12 +987,7 @@ protected function internalTouchItems(array $normalizedKeys): array
1029
987
}
1030
988
1031
989
/**
1032
- * Remove an item.
1033
- *
1034
- * @throws Exception\ExceptionInterface
1035
- * @triggers removeItem.pre(PreEvent)
1036
- * @triggers removeItem.post(PostEvent)
1037
- * @triggers removeItem.exception(ExceptionEvent)
990
+ * {@inheritDoc}
1038
991
*/
1039
992
public function removeItem (string $ key ): bool
1040
993
{
@@ -1076,10 +1029,6 @@ abstract protected function internalRemoveItem(string $normalizedKey): bool;
1076
1029
1077
1030
/**
1078
1031
* {@inheritDoc}
1079
- *
1080
- * @triggers removeItems.pre(PreEvent)
1081
- * @triggers removeItems.post(PostEvent)
1082
- * @triggers removeItems.exception(ExceptionEvent)
1083
1032
*/
1084
1033
public function removeItems (array $ keys ): array
1085
1034
{
@@ -1135,11 +1084,7 @@ protected function internalRemoveItems(array $normalizedKeys): array
1135
1084
/* status */
1136
1085
1137
1086
/**
1138
- * Get capabilities of this adapter
1139
- *
1140
- * @triggers getCapabilities.pre(PreEvent)
1141
- * @triggers getCapabilities.post(PostEvent)
1142
- * @triggers getCapabilities.exception(ExceptionEvent)
1087
+ * {@inheritDoc}
1143
1088
*/
1144
1089
public function getCapabilities (): Capabilities
1145
1090
{
@@ -1172,21 +1117,6 @@ protected function internalGetCapabilities(): Capabilities
1172
1117
return $ this ->capabilities ??= new Capabilities ();
1173
1118
}
1174
1119
1175
- /* internal */
1176
-
1177
- /**
1178
- * Validates and normalizes a key
1179
- *
1180
- * @deprecated Use {@see AbstractAdapter::assertValidKey()} instead.
1181
- *
1182
- * @throws Exception\InvalidArgumentException On an invalid key.
1183
- * @psalm-assert non-empty-string $key
1184
- */
1185
- protected function normalizeKey (string $ key ): void
1186
- {
1187
- $ this ->assertValidKey ($ key );
1188
- }
1189
-
1190
1120
/**
1191
1121
* Validates and normalizes multiple keys
1192
1122
*
@@ -1203,20 +1133,6 @@ protected function normalizeKeys(array $keys): array
1203
1133
return array_values (array_unique ($ keys ));
1204
1134
}
1205
1135
1206
- /**
1207
- * Validates and normalizes an array of key-value pairs
1208
- *
1209
- * @deprecated Please use {@see AbstractAdapter::assertValidKeyValuePairs()} instead.
1210
- *
1211
- * @param array<string,mixed> $keyValuePairs
1212
- * @psalm-assert array<non-empty-string,mixed> $keyValuePairs
1213
- * @throws Exception\InvalidArgumentException On an invalid key.
1214
- */
1215
- protected function normalizeKeyValuePairs (array $ keyValuePairs ): void
1216
- {
1217
- $ this ->assertValidKeyValuePairs ($ keyValuePairs );
1218
- }
1219
-
1220
1136
/**
1221
1137
* @template TKey
1222
1138
* @param TKey $key
0 commit comments