You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This sniff ensures that parameters passed to a function are used within that function, and warns if they are not. Sometimes, parameters can be left unused when doing something like implementing an interface, such as with the following code:
98
+
99
+
```php
100
+
public function execute(InputInterface $input, OutputInterface $output): int
101
+
{
102
+
$output->writeln('Hello World!');
103
+
}
104
+
```
105
+
106
+
If the `InputInterface` parameter does not need to be used, you can tell the sniff to ignore all variables with that type hint by setting the `ignoreTypeHints` property.
@@ -107,8 +135,8 @@ If the `error` property is set to `false`, a warning will be thrown for violatio
107
135
108
136
Property Name | Type | Default | Available Since
109
137
------------- | ----- | ------- | ---------------
110
-
errorCodes | array | - | -
111
-
ignoreCodes | array | - | -
138
+
errorCodes | array | [] | -
139
+
ignoreCodes | array | [] | -
112
140
113
141
The `Generic.Debug.ClosureLinter` sniff runs the [Google Closure Linter](https://github.com/google/closure-linter) tool over JavaScript files and reports errors that the tool finds. All found errors are reported as PHP_CodeSniffer warnings by default.
114
142
@@ -458,10 +486,10 @@ Strictly speaking, a name cannot have two capital letters next to each other in
This sniff discourages the use of alias functions that are kept in PHP for compatibility with older versions. The sniff can be used to forbid the use of any function by setting the `forbiddenFunctions` property. The property is defined as an array, with the keys being the names of the functions to forbid and the values being the names of suggested alternative functions to use instead. If no alternative function exists (i.e., the function should never be used) specify `null` as the value.
467
495
@@ -575,7 +603,7 @@ Property Name | Type | Default | Available Since
575
603
indent | int | 4 | -
576
604
exact | bool | false | -
577
605
tabIndent | bool | false | 2.0.0
578
-
ignoreIndentationTokens | array | - | 1.4.8
606
+
ignoreIndentationTokens | array | [] | 1.4.8
579
607
580
608
This sniff checks that code blocks are indented correctly. By default, this sniff ensures that code blocks are indented 4 spaces, but you can change the size of the indent by setting the `indent` property.
581
609
@@ -880,7 +908,7 @@ Property Name | Type | Default | Available Since
880
908
indent | int | 4 | -
881
909
exact | bool | false | -
882
910
tabIndent | bool | false | 2.0.0
883
-
ignoreIndentationTokens | array | - | 1.4.8
911
+
ignoreIndentationTokens | array | [] | 1.4.8
884
912
885
913
> Note: All properties are inherited from the [Generic.WhiteSpace.ScopeIndent](#genericwhitespacescopeindent) sniff.
0 commit comments