We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
@var mixed
1 parent d0a62be commit 98ac273Copy full SHA for 98ac273
php-cs-fixer-rules.php
@@ -48,7 +48,10 @@
48
],
49
'no_multiline_whitespace_around_double_arrow' => true,
50
'no_superfluous_elseif' => true,
51
- 'no_superfluous_phpdoc_tags' => true,
+ 'no_superfluous_phpdoc_tags' => [
52
+ // Psalm wants us to have an explicit type annotation whenever we assign `mixed` to a variable.
53
+ 'allow_mixed' => true,
54
+ ],
55
'no_trailing_comma_in_singleline' => true,
56
'no_unused_imports' => true,
57
'no_useless_else' => true,
tests/fixtures/valid/mixed-assignment.php
@@ -0,0 +1,13 @@
1
+<?php
2
+
3
+declare(strict_types=1);
4
5
+/**
6
+ * @param array<string, mixed> $struct
7
+ */
8
+function getFoo(array $struct): void
9
+{
10
+ /** @var mixed $foo */
11
+ $foo = $struct['foo'];
12
+ echo $foo;
13
+}
0 commit comments