Skip to content

Commit d3bdd2c

Browse files
committed
Merge branch '8.x' of github.com:top-think/framework into 8.x
2 parents 0a2a51f + d45fabb commit d3bdd2c

File tree

32 files changed

+424
-162
lines changed

32 files changed

+424
-162
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ jobs:
1515
strategy:
1616
fail-fast: true
1717
matrix:
18-
php: [8.0, 8.1, 8.2, 8.3, 8.4]
18+
php: [8.0, 8.1, 8.2, 8.3, 8.4, 8.5]
1919

2020
name: PHP ${{ matrix.php }}
2121

src/helper.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,9 +42,9 @@
4242
if (!function_exists('abort')) {
4343
/**
4444
* 抛出HTTP异常
45-
* @param integer|Response $code 状态码 或者 Response对象实例
46-
* @param string $message 错误信息
47-
* @param array $header 参数
45+
* @param int|Response $code 状态码 或者 Response对象实例
46+
* @param string $message 错误信息
47+
* @param array $header 参数
4848
*/
4949
function abort($code, string $message = '', array $header = [])
5050
{

src/think/App.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ class App extends Container
4343
* 核心框架版本
4444
* @deprecated 已经废弃 请改用version()方法
4545
*/
46-
const VERSION = '8.0.0';
46+
public const VERSION = '8.0.0';
4747

4848
/**
4949
* 应用调试模式
@@ -71,7 +71,7 @@ class App extends Container
7171

7272
/**
7373
* 应用内存初始占用
74-
* @var integer
74+
* @var int
7575
*/
7676
protected $beginMem;
7777

@@ -427,7 +427,7 @@ public function getBeginTime(): float
427427
/**
428428
* 获取应用初始内存占用
429429
* @access public
430-
* @return integer
430+
* @return int
431431
*/
432432
public function getBeginMem(): int
433433
{

src/think/Console.php

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@
2828
use think\console\command\make\Subscribe;
2929
use think\console\command\make\Validate;
3030
use think\console\command\optimize\Config;
31+
use think\console\command\optimize\Optimize;
3132
use think\console\command\optimize\Route;
3233
use think\console\command\optimize\Schema;
3334
use think\console\command\RouteList;
@@ -70,6 +71,7 @@ class Console
7071
'make:listener' => Listener::class,
7172
'make:service' => Service::class,
7273
'make:subscribe' => Subscribe::class,
74+
'optimize' => Optimize::class,
7375
'optimize:config' => Config::class,
7476
'optimize:route' => Route::class,
7577
'optimize:schema' => Schema::class,
@@ -785,5 +787,4 @@ private function extractAllNamespaces(string $name): array
785787

786788
return $namespaces;
787789
}
788-
789790
}

src/think/Cookie.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,7 @@ protected function setCookie(string $name, string $value, int $expire, array $op
135135
* @access public
136136
* @param string $name cookie名称
137137
* @param string $value cookie值
138-
* @param mixed $option 可选参数 可能会是 null|integer|string
138+
* @param mixed $option 可选参数 可能会是 null|int|string
139139
* @return void
140140
*/
141141
public function forever(string $name, string $value = '', $option = null): void

src/think/Event.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,12 @@ public function observe($observer, string $prefix = '')
191191

192192
if (empty($prefix) && $reflect->hasProperty('eventPrefix')) {
193193
$reflectProperty = $reflect->getProperty('eventPrefix');
194-
$reflectProperty->setAccessible(true);
194+
195+
if (PHP_VERSION_ID < 80100) {
196+
// 8.0 版本时调用
197+
$reflectProperty->setAccessible(true);
198+
}
199+
195200
$prefix = $reflectProperty->getValue($observer);
196201
}
197202

src/think/Request.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -604,7 +604,7 @@ public function ext(): string
604604
* 获取当前请求的时间
605605
* @access public
606606
* @param bool $float 是否使用浮点类型
607-
* @return integer|float
607+
* @return int|float
608608
*/
609609
public function time(bool $float = false)
610610
{
@@ -1605,7 +1605,7 @@ public function ip(): string
16051605
* @param string $ip IP地址
16061606
* @param string $type IP地址类型 (ipv4, ipv6)
16071607
*
1608-
* @return boolean
1608+
* @return bool
16091609
*/
16101610
public function isValidIP(string $ip, string $type = ''): bool
16111611
{
@@ -2114,7 +2114,7 @@ public function __get(string $name)
21142114
* 检测中间传递数据的值
21152115
* @access public
21162116
* @param string $name 名称
2117-
* @return boolean
2117+
* @return bool
21182118
*/
21192119
public function __isset(string $name): bool
21202120
{

src/think/Response.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ abstract class Response
3838

3939
/**
4040
* 状态码
41-
* @var integer
41+
* @var int
4242
*/
4343
protected $code = 200;
4444

@@ -277,7 +277,7 @@ public function content($content)
277277
/**
278278
* 发送HTTP状态
279279
* @access public
280-
* @param integer $code 状态码
280+
* @param int $code 状态码
281281
* @return $this
282282
*/
283283
public function code(int $code)
@@ -406,7 +406,7 @@ public function getContent(): string
406406
/**
407407
* 获取状态码
408408
* @access public
409-
* @return integer
409+
* @return int
410410
*/
411411
public function getCode(): int
412412
{

src/think/cache/Driver.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,13 +36,13 @@ abstract class Driver implements CacheHandlerInterface
3636

3737
/**
3838
* 缓存读取次数
39-
* @var integer
39+
* @var int
4040
*/
4141
protected $readTimes = 0;
4242

4343
/**
4444
* 缓存写入次数
45-
* @var integer
45+
* @var int
4646
*/
4747
protected $writeTimes = 0;
4848

@@ -61,7 +61,7 @@ abstract class Driver implements CacheHandlerInterface
6161
/**
6262
* 获取有效期
6363
* @access protected
64-
* @param integer|DateInterval|DateTimeInterface $expire 有效期
64+
* @param int|DateInterval|DateTimeInterface $expire 有效期
6565
* @return int
6666
*/
6767
protected function getExpireTime(int | DateInterval | DateTimeInterface $expire): int

src/think/cache/TagSet.php

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ public function __construct(protected array $tag, protected Driver $handler)
3333
/**
3434
* 写入缓存
3535
* @access public
36-
* @param string $name 缓存变量名
37-
* @param mixed $value 存储数据
38-
* @param integer|DateInterval|DateTimeInterface $expire 有效时间(秒)
36+
* @param string $name 缓存变量名
37+
* @param mixed $value 存储数据
38+
* @param int|DateInterval|DateTimeInterface $expire 有效时间(秒)
3939
* @return bool
4040
*/
4141
public function set($name, $value, $expire = null): bool

0 commit comments

Comments
 (0)