REDROOM
PHP 8.2.31
Path:
Logout
Edit File
Size: 2.26 KB
Close
/opt/cpanel/ea-wappspector/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Tests/Arrays/ArrayIndentUnitTest.inc
Text
Base64
<?php $var = [1,2,3]; $var = [ 1, 2, 3 ]; $var = [ 1, 2, /* three */ 3, ]; $var = [ 1, 2, /* three */ 3, ]; $var = [ 1 => 'one', 2 => 'two', 3 => 'three' ]; $var = [ 1 => 'one', 2 => 'two', /* three */ 3 => 'three', ]; $var = [ 1 => 'one', 2 => 'two', /* three */ 3 => 'three', ]; $var = array( 'one' => function() { $foo = [1,2,3]; $bar = [ 1, 2, 3]; }, 'two' => 2, ); return [ [ 'foo' => true, ] ]; $array = [ 'foo' => 'foo', 'bar' => $baz ? ['abc'] : ['def'], 'hey' => $baz ?? ['one'] ?? ['two'], 'fn' => fn ($x) => yield 'k' => $x, $a ?? $b, $c ? $d : $e, ]; $foo = [ 'bar' => [ ], ]; $foo = [ 'foo' . 'bar', [ 'baz', 'qux', ], ]; // phpcs:set Generic.Arrays.ArrayIndent indent 2 $var = [ 1 => 'one', 2 => 'two', /* three */ 3 => 'three', ]; // phpcs:set Generic.Arrays.ArrayIndent indent 4 $array = array( match ($test) { 1 => 'a', 2 => 'b' } => 'dynamic keys, woho!', ); $array = [ match ($test) { 1 => 'a', 2 => 'b' } => 'dynamic keys, woho!', ]; // Ensure that PHP 8.0 named parameters don't affect the sniff. $array = [ functionCall( name: $value ), ]; $array = [ functionCall( name: $value ), ]; // phpcs:set Generic.Arrays.ArrayIndent indent 1 // Testing pluralization of indent text - open brace indent. $var = [ 1 => 'one', ]; // Testing pluralization of indent text - array item indent. $var = [ 1 => 'one', 2 => 'two', /* three */ 3 => 'three', ]; // Testing pluralization of indent text - close brace indent. $var = [ 1 => 'one', ]; // phpcs:set Generic.Arrays.ArrayIndent indent 0 // No test for open brace indent as that is _minimum_ and any actual value will be 0 or more, so with indent 0, this will never yield an error. // Testing pluralization of indent text - array item indent. $var = [ 1 => 'one', 2 => 'two', /* three */ 3 => 'three', ]; // Testing pluralization of indent text - close brace indent. $var = [ 1 => 'one', ]; // phpcs:set Generic.Arrays.ArrayIndent indent 4 $array = [1, ];
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 12
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
ArrayIndentUnitTest.inc
2.26 KB
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ArrayIndentUnitTest.inc.fixed
2.23 KB
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ArrayIndentUnitTest.php
1.88 KB
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DisallowLongArraySyntaxUnitTest.1.inc
526 B
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DisallowLongArraySyntaxUnitTest.1.inc.fixed
501 B
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DisallowLongArraySyntaxUnitTest.2.inc
395 B
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DisallowLongArraySyntaxUnitTest.2.inc.fixed
390 B
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DisallowLongArraySyntaxUnitTest.3.inc
181 B
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DisallowLongArraySyntaxUnitTest.php
1.94 KB
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DisallowShortArraySyntaxUnitTest.inc
161 B
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DisallowShortArraySyntaxUnitTest.inc.fixed
181 B
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
DisallowShortArraySyntaxUnitTest.php
1.43 KB
lrw-r--r--
2025-11-04 16:30:35
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).