Skip to content

Commit 91192e2

Browse files
committed
Upgrade to Psalm 4 to fix issues since #40.
The mbstring polyfill added ??= which causes errors with Psalm 3. See: symfony/polyfill-mbstring@11d0d87#r45855304 This also removes the use of references in Data->has, because Psalm (rightly) considers that impure.
1 parent 0992cc1 commit 91192e2

2 files changed

Lines changed: 4 additions & 3 deletions

File tree

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535
"phpunit/phpunit": "^7.5 || ^8.5 || ^9.3",
3636
"scrutinizer/ocular": "1.6.0",
3737
"squizlabs/php_codesniffer": "^3.5",
38-
"vimeo/psalm": "^3.14"
38+
"vimeo/psalm": "^4.0.0"
3939
},
4040
"autoload": {
4141
"psr-4": {

src/Data.php

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ public function get(string $key, $default = null)
145145
*/
146146
public function has(string $key): bool
147147
{
148-
$currentValue = &$this->data;
148+
$currentValue = $this->data;
149149

150150
foreach (self::keyToPathArray($key) as $currentKey) {
151151
if (
@@ -154,7 +154,7 @@ public function has(string $key): bool
154154
) {
155155
return false;
156156
}
157-
$currentValue = &$currentValue[$currentKey];
157+
$currentValue = $currentValue[$currentKey];
158158
}
159159

160160
return true;
@@ -223,6 +223,7 @@ public function offsetGet($key)
223223
* {@inheritdoc}
224224
*
225225
* @param string $key
226+
* @param mixed $value
226227
*/
227228
#[\ReturnTypeWillChange]
228229
public function offsetSet($key, $value)

0 commit comments

Comments
 (0)