PHPDoc
This commit is contained in:
parent
074f1805eb
commit
2489b52da2
@ -15,7 +15,8 @@
|
||||
},
|
||||
"require-dev": {
|
||||
"phpunit/phpunit": "^9.0",
|
||||
"mockery/mockery": "^1.4"
|
||||
"mockery/mockery": "^1.4",
|
||||
"phpstan/phpstan": "^0.12.68"
|
||||
},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
@ -27,4 +28,4 @@
|
||||
"JerryYan\\DSL\\Test\\": "tests"
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -15,11 +15,11 @@ use JerryYan\DSL\Token\TokenUndefined;
|
||||
|
||||
abstract class FactoryInterface
|
||||
{
|
||||
/** @var array<string, \JerryYan\DSL\Token\TokenInterface> Token类型及映射类 */
|
||||
/** @var array<string, class-string<TokenInterface>> Token类型及映射类 */
|
||||
protected $tokenMap = [];
|
||||
/** @var array<string, string> Token别名映射 */
|
||||
protected $tokenNameMap = [];
|
||||
/** @var \JerryYan\DSL\Token\TokenInterface 默认Token类 */
|
||||
/** @var class-string<TokenInterface> 默认Token类 */
|
||||
protected $undefinedTokenClass = TokenUndefined::class;
|
||||
|
||||
public function getTokenByName(string $name): TokenInterface
|
||||
|
@ -17,7 +17,7 @@ use PHPUnit\Framework\TestCase;
|
||||
|
||||
class TokenInterfaceTest extends TestCase
|
||||
{
|
||||
/** @var TokenInterface[] TokenClass */
|
||||
/** @var class-string<TokenInterface>[] TokenClass */
|
||||
private $tokenTypes = [
|
||||
TokenAnd::class,
|
||||
TokenDefine::class,
|
||||
@ -29,7 +29,7 @@ class TokenInterfaceTest extends TestCase
|
||||
protected $chainLast;
|
||||
protected function setUp(): void
|
||||
{
|
||||
/** @var ?TokenInterface $next */
|
||||
/** @var ?TokenInterface $last */
|
||||
$last = NULL;
|
||||
foreach ($this->tokenTypes as $cls) {
|
||||
/** @var TokenInterface $current */
|
||||
|
@ -21,6 +21,7 @@ class TokenizerTest extends TestCase
|
||||
protected $tokenizer;
|
||||
protected $reader;
|
||||
private $text = "这个 和 那个 或者 那个 和 这个";
|
||||
/** @var class-string<TokenInterface>[] 预期的类型 */
|
||||
private $textTokenType = [
|
||||
TokenVar::class,
|
||||
TokenAnd::class,
|
||||
|
Loading…
x
Reference in New Issue
Block a user