Skip to content

Commit fd3fdb5

Browse files
committed
Generic/RequireStrictTypes: add extra tests
These tests safeguard the following, which is already handled correctly by the sniff: * Execution directives are case-insensitive in PHP. * The sniff should ignore docblocks at the top of the file.
1 parent c0e4cfb commit fd3fdb5

File tree

3 files changed

+19
-3
lines changed

3 files changed

+19
-3
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?php
2+
3+
declare( Strict_Types = 1 );
4+
5+
// some code
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
/**
3+
* Very
4+
* Long
5+
* Docblock
6+
*/
7+
8+
declare(strict_types=1);
9+
10+
// some code

src/Standards/Generic/Tests/PHP/RequireStrictTypesUnitTest.php

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,12 +28,13 @@ class RequireStrictTypesUnitTest extends AbstractSniffUnitTest
2828
public function getErrorList($testFile='')
2929
{
3030
switch ($testFile) {
31-
case 'RequireStrictTypesUnitTest.1.inc':
31+
case 'RequireStrictTypesUnitTest.2.inc':
32+
return [1 => 1];
33+
34+
default:
3235
return [];
3336
}
3437

35-
return [1 => 1];
36-
3738
}//end getErrorList()
3839

3940

0 commit comments

Comments
 (0)