Skip to content

Commit

Permalink
enable formatting in tests/
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Feb 9, 2025
1 parent 71cb3dc commit c55cfa5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 3 additions & 1 deletion phpcs.xml.dist
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@

<!-- Paths to check -->
<file>src</file>
<file>tests</file>
<exclude-pattern>tests/**/data</exclude-pattern>

<rule ref="Generic.Files.LineLength">
<properties>
<property name="lineLimit" value="300"/>
<property name="absoluteLineLimit" value="500"/>
</properties>
</rule>
</ruleset>
</ruleset>
6 changes: 2 additions & 4 deletions src/Rules/UseSafeFunctionsRule.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,13 @@ public function processNode(Node $node, Scope $scope): array
$unsafeFunctions = FunctionListLoader::getFunctionList();

if (isset($unsafeFunctions[$functionName])) {
if (
$functionName === "json_decode"
if ($functionName === "json_decode"
&& $this->argValueIncludeJSONTHROWONERROR($node->getArgs()[3] ?? null)
) {
return [];
}

if (
$functionName === "json_encode"
if ($functionName === "json_encode"
&& $this->argValueIncludeJSONTHROWONERROR($node->getArgs()[1] ?? null)
) {
return [];
Expand Down

0 comments on commit c55cfa5

Please sign in to comment.