Skip to content

Commit 9d145a4

Browse files
committed
fix missing coverage
1 parent 8345add commit 9d145a4

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
<?php
22

33
fopen('foobar', 'r');
4+
json_decode("{}", flags: JSON_INVALID_UTF8_IGNORE);
5+
json_encode([], flags: JSON_FORCE_OBJECT);

tests/Rules/UseSafeFunctionsRuleTest.php

+8
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ public function testUnsafe(): void
2222
"Function fopen is unsafe to use. It can return FALSE instead of throwing an exception. Please add 'use function Safe\\fopen;' at the beginning of the file to use the variant provided by the 'thecodingmachine/safe' library.",
2323
3,
2424
],
25+
[
26+
"Function json_decode is unsafe to use. It can return FALSE instead of throwing an exception. Please add 'use function Safe\\json_decode;' at the beginning of the file to use the variant provided by the 'thecodingmachine/safe' library.",
27+
4,
28+
],
29+
[
30+
"Function json_encode is unsafe to use. It can return FALSE instead of throwing an exception. Please add 'use function Safe\\json_encode;' at the beginning of the file to use the variant provided by the 'thecodingmachine/safe' library.",
31+
5,
32+
],
2533
]);
2634
}
2735

0 commit comments

Comments
 (0)