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
Copy file name to clipboardExpand all lines: README.md
+25-21Lines changed: 25 additions & 21 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,10 +94,10 @@ Constructor's empty braces must be on a single line.
94
94
#### DataProviderNameFixer
95
95
Data provider names must match the name of the test.
96
96
DEPRECATED: use `php_unit_data_provider_name` instead.
97
-
*Risky: when relying on name of data provider function.*
97
+
*Risky: when one is calling data provider by name as function.*
98
98
Configuration options:
99
99
-`prefix` (`string`): prefix that replaces "test"; defaults to `'provide'`
100
-
-`suffix` (`string`): suffix to be added at the end"; defaults to `'Cases'`
100
+
-`suffix` (`string`): suffix to be present at the end; defaults to `'Cases'`
101
101
```diff
102
102
<?php
103
103
class FooTest extends TestCase {
@@ -114,7 +114,7 @@ Configuration options:
114
114
#### DataProviderReturnTypeFixer
115
115
The return type of PHPUnit data provider must be `iterable`.
116
116
DEPRECATED: use `php_unit_data_provider_return_type` instead.
117
-
*Risky: when relying on signature of data provider.*
117
+
*Risky: when relying on signature of the data provider.*
118
118
```diff
119
119
<?php
120
120
class FooTest extends TestCase {
@@ -130,9 +130,9 @@ The return type of PHPUnit data provider must be `iterable`.
130
130
#### DataProviderStaticFixer
131
131
Data providers must be static.
132
132
DEPRECATED: use `php_unit_data_provider_static` instead.
133
-
*Risky: when `force` is set to `true`.*
133
+
*Risky: when one is calling data provider function dynamically.*
134
134
Configuration options:
135
-
-`force` (`bool`): whether to make static data providers having dynamic class calls; defaults to `false`
135
+
-`force` (`bool`): whether to make the data providers static even if they have a dynamic class call (may introduce fatal error "using $this when not in object context", and you may have to adjust the code manually by converting dynamic calls to static ones); defaults to `false`
136
136
```diff
137
137
<?php
138
138
class FooTest extends TestCase {
@@ -178,12 +178,12 @@ Value from `foreach` must not be used if possible.
178
178
```
179
179
180
180
#### InternalClassCasingFixer
181
-
Classes defined internally by an extension or the core must be referenced with the correct case.
181
+
When referencing an internal class it must be written using the correct casing.
182
182
DEPRECATED: use `class_reference_name_casing` instead.
183
183
```diff
184
184
<?php
185
-
-$foo = new STDClass();
186
-
+$foo = new stdClass();
185
+
-throw new \exception();
186
+
+throw new \Exception();
187
187
```
188
188
189
189
#### IssetToArrayKeyExistsFixer
@@ -513,15 +513,16 @@ Assertions and attributes for PHP and PHPUnit versions must have explicit versio
513
513
```
514
514
515
515
#### PhpdocArrayStyleFixer
516
-
Generic array style should be used in PHPDoc.
516
+
PHPDoc `array<T>` type must be used instead of `T[]`.
517
517
DEPRECATED: use `phpdoc_array_type` instead.
518
518
```diff
519
519
<?php
520
520
/**
521
-
- * @return int[]
522
-
+ * @return array<int>
521
+
- * @param int[] $x
522
+
- * @param string[][] $y
523
+
+ * @param array<int> $x
524
+
+ * @param array<array<string>> $y
523
525
*/
524
-
function foo() { return [1, 2]; }
525
526
```
526
527
527
528
#### PhpdocNoIncorrectVarAnnotationFixer
@@ -566,12 +567,14 @@ Orders all `@param` annotations in DocBlocks according to method signature.
566
567
```diff
567
568
<?php
568
569
/**
569
-
+ * @param int $a
570
-
* @param int $b
571
-
- * @param int $a
572
-
* @param int $c
570
+
* Annotations in wrong order
571
+
*
572
+
* @param int $a
573
+
+ * @param array $b
574
+
* @param Foo $c
575
+
- * @param array $b
573
576
*/
574
-
function foo($a, $b, $c) {}
577
+
function m($a, array $b, Foo $c) {}
575
578
```
576
579
577
580
#### PhpdocParamTypeFixer
@@ -630,15 +633,16 @@ Configuration options:
630
633
```
631
634
632
635
#### PhpdocTypeListFixer
633
-
PHPDoc type `list` must be used instead of `array` without a key type.
636
+
PHPDoc `list`type must be used instead of `array` without a key.
0 commit comments