Skip to content

Commit 82e222c

Browse files
committed
enable formatting in tests/
1 parent b35841a commit 82e222c

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

phpcs.xml.dist

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,12 @@
1111

1212
<!-- Paths to check -->
1313
<file>src</file>
14+
<file>tests</file>
1415

1516
<rule ref="Generic.Files.LineLength">
1617
<properties>
1718
<property name="lineLimit" value="300"/>
1819
<property name="absoluteLineLimit" value="500"/>
1920
</properties>
2021
</rule>
21-
</ruleset>
22+
</ruleset>

src/Rules/UseSafeFunctionsRule.php

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,13 @@ public function processNode(Node $node, Scope $scope): array
3333
$unsafeFunctions = FunctionListLoader::getFunctionList();
3434

3535
if (isset($unsafeFunctions[$functionName])) {
36-
if (
37-
$functionName === "json_decode"
36+
if ($functionName === "json_decode"
3837
&& $this->argValueIncludeJSONTHROWONERROR($node->getArgs()[3] ?? null)
3938
) {
4039
return [];
4140
}
4241

43-
if (
44-
$functionName === "json_encode"
42+
if ($functionName === "json_encode"
4543
&& $this->argValueIncludeJSONTHROWONERROR($node->getArgs()[1] ?? null)
4644
) {
4745
return [];

tests/Rules/data/fopen.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
22

3-
function foo() {
3+
function foo()
4+
{
45
$fp = fopen('foobar', 'r');
56
}

tests/Rules/data/safe_fopen.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
<?php
22
use function Safe\fopen;
33

4-
function foo() {
4+
function foo()
5+
{
56
$fp = fopen('foobar', 'r');
67
}

tests/Rules/data/undirect_call.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
<?php
2-
function foo() {
2+
function foo()
3+
{
34
$toto = 'fopen';
45
$toto('foobar', 'r');
56
}

0 commit comments

Comments
 (0)