Api文档
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

32 lines
740 B

<?php
namespace Plugins\ApiDoc\Admin\Attributes;
use JetBrains\PhpStorm\ExpectedValues;
/**
* Class Api
*
* @author chenlong<vip_chenlong@163.com>
* @date 2022/5/17 9:59
*/
#[\Attribute(\Attribute::TARGET_METHOD|\Attribute::TARGET_CLASS)]
class Api
{
public ?string $isAuthenticate = null;
/**
* @param bool $isAuthenticate 是否需要认证
*/
public function __construct(#[ExpectedValues(['strength', 'weak', true, false])] bool|string $isAuthenticate = false)
{
if ($isAuthenticate === true) {
$isAuthenticate = 'strength';
}
if ($isAuthenticate === false) {
$isAuthenticate = null;
}
$this->isAuthenticate = $isAuthenticate;
}
}