mirror of
https://github.com/rectorphp/rector.git
synced 2024-06-10 21:22:21 +00:00
50 lines
1.1 KiB
PHP
50 lines
1.1 KiB
PHP
<?php
|
|
|
|
namespace Rector\Tests\DowngradePhp72\Rector\FuncCall\DowngradeJsonDecodeNullAssociativeArgRector\Fixture;
|
|
|
|
/**
|
|
* @see \Clue\React\NDJson\Decoder
|
|
*/
|
|
final class ClueJsonDecode
|
|
{
|
|
private $assoc;
|
|
private $depth;
|
|
private $options;
|
|
|
|
public function run($data)
|
|
{
|
|
if ($this->options === 0) {
|
|
$data = \json_decode($data, $this->assoc, $this->depth);
|
|
} else {
|
|
$data = \json_decode($data, $this->assoc, $this->depth, $this->options);
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|
|
-----
|
|
<?php
|
|
|
|
namespace Rector\Tests\DowngradePhp72\Rector\FuncCall\DowngradeJsonDecodeNullAssociativeArgRector\Fixture;
|
|
|
|
/**
|
|
* @see \Clue\React\NDJson\Decoder
|
|
*/
|
|
final class ClueJsonDecode
|
|
{
|
|
private $assoc;
|
|
private $depth;
|
|
private $options;
|
|
|
|
public function run($data)
|
|
{
|
|
if ($this->options === 0) {
|
|
$data = \json_decode($data, $this->assoc === null ?: $this->assoc, $this->depth);
|
|
} else {
|
|
$data = \json_decode($data, $this->assoc === null ?: $this->assoc, $this->depth, $this->options);
|
|
}
|
|
}
|
|
}
|
|
|
|
?>
|