mirror of
https://github.com/zhamao-robot/zhamao-framework.git
synced 2026-07-08 09:15:37 +08:00
PHP80 小修 (#187)
* migrate-php80 fix styles fix static analyse * fix some bugs
This commit is contained in:
@@ -4,7 +4,7 @@ declare(strict_types=1);
|
||||
|
||||
namespace ZM\Annotation;
|
||||
|
||||
abstract class AnnotationBase implements \IteratorAggregate
|
||||
abstract class AnnotationBase implements \IteratorAggregate, \Stringable
|
||||
{
|
||||
/** @var array|\Closure|string 方法名或闭包 */
|
||||
public \Closure|string|array $method = '';
|
||||
@@ -13,9 +13,9 @@ abstract class AnnotationBase implements \IteratorAggregate
|
||||
|
||||
public array $group = [];
|
||||
|
||||
public function __toString()
|
||||
public function __toString(): string
|
||||
{
|
||||
$str = __CLASS__ . ': ';
|
||||
$str = self::class . ': ';
|
||||
foreach ($this as $k => $v) {
|
||||
$str .= "\n\t" . $k . ' => ';
|
||||
if (is_string($v)) {
|
||||
@@ -39,10 +39,8 @@ abstract class AnnotationBase implements \IteratorAggregate
|
||||
|
||||
/**
|
||||
* 在 InstantPlugin 下调用,设置回调或匿名函数
|
||||
*
|
||||
* @param \Closure|string $method
|
||||
*/
|
||||
public function on($method): AnnotationBase
|
||||
public function on(\Closure|callable|string $method): AnnotationBase
|
||||
{
|
||||
$this->method = $method;
|
||||
return $this;
|
||||
|
||||
Reference in New Issue
Block a user