List (array
destructuring) assignment should be declared using the
configured syntax. Requires PHP >= 7.1.
Whether to use the long
or short
syntax for array destructuring.
Allowed values: 'long'
and 'short'
Default value: 'short'
Default configuration.
--- Original
+++ New
<?php
-list($sample) = $array;
+[$sample] = $array;
With configuration: ['syntax' => 'long']
.
--- Original
+++ New
<?php
-[$sample] = $array;
+list($sample) = $array;
The rule is part of the following rule sets: