add cs fixer and PHPStan and activate it (build 436)

This commit is contained in:
crazywhalecc
2022-03-15 18:05:33 +08:00
parent d01bd69aa5
commit 1706afbcd0
163 changed files with 4572 additions and 3588 deletions

View File

@@ -1,18 +1,22 @@
<?php
declare(strict_types=1);
namespace ZM\Entity;
class CQObject
{
public $type;
public $params;
public $start;
public $end;
public function __construct($type = "", $params = [], $start = 0, $end = 0) {
if ($type !== "") {
public function __construct($type = '', $params = [], $start = 0, $end = 0)
{
if ($type !== '') {
$this->type = $type;
$this->params = $params;
$this->start = $start;
@@ -20,7 +24,8 @@ class CQObject
}
}
public static function fromArray($arr): CQObject {
return new CQObject($arr["type"], $arr["params"] ?? [], $arr["start"], $arr["end"]);
public static function fromArray($arr): CQObject
{
return new CQObject($arr['type'], $arr['params'] ?? [], $arr['start'], $arr['end']);
}
}
}

View File

@@ -1,17 +1,19 @@
<?php
declare(strict_types=1);
namespace ZM\Entity;
use ZM\Annotation\CQ\CQCommand;
class MatchResult
{
/** @var bool */
public $status = false;
/** @var CQCommand|null */
public $object = null;
/** @var null|CQCommand */
public $object;
/** @var array */
public $match = [];
}
}