You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
22 lines
534 B
PHP
22 lines
534 B
PHP
<?php
|
|
declare(strict_types=1);
|
|
|
|
namespace App\Request;
|
|
|
|
class ApiRequest extends Request
|
|
{
|
|
public function __construct(array $params = [])
|
|
{
|
|
$data = json_decode($params['data'], true);
|
|
foreach ($this->defaults() as $key => $value) {
|
|
if (isset($data[$key])) {
|
|
if (empty($value) && empty($data[$key])) {
|
|
$data[$key] = $value;
|
|
}
|
|
} else {
|
|
$data[$key] = $value;
|
|
}
|
|
}
|
|
$this->_data = $data;
|
|
}
|
|
} |