for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace MuCTS\Sobot\Contracts;
abstract class Request
{
protected $config = [];
protected $cache;
protected $param = [];
public function __construct(array $config, ?Cache $cache = null)
$this->config = $config;
$this->cache = $cache;
}
/**
* 获取应用ID
*
* @return string
* @author herry.yao <[email protected]>
* @version 1.2.2
* @date 2020-08-05
*/
public function getAppId(): string
return $this->config['app_id'];
* 获取授权秘钥
protected function getAppKey(): string
return $this->config['app_key'];
* 返回数组
* @return array
public function toArray(): array
return $this->param;
* call
* @param $name
* @param $arguments
* @return Request
public function __call($name, $arguments)
$name = hump_to_underline($name);
if (strpos($name, 'where') === 0) {
$name = substr($name, 6);
$this->param[$name] = $arguments[0];
return $this;
* 魔术方法赋值
* @param $value
public function __set($name, $value)
$this->param[$name] = $value;