modified 降低PHP版本,以兼容更多的项目
This commit is contained in:
parent
0575c220b0
commit
be3c52c505
|
@ -20,7 +20,6 @@ class Application {
|
|||
public static function make(string $name, array $config) {
|
||||
$namespace = Kernel\Support\Str::studly($name);
|
||||
$application = "\\EasyTiktok\\{$namespace}\\Application";
|
||||
|
||||
return new $application($config);
|
||||
}
|
||||
|
||||
|
|
|
@ -35,37 +35,37 @@ abstract class AccessToken implements AccessTokenInterface {
|
|||
/**
|
||||
* @var ServiceContainer
|
||||
*/
|
||||
protected ServiceContainer $app;
|
||||
protected $app;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected string $requestMethod = 'GET';
|
||||
protected $requestMethod = 'GET';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected string $endpointToGetToken;
|
||||
protected $endpointToGetToken;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected string $queryName;
|
||||
protected $queryName;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected array $token;
|
||||
protected $token;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected string $tokenKey = 'access_token';
|
||||
protected $tokenKey = 'access_token';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected string $cachePrefix = 'EasyTiktok.kernel.access_token.';
|
||||
protected $cachePrefix = 'EasyTiktok.kernel.access_token.';
|
||||
|
||||
/**
|
||||
* AccessToken constructor.
|
||||
|
|
|
@ -27,11 +27,11 @@ class BaseClient {
|
|||
/**
|
||||
* @var ServiceContainer
|
||||
*/
|
||||
protected ServiceContainer $app;
|
||||
protected $app;
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected string $baseUri;
|
||||
protected $baseUri;
|
||||
|
||||
/**
|
||||
* BaseClient constructor.
|
||||
|
|
|
@ -22,7 +22,7 @@ class HttpResponseCreated {
|
|||
/**
|
||||
* @var ResponseInterface
|
||||
*/
|
||||
public ResponseInterface $response;
|
||||
public $response;
|
||||
|
||||
/**
|
||||
* @param ResponseInterface $response
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
namespace EasyTiktok\Kernel\Http;
|
||||
|
||||
use EasyTiktok\Kernel\Exceptions\HttpException;
|
||||
use EasyTiktok\Kernel\Exceptions\InvalidConfigException;
|
||||
use EasyTiktok\Kernel\Support\Collection;
|
||||
use GuzzleHttp\Psr7\Response as GuzzleResponse;
|
||||
use Psr\Http\Message\ResponseInterface;
|
||||
|
|
|
@ -16,22 +16,22 @@ class ServiceContainer extends Container {
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected string $id;
|
||||
protected $id;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected array $providers = [];
|
||||
protected $providers = [];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected array $defaultConfig = [];
|
||||
protected $defaultConfig = [];
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected array $userConfig = [];
|
||||
protected $userConfig = [];
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
|
|
|
@ -28,7 +28,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
protected array $items = [];
|
||||
protected $items = [];
|
||||
|
||||
/**
|
||||
* set data.
|
||||
|
|
|
@ -22,7 +22,7 @@ class File {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static array $extensionMap = [
|
||||
protected static $extensionMap = [
|
||||
'audio/wav' => '.wav',
|
||||
'audio/x-ms-wma' => '.wma',
|
||||
'video/x-ms-wmv' => '.wmv',
|
||||
|
@ -68,7 +68,7 @@ class File {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static array $signatures = [
|
||||
protected static $signatures = [
|
||||
'ffd8ff' => '.jpg',
|
||||
'424d' => '.bmp',
|
||||
'47494638' => '.gif',
|
||||
|
|
|
@ -22,21 +22,21 @@ class Str {
|
|||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static array $snakeCache = [];
|
||||
protected static $snakeCache = [];
|
||||
|
||||
/**
|
||||
* The cache of camel-cased words.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static array $camelCache = [];
|
||||
protected static $camelCache = [];
|
||||
|
||||
/**
|
||||
* The cache of studly-cased words.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected static array $studlyCache = [];
|
||||
protected static $studlyCache = [];
|
||||
|
||||
/**
|
||||
* Convert a value to camel case.
|
||||
|
|
|
@ -28,22 +28,22 @@ trait HasHttpRequests {
|
|||
/**
|
||||
* @var ClientInterface
|
||||
*/
|
||||
protected ClientInterface $httpClient;
|
||||
protected $httpClient;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected array $middlewares = [];
|
||||
protected $middlewares = [];
|
||||
|
||||
/**
|
||||
* @var HandlerStack
|
||||
*/
|
||||
protected HandlerStack $handlerStack;
|
||||
protected $handlerStack;
|
||||
|
||||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected static array $defaults = [
|
||||
protected static $defaults = [
|
||||
'curl' => [
|
||||
CURLOPT_IPRESOLVE => CURL_IPRESOLVE_V4,
|
||||
],
|
||||
|
|
|
@ -27,7 +27,7 @@ trait InteractsWithCache {
|
|||
/**
|
||||
* @var SimpleCacheInterface
|
||||
*/
|
||||
protected SimpleCacheInterface $cache;
|
||||
protected $cache;
|
||||
|
||||
/**
|
||||
* Get cache instance.
|
||||
|
|
|
@ -20,7 +20,7 @@ class Application extends ServiceContainer {
|
|||
/**
|
||||
* @var array
|
||||
*/
|
||||
protected array $providers = [
|
||||
protected $providers = [
|
||||
Base\ServiceProvider::class,
|
||||
Auth\ServiceProvider::class
|
||||
];
|
||||
|
@ -29,7 +29,7 @@ class Application extends ServiceContainer {
|
|||
* 初始化小程序的基础接口
|
||||
* @var array|\string[][]
|
||||
*/
|
||||
protected array $defaultConfig = [
|
||||
protected $defaultConfig = [
|
||||
'http' => [
|
||||
'base_uri' => 'https://developer.toutiao.com/api/',
|
||||
],
|
||||
|
|
|
@ -17,17 +17,17 @@ class AccessToken extends BaseAccessToken {
|
|||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected string $requestMethod = 'POST';
|
||||
protected $requestMethod = 'POST';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected string $tokenKey = 'mini_program_access_token';
|
||||
protected $tokenKey = 'mini_program_access_token';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*/
|
||||
protected string $endpointToGetToken = 'apps/v2/token';
|
||||
protected $endpointToGetToken = 'apps/v2/token';
|
||||
|
||||
/**
|
||||
* @return array
|
||||
|
|
Loading…
Reference in New Issue