Skip to content

Commit d523842

Browse files
committed
Add psalm purity markers
1 parent 8d95908 commit d523842

3 files changed

Lines changed: 20 additions & 0 deletions

File tree

src/Data.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@ public function remove(string $key): void
141141

142142
/**
143143
* {@inheritdoc}
144+
*
145+
* @psalm-mutation-free
144146
*/
145147
public function get(string $key, $default = null)
146148
{
@@ -163,6 +165,8 @@ public function get(string $key, $default = null)
163165

164166
/**
165167
* {@inheritdoc}
168+
*
169+
* @psalm-mutation-free
166170
*/
167171
public function has(string $key): bool
168172
{
@@ -185,6 +189,8 @@ public function has(string $key): bool
185189

186190
/**
187191
* {@inheritdoc}
192+
*
193+
* @psalm-mutation-free
188194
*/
189195
public function getData(string $key): DataInterface
190196
{
@@ -214,6 +220,8 @@ public function importData(DataInterface $data, bool $clobber = true): void
214220

215221
/**
216222
* {@inheritdoc}
223+
*
224+
* @psalm-mutation-free
217225
*/
218226
public function export(): array
219227
{

src/DataInterface.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,8 @@ public function remove(string $key): void;
4343
* @param mixed $default
4444
*
4545
* @return mixed
46+
*
47+
* @psalm-mutation-free
4648
*/
4749
public function get(string $key, $default = null);
4850

@@ -52,6 +54,8 @@ public function get(string $key, $default = null);
5254
* @param string $key
5355
*
5456
* @return bool
57+
*
58+
* @psalm-mutation-free
5559
*/
5660
public function has(string $key): bool;
5761

@@ -61,6 +65,8 @@ public function has(string $key): bool;
6165
* @param string $key
6266
*
6367
* @return DataInterface
68+
*
69+
* @psalm-mutation-free
6470
*/
6571
public function getData(string $key): DataInterface;
6672

@@ -84,6 +90,8 @@ public function importData(DataInterface $data, bool $clobber = true): void;
8490
* Export data as raw data
8591
*
8692
* @return array<string, mixed>
93+
*
94+
* @psalm-mutation-free
8795
*/
8896
public function export(): array;
8997
}

src/Util.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ class Util
2222
* @param array<mixed> $arr
2323
*
2424
* @return bool
25+
*
26+
* @psalm-pure
2527
*/
2628
public static function isAssoc(array $arr): bool
2729
{
@@ -36,6 +38,8 @@ public static function isAssoc(array $arr): bool
3638
* @param bool $clobber
3739
*
3840
* @return mixed
41+
*
42+
* @psalm-pure
3943
*/
4044
public static function mergeAssocArray($to, $from, $clobber = true)
4145
{

0 commit comments

Comments
 (0)