Skip to content

Commit be1813a

Browse files
ArshidArshid
authored andcommitted
[php 8.3] Add json_validate rule
1 parent 3377025 commit be1813a

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

rules-tests/Php83/Rector/BooleanAnd/JsonValidateRector/Fixture/Json_validate.php.inc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
<?php
2+
23
namespace Rector\Tests\Php83\Rector\BooleanAnd\JsonValidateRector\Fixture;
34

45
if (json_decode($json, true) !== null && json_last_error() === JSON_ERROR_NONE){
@@ -7,6 +8,7 @@ if (json_decode($json, true) !== null && json_last_error() === JSON_ERROR_NONE){
78
?>
89
-----
910
<?php
11+
1012
namespace Rector\Tests\Php83\Rector\BooleanAnd\JsonValidateRector\Fixture;
1113

1214
if (json_validate($json)){
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
<?php
22
namespace Rector\Tests\Php83\Rector\BooleanAnd\JsonValidateRector\Fixture;
33

4-
if (json_decode($json, true) !== null && json_last_error() === JSON_ERROR_NONE){
4+
if (json_decode(json: $json, true) !== null && json_last_error() === JSON_ERROR_NONE){
55
echo 1;
66
}
77
?>
88
-----
99
<?php
1010
namespace Rector\Tests\Php83\Rector\BooleanAnd\JsonValidateRector\Fixture;
1111

12-
if (json_validate($json)){
12+
if (json_validate(json: $json)){
1313
echo 1;
1414
}
1515
?>

0 commit comments

Comments
 (0)