Skip to content

Latest commit

 

History

History
42 lines (29 loc) · 1.17 KB

normalize_index_brace.rst

File metadata and controls

42 lines (29 loc) · 1.17 KB

Rule normalize_index_brace

Array index should always be written by using square braces.

Examples

Example #1

--- Original
+++ New
 <?php
-echo $sample{$index};
+echo $sample[$index];

Rule sets

The rule is part of the following rule sets:

@PHP74Migration
Using the @PHP74Migration rule set will enable the normalize_index_brace rule.
@PHP80Migration
Using the @PHP80Migration rule set will enable the normalize_index_brace rule.
@PHP81Migration
Using the @PHP81Migration rule set will enable the normalize_index_brace rule.
@PHP82Migration
Using the @PHP82Migration rule set will enable the normalize_index_brace rule.
@PhpCsFixer
Using the @PhpCsFixer rule set will enable the normalize_index_brace rule.
@Symfony
Using the @Symfony rule set will enable the normalize_index_brace rule.