modified 降低PHP版本,以兼容更多的项目

This commit is contained in:
zhaoxiang 2021-11-16 16:07:21 +08:00
parent 0575c220b0
commit be3c52c505
13 changed files with 30 additions and 32 deletions

View File

@ -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);
}

View File

@ -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.

View File

@ -27,11 +27,11 @@ class BaseClient {
/**
* @var ServiceContainer
*/
protected ServiceContainer $app;
protected $app;
/**
* @var string
*/
protected string $baseUri;
protected $baseUri;
/**
* BaseClient constructor.

View File

@ -22,7 +22,7 @@ class HttpResponseCreated {
/**
* @var ResponseInterface
*/
public ResponseInterface $response;
public $response;
/**
* @param ResponseInterface $response

View File

@ -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;

View File

@ -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.

View File

@ -28,7 +28,7 @@ class Collection implements ArrayAccess, Countable, IteratorAggregate, JsonSeria
*
* @var array
*/
protected array $items = [];
protected $items = [];
/**
* set data.

View File

@ -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',

View File

@ -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.

View File

@ -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,
],

View File

@ -27,7 +27,7 @@ trait InteractsWithCache {
/**
* @var SimpleCacheInterface
*/
protected SimpleCacheInterface $cache;
protected $cache;
/**
* Get cache instance.

View File

@ -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/',
],

View File

@ -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